Skip to content

Commit bcde707

Browse files
committed
Moved etags support to its own file.
1 parent 6fbdb4e commit bcde707

File tree

3 files changed

+25
-6
lines changed

3 files changed

+25
-6
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ README: README.md
1111
pandoc -t plain -o $@ $^
1212

1313
# create a tar ball in package.el format for uploading to http://marmalade-repo.org
14-
elpa-package: README drupal-mode.el drupal-mode-pkg.el drupal-mode.info dir
14+
elpa-package: README drupal-mode.el drupal-mode-pkg.el drupal-mode.info dir drupal/*.el
1515
tar -c -s "@^@drupal-mode-${VERSION}/@" -f drupal-mode-${VERSION}.tar $^
1616

1717
elpa-install: elpa-package

drupal-mode.el

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,6 @@ According to http://drupal.org/coding-standards#indenting."
139139
(c-add-language 'drupal-mode 'c-mode)
140140
(c-set-style "drupal"))
141141

142-
;; setup TAGS file for etags if it exists in DRUPAL_ROOT
143-
(when (and (boundp 'drupal-root)
144-
(file-exists-p (concat drupal-root "TAGS")))
145-
(setq tags-file-name (concat drupal-root "TAGS")))
146-
147142
;; handle line ending and trailing whitespace
148143
(add-hook 'before-save-hook 'drupal-convert-line-ending)
149144
(add-hook 'before-save-hook 'drupal-delete-trailing-whitespace))
@@ -309,6 +304,9 @@ mode-hook, i.e.
309304
(add-to-list 'auto-mode-alist '("\\.\\(module\\|test\\|install\\|theme\\|tpl\\.php\\)$" . php-mode))
310305
(add-to-list 'auto-mode-alist '("\\.info$" . conf-windows-mode)))
311306

307+
;; Load support for various Emacs features if necessary.
308+
(eval-after-load 'etags '(require 'drupal/etags))
309+
312310

313311

314312
(provide 'drupal-mode)

drupal/etags.el

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
;;; drupal/etags.el --- Drupal-mode support for etags
2+
3+
;;; Commentary:
4+
5+
;; Enable drupal-mode support for etags.
6+
7+
;;; Code:
8+
9+
(defun drupal/etags-enable ()
10+
"Setup TAGS file for etags if it exists in DRUPAL_ROOT."
11+
(when (and (boundp 'drupal-root)
12+
(file-exists-p (concat drupal-root "TAGS")))
13+
(setq tags-file-name (concat drupal-root "TAGS"))))
14+
15+
(add-hook 'drupal-mode-hook 'drupal/etags-enable)
16+
17+
18+
19+
(provide 'drupal/etags)
20+
21+
;;; drupal/etags.el ends here

0 commit comments

Comments
 (0)