Skip to content

Commit

Permalink
- Add cedet configuration
Browse files Browse the repository at this point in the history
- add function for autoinstallation of packages
- autoinstall undo-tree package
  • Loading branch information
lollinus committed Jun 23, 2014
1 parent b0de93e commit 3398a50
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -6,3 +6,6 @@
/server
/url/cookies
ac-comphist.dat
semanticdb
ede-projects.el
site-lisp/nxhtml/etc/schema/xhtml-loader.rnc
1 change: 1 addition & 0 deletions init.el
Expand Up @@ -19,6 +19,7 @@
(load "~/.emacs.d/rc/rc-flymake.el")
(load "~/.emacs.d/rc/rc-google-c-style.el")
(load "~/.emacs.d/rc/rc-iedit.el")
(load "~/.emacs.d/rc/rc-cedet.el")

;; Load ruby only when needed
;;(load "~/.emacs.d/rc/rc-ruby.el")
Expand Down
25 changes: 25 additions & 0 deletions rc/rc-cedet.el
@@ -0,0 +1,25 @@
;;; rc-cedet.el ---

; turn on Semantic
(semantic-mode 1)

; lets' define a function which adds semantic as a suggestion backend to auto complete
; and hook this function to c-mode-common-hook
(defun my:add-semantic-to-autocomplete ()
(add-to-list 'ac-sources 'ac-source-semantic)
)
(add-hook 'c-mode-common-hook 'my:add-semantic-to-autocomplete)

; turn on ede mode
(global-ede-mode 1)

;; load local projects if they exists
(if (file-exists-p "~/my-ede-projects.el")
(load "~/my-ede-projects.el")
nil)

; you can use system-include-path for setting up the system header file locaqtions.
; turn on automatic reparsing of open buffers in semantic
(global-semantic-idle-scheduler-mode 1)

;;; rc-cedet.el ends here
35 changes: 25 additions & 10 deletions rc/rc-elpa.el
@@ -1,3 +1,4 @@
;;; rc-elpa.el ---
;; configure melpa package archive

(require 'package)
Expand All @@ -8,16 +9,30 @@
("melpa" . "http://melpa.milkbox.net/packages/")
("marmalade" . "http://marmalade-repo.org/packages/")))

;; (progn
;; (switch-to-buffer
;; (url-retrieve-synchronously
;; "https://raw.github.com/milkypostman/melpa/master/melpa.el"))
;; (package-install-from-buffer (package-buffer-info) 'single))
(defun ensure-package-installed (&rest packages)
"Assure every pacxkage is installed, ask for installation if it's not.
;;(defadvice package-compute-transaction
;; (before package-compute-transaction-reverse (package-list requirements) activate compile)
;; "reverse the requirements"
;; (setq requirements (reverse requirements))
;; (print (requirements)))
Return a list of installed packages or nil ofr every skipped package."
(mapcar
(lambda (package)
;;(package-installed-p 'evil)
(if (package-installed-p package)
nil
(package-install package)))
;; (if (y-or-n-p (format "Package %s is missing. Install it? " package))
;; (package-install package)
;; package)))
packages))

;; make sure to have downloaded archive description.
;; Or use package-archive-contents as suggested by Nicolas Dudebout
(or (file-exists-p package-user-dir)
(package-refresh-contents))

;;(ensure-package-installed 'iedit 'magit) ; --> (nil nil) if iedit and magit are already installed

;; activate installed packages
;; (package-initialize)

(package-initialize)
;;; rc-elpa.el ends here
5 changes: 4 additions & 1 deletion rc/rc-undo-tree.el
@@ -1,3 +1,6 @@
;; rc-undo-tree.el
;;; rc-undo-tree.el ---

(ensure-package-installed 'undo-tree)

(require 'undo-tree)
(global-undo-tree-mode)
1 change: 0 additions & 1 deletion site-lisp/nxhtml/etc/schema/xhtml-loader.rnc

This file was deleted.

0 comments on commit 3398a50

Please sign in to comment.