[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/drupal-mode de6c1b1442 057/308: Better checking for major
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/drupal-mode de6c1b1442 057/308: Better checking for major modes. |
Date: |
Tue, 25 Jan 2022 10:59:27 -0500 (EST) |
branch: elpa/drupal-mode
commit de6c1b14429e6ffe267a212f622f16ed95899e33
Author: Arne Jørgensen <arne@arnested.dk>
Commit: Arne Jørgensen <arne@arnested.dk>
Better checking for major modes.
---
drupal-mode.el | 21 ++++++++++++++++++---
drupal/flymake-phpcs.el | 2 +-
2 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/drupal-mode.el b/drupal-mode.el
index 03bbe7576c..8aa33e93af 100644
--- a/drupal-mode.el
+++ b/drupal-mode.el
@@ -130,6 +130,21 @@ Include path to the executable if it is not in your $PATH."
:link '(variable-link drupal-drush-program)
:group 'drupal-drush)
+(defcustom drupal-php-modes (list 'php-mode)
+ "Major modes to consider PHP in Drupal mode."
+ :type '(repeat symbol)
+ :group 'drupal)
+
+(defcustom drupal-css-modes (list 'css-mode)
+ "Major modes to consider CSS in Drupal mode."
+ :type '(repeat symbol)
+ :group 'drupal)
+
+(defcustom drupal-js-modes (list 'javascript-mode 'js-mode 'js2-mode)
+ "Major modes to consider JavaScript in Drupal mode."
+ :type '(repeat symbol)
+ :group 'drupal)
+
(defvar drupal-version nil "Drupal version as auto detected.")
@@ -181,7 +196,7 @@ Include path to the executable if it is not in your $PATH."
(add-hook 'before-save-hook #'drupal-convert-line-ending nil t)
;; Stuff special for php-mode buffers.
- (when (eq major-mode 'php-mode)
+ (when (apply 'derived-mode-p drupal-php-modes)
(c-add-language 'drupal-mode 'c-mode)
(c-set-style "drupal")))
@@ -270,7 +285,7 @@ of the project)."
(define-key drupal-mode-map
[menu-bar drupal search-documentation]
'(menu-item "Search documentation" drupal-search-documentation
- :enable (eq major-mode 'php-mode)))
+ :enable (apply 'derived-mode-p drupal-php-modes)))
(define-key drupal-mode-map
[menu-bar drupal cache-clear]
'(menu-item "Clear all caches" drupal-drush-cache-clear
@@ -461,7 +476,7 @@ mode-hook, i.e.
(eval-after-load 'php-mode
'(add-hook 'php-mode-hook 'drupal-mode-bootstrap))"
- (when (eq major-mode 'php-mode)
+ (when (apply 'derived-mode-p drupal-php-modes)
(drupal-detect-drupal-version)
(when drupal-version
(drupal-mode 1))
diff --git a/drupal/flymake-phpcs.el b/drupal/flymake-phpcs.el
index 828f78944d..fa3028a1bd 100644
--- a/drupal/flymake-phpcs.el
+++ b/drupal/flymake-phpcs.el
@@ -39,7 +39,7 @@
(defun drupal/flymake-phpcs-enable ()
"Enable drupal-mode support for flymake-phpcs."
- (when (and (eq major-mode 'php-mode)
+ (when (and (apply 'derived-mode-p (append drupal-php-modes drupal-css-modes
drupal-js-modes))
(executable-find flymake-phpcs-command)
drupal/flymake-phpcs-standard)
;; Set the coding standard to "Drupal" (we checked that it is
- [nongnu] elpa/drupal-mode be281df109 175/308: Added info modes. Drupal Coder Sniffer understands info files as well., (continued)
- [nongnu] elpa/drupal-mode be281df109 175/308: Added info modes. Drupal Coder Sniffer understands info files as well., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 3937ec3f40 002/308: Initial version., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 6e1ef13c5e 001/308: Initial commit, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 7d2d703ab9 017/308: Merge branch 'feature/documentation' into develop, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 6fbdb4e9ad 020/308: Made customization of search URLs more intuitive., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 1e06f39e9f 025/308: Added `drupal-drush-cache-clear'., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 85040ec2e5 062/308: Actually enable flymake-mode in Drupal buffers., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 9c5f0066d5 071/308: Added function arguments on `drupal-insert-hook'., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 6b22e8c714 059/308: Added copyright and author comments., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode bb47e5d71b 086/308: Replaced nested `if's with `cond'., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode de6c1b1442 057/308: Better checking for major modes.,
ELPA Syncer <=
- [nongnu] elpa/drupal-mode 5e5f6e2782 084/308: Added drupal-mode support for `auto-insert-mode'., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 511fa0de3f 104/308: Ensured file extensions are actually extensions., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 8947650b95 119/308: Rewritten Makefile to use Carton., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 043d79f4ff 127/308: Sort imenu entries by name in .make files., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 3f306071da 137/308: Drupal 8 moved the version number to a new file., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 38783166f3 143/308: Check for drupal/flycheck-phpcs-js-and-css in predicate, now we don't enforce it., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 8d57a2a3d6 146/308: Added `hash-table-p` check., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 274015c27a 147/308: Merge pull request #37 from xendk/develop, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 4adeb0c218 150/308: Fixed tar on Mac OS X., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode e20d8fefaa 153/308: Swicth to https links to Drupal.org., ELPA Syncer, 2022/01/25