EMACS: autoload gtags and use different hooks for version <24
This commit is contained in:
parent
ba3827f6d4
commit
8db229fa48
1 changed files with 24 additions and 16 deletions
|
@ -104,6 +104,20 @@
|
|||
(autoload 'xmodmap-mode "xmodmap-mode" "Major mode for xmodmap" t)
|
||||
(add-to-list 'auto-mode-alist '("\\.[xX]modmap\\(rc\\)?$" . xmodmap-mode))
|
||||
|
||||
;;; Gtags
|
||||
(autoload 'gtags-mode "gtags" "Minor mode for using gtags" t)
|
||||
(add-hook 'gtags-mode-hook
|
||||
(lambda ()
|
||||
(local-set-key (kbd "M-,") 'gtags-find-tag) ; find a tag,
|
||||
; also M-.
|
||||
(local-set-key (kbd "M-.") 'gtags-find-rtag))) ; reverse
|
||||
; tag
|
||||
|
||||
(add-hook 'c-mode-common-hook
|
||||
(lambda ()
|
||||
(gtags-mode t)
|
||||
(djcb-gtags-create-or-update)))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; REQUIRES ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
@ -229,7 +243,14 @@
|
|||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
(add-hook 'before-save-hook 'on-before-save)
|
||||
(add-hook 'after-save-hook 'on-after-save)
|
||||
(add-hook 'prog-mode-hook 'on-prog-mode)
|
||||
|
||||
(if (>= emacs-major-version 24)
|
||||
(add-hook 'prog-mode-hook 'on-prog-mode)
|
||||
(progn
|
||||
(add-hook 'c-mode-common-hook 'on-prog-mode)
|
||||
(add-hook 'go-mode-hook 'on-prog-mode)
|
||||
(add-hook 'emacs-lisp-mode-hook 'on-prog-mode)))
|
||||
|
||||
(add-hook 'c-mode-hook 'on-c-mode)
|
||||
(add-hook 'html-mode-hook 'on-html-mode)
|
||||
(add-hook 'php-mode-hook 'on-php-mode)
|
||||
|
@ -238,19 +259,6 @@
|
|||
(add-hook 'css-mode-hook 'rainbow-mode)
|
||||
(add-hook 'after-make-frame-functions 'setup-system-frame-colours t)
|
||||
|
||||
(add-hook 'gtags-mode-hook
|
||||
(lambda ()
|
||||
(local-set-key (kbd "M-,") 'gtags-find-tag) ; find a tag,
|
||||
; also M-.
|
||||
(local-set-key (kbd "M-.") 'gtags-find-rtag))) ; reverse
|
||||
; tag
|
||||
|
||||
(add-hook 'c-mode-common-hook
|
||||
(lambda ()
|
||||
(require 'gtags)
|
||||
(gtags-mode t)
|
||||
(djcb-gtags-create-or-update)))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; SKELETONS ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
|
Loading…
Reference in a new issue