[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/drupal-mode 55a523b65f 046/308: No need to restart check s
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/drupal-mode 55a523b65f 046/308: No need to restart check since flymake-phpcs 1.0.4 |
Date: |
Tue, 25 Jan 2022 10:59:17 -0500 (EST) |
branch: elpa/drupal-mode
commit 55a523b65fe53ca06f429cffd91ead6ff76667d2
Author: Arne Jørgensen <arne@arnested.dk>
Commit: Arne Jørgensen <arne@arnested.dk>
No need to restart check since flymake-phpcs 1.0.4
---
drupal-mode.el | 79 +++++++++++++++++++++++++++++--------------------
drupal/flymake-phpcs.el | 7 +----
2 files changed, 48 insertions(+), 38 deletions(-)
diff --git a/drupal-mode.el b/drupal-mode.el
index 96af6da75a..c56d2269ff 100644
--- a/drupal-mode.el
+++ b/drupal-mode.el
@@ -167,7 +167,8 @@ Include path to the executable if it is not in your $PATH."
:keymap drupal-mode-map
;; Detect drupal version, drupal root, etc.
- (drupal-detect-drupal-version)
+ (unless drupal-version
+ (drupal-detect-drupal-version))
;; Delete trailing white space.
(when (eq drupal-delete-trailing-whitespace 'always)
@@ -253,6 +254,15 @@ 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))))
@@ -302,44 +312,49 @@ 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)
- (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
+ (unless drupal-detect-drupal-version-in-progress
+ (let ((drupal-detect-drupal-version-in-progress t))
+ (hack-local-variables)
(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)
+ (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)))
(defun drupal-locate-dominating-module (file &optional info-file-location)
"Look up the directory hierarchy from FILE for a Drupal module root.
diff --git a/drupal/flymake-phpcs.el b/drupal/flymake-phpcs.el
index 00e909449b..80d7951fec 100644
--- a/drupal/flymake-phpcs.el
+++ b/drupal/flymake-phpcs.el
@@ -34,12 +34,7 @@
;; 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))
-
- ;; We have probably set `flymake-phpcs-standard' after a syntax
- ;; check was initiated - so kill it and start syntax check again.
- (flymake-stop-all-syntax-checks)
- (flymake-start-syntax-check)))
+ `(,(concat "\\." (file-name-extension (buffer-file-name))
"\\'") flymake-phpcs-init))))
(add-hook 'drupal-mode-hook 'drupal/flymake-phpcs-enable)
- [nongnu] elpa/drupal-mode 8828357fe8 031/308: Stripped section heading lines in plain ascii., (continued)
- [nongnu] elpa/drupal-mode 8828357fe8 031/308: Stripped section heading lines in plain ascii., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 35c9e17240 037/308: Rewrote Makefile., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 85dabbf20a 030/308: Refactored a lot of code., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 74fe12bd47 033/308: Bumped version to 0.2.0., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode f95aa10028 038/308: Optimized variable expansion in Makefile., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode f04ae2825d 034/308: Merge branch 'release/0.2.0', ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode c8832210b3 032/308: Documentation was rewritten and extended., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode dec5279338 041/308: Removed generated file drupal-mode.info., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode c68f560494 075/308: Fixed regexp for extracting function arguments., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode cda13dfb21 063/308: Added better bootstrapping of Drupal mode., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 55a523b65f 046/308: No need to restart check since flymake-phpcs 1.0.4,
ELPA Syncer <=
- [nongnu] elpa/drupal-mode f02cb3d8eb 044/308: Drupal version also outside full projects., ELPA Syncer, 2022/01/25
- [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