Skip to content

Commit 7ddadec

Browse files
committed
Reduced number of times calling drupal-detect-drupal-version.
1 parent 1a73416 commit 7ddadec

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drupal-mode.el

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,6 @@ function arguments.")
268268
:lighter " Drupal"
269269
:keymap drupal-mode-map
270270

271-
;; Detect drupal version, drupal root, etc.
272-
(drupal-detect-drupal-version)
273-
274271
;; Delete trailing white space.
275272
(when (eq drupal-delete-trailing-whitespace 'always)
276273
(add-hook 'before-save-hook #'delete-trailing-whitespace nil t))
@@ -546,7 +543,7 @@ It is really slow to download `drupal-search-url'. You should
546543
probably not use this. Have a look at using GNU GLOBAL / Gtags
547544
instead."
548545
(unless version
549-
(setq version (drupal-detect-drupal-version)))
546+
(setq version drupal-version))
550547
(with-temp-buffer
551548
(ignore-errors
552549
(url-insert-file-contents (format-spec drupal-search-url `((?v . ,version)
@@ -740,7 +737,7 @@ Used in `drupal-insert-hook' and `drupal-insert-function'."
740737
"Return major version number of version string.
741738
If major version number is 4 - return both major and minor."
742739
(unless version
743-
(setq version (drupal-detect-drupal-version)))
740+
(setq version drupal-version))
744741
(when version
745742
(let ((version-list (split-string version "\\.")))
746743
(if (= (string-to-number (car version-list)) 4)

0 commit comments

Comments
 (0)