branch: elpa/drupal-mode
commit 8fc32e7641eaabbf15173a029b13340e56ca9652
Author: Arne Jørgensen <[email protected]>
Commit: Arne Jørgensen <[email protected]>
Made `drupal-detect-drupal-version' more reliable.
But it should be rewritten from scratch to perform better and be less
error prone.
---
drupal-mode.el | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drupal-mode.el b/drupal-mode.el
index 8123ffba4c..6a02bc4fcd 100644
--- a/drupal-mode.el
+++ b/drupal-mode.el
@@ -349,7 +349,8 @@ If part of a Drupal project also detect the version of
Drupal and
the location of DRUPAL_ROOT."
(interactive)
(hack-local-variables)
- (when (not drupal-version)
+ (when (or (not drupal-version)
+ (not drupal-rootdir))
(dolist (file '("modules/system/system.module" "includes/bootstrap.inc"
"core/includes/bootstrap.inc"))
(let ((here (or buffer-file-name dired-directory)))
(when here
@@ -363,7 +364,8 @@ the location of DRUPAL_ROOT."
(dir-locals-set-class-variables 'drupal-site `((nil .
((drupal-version . ,(match-string-no-properties 2))
(drupal-rootdir . ,dir)))))
(dir-locals-set-directory-class dir 'drupal-site)))
- (setq drupal-version (match-string-no-properties 2)))))))))
+ (setq drupal-version (match-string-no-properties 2))))))))
+ (hack-local-variables))
(let ((module (drupal-locate-dominating-module buffer-file-name t))
(version drupal-version))
(when module