[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/drupal-mode b4496a561f 047/308: Revert parts of 55a523b65f
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/drupal-mode b4496a561f 047/308: Revert parts of 55a523b65fe53ca06f429cffd91ead6ff76667d2 |
Date: |
Tue, 25 Jan 2022 10:59:19 -0500 (EST) |
branch: elpa/drupal-mode
commit b4496a561f1f88329ada6ef5330958ef6d65cfbf
Author: Arne Jørgensen <arne@arnested.dk>
Commit: Arne Jørgensen <arne@arnested.dk>
Revert parts of 55a523b65fe53ca06f429cffd91ead6ff76667d2
This reverts parts of commit 55a523b65fe53ca06f429cffd91ead6ff76667d2.
Only the changes to drupal/flymake-phpcs.el should have been commited
so reverting the changes to drupal-mode.el.
---
drupal-mode.el | 79 ++++++++++++++++++++++++----------------------------------
1 file changed, 32 insertions(+), 47 deletions(-)
diff --git a/drupal-mode.el b/drupal-mode.el
index c56d2269ff..96af6da75a 100644
--- a/drupal-mode.el
+++ b/drupal-mode.el
@@ -167,8 +167,7 @@ Include path to the executable if it is not in your $PATH."
:keymap drupal-mode-map
;; Detect drupal version, drupal root, etc.
- (unless drupal-version
- (drupal-detect-drupal-version))
+ (drupal-detect-drupal-version)
;; Delete trailing white space.
(when (eq drupal-delete-trailing-whitespace 'always)
@@ -254,15 +253,6 @@ of the project)."
(cons "Drupal" (make-sparse-keymap "Drupal")))
;; Define specific subcommands in this menu.
-(define-key drupal-mode-map
- [menu-bar drupal flattr]
- '("Flattr Drupal Mode" . (lambda () (interactive) (browse-url
"https://flattr.com/thing/511837"))))
-(define-key drupal-mode-map
- [menu-bar drupal github]
- '("Drupal Mode on GitHub" . (lambda () (interactive) (browse-url
"https://github.com/arnested/drupal-mode"))))
-(define-key drupal-mode-map
- [menu-bar drupal separator]
- '("--"))
(define-key drupal-mode-map
[menu-bar drupal customize]
'("Customize Drupal Mode" . (lambda () (interactive) (customize-group
'drupal))))
@@ -312,49 +302,44 @@ should save your files with unix style end of line."
-(defvar drupal-detect-drupal-version-in-progress nil
- "Detect in progress.")
-
;; Detect Drupal and Drupal version
(defun drupal-detect-drupal-version ()
"Detect if the buffer is part of a Drupal project.
If part of a Drupal project also detect the version of Drupal and
the location of DRUPAL_ROOT."
(interactive)
- (unless drupal-detect-drupal-version-in-progress
- (let ((drupal-detect-drupal-version-in-progress t))
- (hack-local-variables)
+ (hack-local-variables)
+ (when (not drupal-version)
+ (dolist (file '("modules/system/system.module" "includes/bootstrap.inc"
"core/includes/bootstrap.inc"))
+ (let ((here (or buffer-file-name dired-directory)))
+ (when here
+ (let ((dir (locate-dominating-file here file)))
+ (when dir
+ (with-current-buffer (find-file-noselect (concat dir file) t)
+ (save-excursion
+ (widen)
+ (goto-char (point-min))
+ (when (re-search-forward "\\(define('VERSION',\\|const
VERSION =\\) +'\\(.+\\)'" nil t)
+ (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)))))))))
+ (let ((module (drupal-locate-dominating-module buffer-file-name t))
+ (version drupal-version))
+ (when module
(when (not drupal-version)
- (dolist (file '("modules/system/system.module"
"includes/bootstrap.inc" "core/includes/bootstrap.inc"))
- (let ((here (or buffer-file-name dired-directory)))
- (when here
- (let ((dir (locate-dominating-file here file)))
- (when dir
- (with-current-buffer (find-file-noselect (concat dir file) t)
- (save-excursion
- (widen)
- (goto-char (point-min))
- (when (re-search-forward "\\(define('VERSION',\\|const
VERSION =\\) +'\\(.+\\)'" nil t)
- (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)))))))))
- (let ((module (drupal-locate-dominating-module buffer-file-name t))
- (version drupal-version))
- (when module
- (when (not drupal-version)
- (with-current-buffer (find-file-noselect module t)
- (save-excursion
- (widen)
- (goto-char (point-min))
- (re-search-forward "core *= *\"?\\(.+\\)\"?" nil t)
- (setq version (match-string-no-properties 1)))))
- (dir-locals-set-class-variables 'drupal-module `((nil .
((drupal-module . ,(file-name-nondirectory
-
(file-name-sans-extension module)))
-
(drupal-version . ,version)))))
- (dir-locals-set-directory-class (file-name-directory module)
'drupal-module)))
- (hack-local-variables)
- drupal-version)))
+ (with-current-buffer (find-file-noselect module t)
+ (save-excursion
+ (widen)
+ (goto-char (point-min))
+ (re-search-forward "core *= *\"?\\(.+\\)\"?" nil t)
+ (setq version (match-string-no-properties 1)))))
+ (dir-locals-set-class-variables 'drupal-module `((nil . ((drupal-module
. ,(file-name-nondirectory
+
(file-name-sans-extension module)))
+ (drupal-version
. ,version)))))
+ (dir-locals-set-directory-class (file-name-directory module)
'drupal-module)))
+ (hack-local-variables)
+ drupal-version)
(defun drupal-locate-dominating-module (file &optional info-file-location)
"Look up the directory hierarchy from FILE for a Drupal module root.
- [nongnu] elpa/drupal-mode d9a34a4a5f 065/308: Enabled `gtags-mode` if GTAGS is in use., (continued)
- [nongnu] elpa/drupal-mode d9a34a4a5f 065/308: Enabled `gtags-mode` if GTAGS is in use., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode f491ac72b9 081/308: Redefined key bindings., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 8e19894d55 051/308: `drupal-insert-hook' got completing-read support., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode af2b2c5a76 118/308: Changed `replace-regexp-in-string` to `subst-char-in-string`., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 243db30a93 004/308: Compiled elisp should not be committed., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 21a3c7544d 049/308: Drupal menu adjusted., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode d3b4c6f1e7 112/308: Added variable for GNU GLOBAL`global' command., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode f150913830 050/308: Added skeletons for functions and hooks., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 6a7322f581 052/308: Optimized for byte-compile by using #' shorthand., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode d0031d4c1f 056/308: Added/adjusted COPYING information., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode b4496a561f 047/308: Revert parts of 55a523b65fe53ca06f429cffd91ead6ff76667d2,
ELPA Syncer <=
- [nongnu] elpa/drupal-mode b34cc6fb8f 042/308: Ensured flymake-phpcs is run in php-mode buffers., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 88d744068c 073/308: Fixed regexp., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode d23d66e624 083/308: Support `php-extras-eldoc-documentation-function'., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode d73965852e 085/308: Fixed flaw in `drupal-major-version'., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 5c53b742fb 087/308: Improved buffer-file-name fallbacks., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode e65bf476cd 090/308: Fixed module version for Drupal core modules., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 0ef0569693 088/308: Fixed keyboard shortcuts in documentation., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 767d490751 094/308: Removed `web-mode' from `auto-mode-alist'., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 469ff86a3e 120/308: Changed `css-indent-offset' to `css-indent-level'., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 6022df5bd8 126/308: Merge remote-tracking branch 'origin/pr/34' into develop., ELPA Syncer, 2022/01/25