branch: elpa/drupal-mode
commit 2245c415ee4655b8624592113970a28478ef8aa7
Author: Arne Jørgensen <[email protected]>
Commit: Arne Jørgensen <[email protected]>
Added check for `drupal-drush-program` is set.
Fixes #33.
---
drupal/pcomplete.el | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/drupal/pcomplete.el b/drupal/pcomplete.el
index 164b2c5476..2d1f102539 100644
--- a/drupal/pcomplete.el
+++ b/drupal/pcomplete.el
@@ -29,16 +29,17 @@
(defun drupal/pcomplete-drush-commands ()
"Return the most common drush commands by parsing the drush output."
- (with-temp-buffer
- (call-process drupal-drush-program nil t nil
- "--early=includes/complete.inc")
- (goto-char 0)
- (let (commands)
- (while (re-search-forward
- "^[[:blank:]]*\\([@]?[[:word:]-.]+\\)"
- nil t)
- (push (match-string-no-properties 1) commands))
- (sort commands #'string<))))
+ (when drupal-drush-program
+ (with-temp-buffer
+ (call-process drupal-drush-program nil t nil
+ "--early=includes/complete.inc")
+ (goto-char 0)
+ (let (commands)
+ (while (re-search-forward
+ "^[[:blank:]]*\\([@]?[[:word:]-.]+\\)"
+ nil t)
+ (push (match-string-no-properties 1) commands))
+ (sort commands #'string<)))))
(defvar drupal/pcomplete-drush-commands (drupal/pcomplete-drush-commands)
"List of `drush' commands.")