emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/drupal-mode 5c53b742fb 087/308: Improved buffer-file-name


From: ELPA Syncer
Subject: [nongnu] elpa/drupal-mode 5c53b742fb 087/308: Improved buffer-file-name fallbacks.
Date: Tue, 25 Jan 2022 10:59:32 -0500 (EST)

branch: elpa/drupal-mode
commit 5c53b742fb17fd4fdafc03c881965b46e04fcd44
Author: Arne Jørgensen <arne@arnested.dk>
Commit: Arne Jørgensen <arne@arnested.dk>

    Improved buffer-file-name fallbacks.
---
 drupal-mode.el          | 6 +++---
 drupal/flymake-phpcs.el | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drupal-mode.el b/drupal-mode.el
index 82e5258ada..edbf9c693a 100644
--- a/drupal-mode.el
+++ b/drupal-mode.el
@@ -478,7 +478,7 @@ the location of DRUPAL_ROOT."
   (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)))
+      (let ((here (or buffer-file-name default-directory)))
         (when here
           (let ((dir (locate-dominating-file here file)))
             (when dir
@@ -492,7 +492,7 @@ the location of DRUPAL_ROOT."
                     (dir-locals-set-directory-class dir 'drupal-site)))
                 (setq drupal-version (match-string-no-properties 2))))))))
     (hack-local-variables))
-  (let ((module (drupal-locate-dominating-module buffer-file-name t))
+  (let ((module (drupal-locate-dominating-module (or buffer-file-name 
default-directory) t))
         (version drupal-version)
         (module-name nil)
         (module-version nil)
@@ -608,7 +608,7 @@ mode-hook."
     (drupal-detect-drupal-version)
     (when drupal-version
       (drupal-mode 1))
-    (when (string-match "drush" buffer-file-name)
+    (when (string-match "drush" (or buffer-file-name default-directory))
       (drupal-drush-mode 1))))
 
 ;;;###autoload
diff --git a/drupal/flymake-phpcs.el b/drupal/flymake-phpcs.el
index 93ba660885..ead33ab7db 100644
--- a/drupal/flymake-phpcs.el
+++ b/drupal/flymake-phpcs.el
@@ -69,7 +69,7 @@ so no need to highlight it twice."
     ;; flymake-phpcs initialize.
     (make-local-variable 'flymake-allowed-file-name-masks)
     (add-to-list 'flymake-allowed-file-name-masks
-                 `(,(concat "\\." (file-name-extension (buffer-file-name)) 
"\\'") flymake-phpcs-init))
+                 `(,(concat "\\." (file-name-extension (or buffer-file-name 
(buffer-name))) "\\'") flymake-phpcs-init))
     (flymake-mode 1)))
 
 (add-hook 'drupal-mode-hook #'drupal/flymake-phpcs-enable)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]