branch: elpa/drupal-mode
commit e4c4c3d6e17c911dfa12fc95defd18494d7de4bb
Author: Arne Jørgensen <[email protected]>
Commit: Arne Jørgensen <[email protected]>

    `drupal-delete-trailing-whitespace' made local var.
    
    Also move `drupal-delete-trailing-whitespace' and
    `drupal-convert-line-ending' out of the minor mode so it will not be
    called everytime the mode is activated.
---
 drupal-mode.el | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drupal-mode.el b/drupal-mode.el
index b52037e1a3..d6b7dd574c 100644
--- a/drupal-mode.el
+++ b/drupal-mode.el
@@ -72,6 +72,7 @@ According to http://drupal.org/coding-standards#indenting.";
           (const :tag "Never" nil))
   :link '(url-link "http://drupal.org/coding-standards#indenting";)
   :group 'drupal)
+(make-variable-buffer-local 'drupal-delete-trailing-whitespace)
 
 ;; Where to lookup symbols
 (defcustom drupal-search-url "http://api.drupal.org/api/search/%v/%s";
@@ -137,11 +138,7 @@ According to http://drupal.org/coding-standards#indenting.";
   (drupal-detect-drupal-version)
   (when (eq major-mode 'php-mode)
     (c-add-language 'drupal-mode 'c-mode)
-    (c-set-style "drupal"))
-
-  ;; handle line ending and trailing whitespace
-  (add-hook 'before-save-hook 'drupal-convert-line-ending)
-  (add-hook 'before-save-hook 'drupal-delete-trailing-whitespace))
+    (c-set-style "drupal")))
 
 (define-minor-mode drupal-drush-mode
   "Advanced minor mode for Drupal Drush 
development.\n\n\\{drupal-drush-mode-map}"
@@ -304,6 +301,10 @@ 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)))
 
+;; Handle line ending and trailing white space.
+(add-hook 'before-save-hook 'drupal-convert-line-ending)
+(add-hook 'before-save-hook 'drupal-delete-trailing-whitespace)
+
 ;; Load support for various Emacs features if necessary.
 (eval-after-load 'etags '(require 'drupal/etags))
 

Reply via email to