Skip to content

Commit 2245c41

Browse files
committed
Added check for drupal-drush-program is set.
Fixes #33.
1 parent ae4dd40 commit 2245c41

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

drupal/pcomplete.el

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,17 @@
2929

3030
(defun drupal/pcomplete-drush-commands ()
3131
"Return the most common drush commands by parsing the drush output."
32-
(with-temp-buffer
33-
(call-process drupal-drush-program nil t nil
34-
"--early=includes/complete.inc")
35-
(goto-char 0)
36-
(let (commands)
37-
(while (re-search-forward
38-
"^[[:blank:]]*\\([@]?[[:word:]-.]+\\)"
39-
nil t)
40-
(push (match-string-no-properties 1) commands))
41-
(sort commands #'string<))))
32+
(when drupal-drush-program
33+
(with-temp-buffer
34+
(call-process drupal-drush-program nil t nil
35+
"--early=includes/complete.inc")
36+
(goto-char 0)
37+
(let (commands)
38+
(while (re-search-forward
39+
"^[[:blank:]]*\\([@]?[[:word:]-.]+\\)"
40+
nil t)
41+
(push (match-string-no-properties 1) commands))
42+
(sort commands #'string<)))))
4243

4344
(defvar drupal/pcomplete-drush-commands (drupal/pcomplete-drush-commands)
4445
"List of `drush' commands.")

0 commit comments

Comments
 (0)