Skip to content

Commit accf63b

Browse files
committed
Made blacklist a configurable regexp.
1 parent 6f2b217 commit accf63b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drupal-mode.el

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,12 @@ Include path to the executable if it is not in your $PATH."
170170
:type '(repeat symbol)
171171
:group 'drupal)
172172

173+
;;;###autoload
174+
(defcustom drupal-ignore-paths-regexp "\\(vendor\\|node_modules\\)"
175+
"Don't enable Drupal mode per default in files whose path match this regexp."
176+
:type 'regexp
177+
:group 'drupal)
178+
173179
(defcustom drupal-enable-auto-fill-mode t
174180
"Whether to use `auto-fill-mode' in Drupal PHP buffers.
175181
Drupal mode will only do auto fill in comments (auto filling code
@@ -848,7 +854,7 @@ mode-hook."
848854
(when (and
849855
(or drupal-version
850856
(string-match "drush" (or buffer-file-name default-directory)))
851-
(not (string-match "vendor" (or buffer-file-name default-directory))))
857+
(not (string-match drupal-ignore-paths-regexp (or buffer-file-name default-directory))))
852858
(drupal-mode 1))))
853859

854860
;;;###autoload

0 commit comments

Comments
 (0)