branch: elpa/drupal-mode
commit bcde7079abe4ec77c4ff5c9fbfe5a3a6b95e884a
Author: Arne Jørgensen <[email protected]>
Commit: Arne Jørgensen <[email protected]>
Moved etags support to its own file.
---
Makefile | 2 +-
drupal-mode.el | 8 +++-----
drupal/etags.el | 21 +++++++++++++++++++++
3 files changed, 25 insertions(+), 6 deletions(-)
diff --git a/Makefile b/Makefile
index 518fa7e3d5..ad7f74d156 100644
--- a/Makefile
+++ b/Makefile
@@ -11,7 +11,7 @@ README: README.md
pandoc -t plain -o $@ $^
# create a tar ball in package.el format for uploading to
http://marmalade-repo.org
-elpa-package: README drupal-mode.el drupal-mode-pkg.el drupal-mode.info dir
+elpa-package: README drupal-mode.el drupal-mode-pkg.el drupal-mode.info dir
drupal/*.el
tar -c -s "@^@drupal-mode-${VERSION}/@" -f drupal-mode-${VERSION}.tar $^
elpa-install: elpa-package
diff --git a/drupal-mode.el b/drupal-mode.el
index d2bed5fedd..b52037e1a3 100644
--- a/drupal-mode.el
+++ b/drupal-mode.el
@@ -139,11 +139,6 @@ According to http://drupal.org/coding-standards#indenting."
(c-add-language 'drupal-mode 'c-mode)
(c-set-style "drupal"))
- ;; setup TAGS file for etags if it exists in DRUPAL_ROOT
- (when (and (boundp 'drupal-root)
- (file-exists-p (concat drupal-root "TAGS")))
- (setq tags-file-name (concat drupal-root "TAGS")))
-
;; handle line ending and trailing whitespace
(add-hook 'before-save-hook 'drupal-convert-line-ending)
(add-hook 'before-save-hook 'drupal-delete-trailing-whitespace))
@@ -309,6 +304,9 @@ mode-hook, i.e.
(add-to-list 'auto-mode-alist
'("\\.\\(module\\|test\\|install\\|theme\\|tpl\\.php\\)$" . php-mode))
(add-to-list 'auto-mode-alist '("\\.info$" . conf-windows-mode)))
+;; Load support for various Emacs features if necessary.
+(eval-after-load 'etags '(require 'drupal/etags))
+
(provide 'drupal-mode)
diff --git a/drupal/etags.el b/drupal/etags.el
new file mode 100644
index 0000000000..cb8d06f068
--- /dev/null
+++ b/drupal/etags.el
@@ -0,0 +1,21 @@
+;;; drupal/etags.el --- Drupal-mode support for etags
+
+;;; Commentary:
+
+;; Enable drupal-mode support for etags.
+
+;;; Code:
+
+(defun drupal/etags-enable ()
+ "Setup TAGS file for etags if it exists in DRUPAL_ROOT."
+ (when (and (boundp 'drupal-root)
+ (file-exists-p (concat drupal-root "TAGS")))
+ (setq tags-file-name (concat drupal-root "TAGS"))))
+
+(add-hook 'drupal-mode-hook 'drupal/etags-enable)
+
+
+
+(provide 'drupal/etags)
+
+;;; drupal/etags.el ends here