Emacs

Emacs 24.3. is installed in the clic software folder Including auctex & reftex (latex mode), cedet and some additional emacs packages.

Add the location of the emacs binary to your path

export PATH=/afs/cern.ch/eng/clic/software/emacs/emacs-24.3.1/bin:${PATH}

Packages

To use the different packages add the following to your .emacs file

Collection of Emacs Development Tools (CEDET)

Add to the list of custom-set-variables (Usually at the top of the .emacs file)
 '(semantic-idle-scheduler-idle-time 3)
 '(semantic-self-insert-show-completion-function (lambda nil (semantic-ia-complete-symbol-menu (point))))

Add this somewhere else in the .emacs file

(load-file "/afs/cern.ch/eng/clic/software/emacs/cedet/lisp/cedet/cedet.el")
(require 'semantic)
(semantic-mode 1)
(global-semantic-decoration-mode 1)
(global-semantic-stickyfunc-mode 1)
(require 'semantic/lex-spp)
(require 'semantic/ia)
(require 'srecode)
  
(defun my-cedet-hook ()
  (local-set-key "\C-c \C-m" 'semantic-ia-complete-symbol)
  (local-set-key "\C-c?" 'semantic-ia-complete-symbol)
  (local-set-key "\C-c>" 'semantic-complete-analyze-inline)
  (local-set-key "\C-c=" 'semantic-decoration-include-visit)
    
  (local-set-key "\C-cj" 'semantic-ia-fast-jump)
  (local-set-key "\C-cq" 'semantic-ia-show-doc)
  (local-set-key "\C-cs" 'semantic-ia-show-summary)
  (local-set-key "\C-cp" 'semantic-analyze-proto-impl-toggle)
)

(add-hook 'c-mode-common-hook 'my-cedet-hook)
(global-srecode-minor-mode 1)

(defun my-c-mode-cedet-hook ()
  (local-set-key "." 'semantic-complete-self-insert) ; starts completion when pressing "."
  (local-set-key ">" 'semantic-complete-self-insert) ; starts completion when pressing  ">"
  (local-set-key "\C-c\C-r" 'semantic-symref)
  )
(add-hook 'c-mode-common-hook 'my-c-mode-cedet-hook)

For c++ add paths to include directories or PreProcessor definitions, just examples, add your own as required

(semantic-add-system-include (concat (getenv "ROOTSYS") "/include/") 'c++-mode)
(add-to-list 'semantic-lex-c-preprocessor-symbol-map '("LCIO_MODE" . "1"))

Call compile command inside emacs

(defun my-c++-mode-hook ()
  (define-key c++-mode-map [f5] 'compile)
  (define-key c++-mode-map [f6] 'next-error)
  (define-key c++-mode-map [f7] 'previous-error)
  (define-key c++-mode-map [f8] 'recompile)
               ;  (local-set-key [F12] 'compile)
  )
(add-hook 'c++-mode-hook 'my-c++-mode-hook)

emacs-for-python

Add to the .emacs file

(add-to-list 'load-path "/afs/cern.ch/eng/clic/software/emacs/LispPackages/emacs-for-python/")
(require 'epy-setup)      ;; It will setup other loads, it is required!
(require 'epy-python)     ;; If you want the python facilities [optional]
(require 'epy-completion) ;; If you want the autocompletion settings [optional]
(require 'epy-editing)    ;; For configurations related to editing [optional]
;(require 'epy-bindings)   ;; For my suggested keybindings [optional]
;(require 'epy-nose)       ;; For nose integration

;;(epy-setup-checker "epylint %f --rcfile=~/DIRAC.pylint.rc")

(require 'highlight-indentation)
(add-hook 'python-mode-hook 'highlight-indentation)


(add-hook 'python-mode-hook '(lambda ()
 (setq python-indent 2)))

;; Python Hook
(add-hook 'python-mode-hook
          (function (lambda ()
                      (setq indent-tabs-mode nil
                            tab-width 2))))

;; Python-mode
(defun my-python-mode-hook ()
  (define-key python-mode-map [f6] 'flymake-goto-next-error)
  (define-key python-mode-map [f7] 'flymake-goto-prev-error)
  )
(add-hook 'python-mode-hook 'my-python-mode-hook)


Add to the PYTHONPATH variable (so that pylint is found) export PYTHONPATH=/afs/cern.ch/eng/clic/software/PythonPackages-Linux_x86_64_glibc-2.12:${PYTHONPATH}

auctex

Add to the list of custom-set-variables (Usually at the top of the .emacs file)
 '(LaTeX-includegraphics-read-file (quote LaTeX-includegraphics-read-file-relative))
 '(LaTeX-top-caption-list (quote ("table")))
 '(TeX-electric-sub-and-superscript t)
 '(TeX-insert-braces nil)
 '(TeX-view-program-list (quote (("ACROBAT" "acroread %o"))))
 '(TeX-view-program-selection (quote (((output-dvi style-pstricks) "dvips and gv") (output-dvi "xdvi") (output-pdf "ACROBAT") (output-html "xdg-open"))))
 '(bibtex-mode-hook (quote (BibTeX-auto-store)) t)
 '(reftex-cite-format (quote default))
 '(reftex-ref-macro-prompt t)

Add this somewhere else in the .emacs file

(load "auctex.el" nil t t)
(load "preview-latex.el" nil t t)

;; ReFTex for cite support
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)   ; with AUCTeX LaTeX mode

(setq TeX-parse-self t) ; Enable parse on load.
(setq TeX-auto-save t) ; Enable parse on save.

misc (Rainbow delimiters, multicursor, puppet, ...)

Installation procedure

Emacs installation

                                                                               
<PathToEmacsSource>/configure --prefix=<installationDir> --with-tiff=no --with-xpm=no --without-gsettings --with-gif=no
make
make install

auctex installation

git clone http://git.savannah.gnu.org/cgit/auctex.git
cd auctex
autogen.sh
./configure --prefix=<auctexInstallationDir> --with-emacs=<emacsInstallationDir>/bin/emacs --without-texmf-dir
make 
make install

cedet installation

git clone http://git.code.sf.net/p/cedet/git cedet
cd cedet
make EMACS=<emacsInstallationDir>/bin/emacs

-- AndreSailer - 24 Jul 2014

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r2 - 2016-11-16 - MarkoPetric
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    CLIC All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright &© 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback