arnested / drupal-mode

Advanced Emacs minor mode for Drupal development
https://melpa.org/#/drupal-mode
GNU General Public License v3.0
32 stars 14 forks source link

Latest version fails. #33

Closed xendk closed 11 years ago

xendk commented 11 years ago

The ae4dd40f05514b1a8a4206339704db69fd6097f2 commit fails when installing via MELPA.

Starting Emacs afterwards results in a

Warning (initialization): An error occurred while loading `/home/xen/.emacs.d/init.el':

Wrong type argument: stringp, nil

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the `--debug-init' option to view a complete error backtrace.

After enabling the debugger, I get this when installing the package:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  call-process(nil nil t nil "--early=includes/complete.inc")
  (progn (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) (setq commands (cons (match-string-no-properties 1) commands))) (sort commands (function string<))))
  (unwind-protect (progn (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) (setq commands (cons (match-string-no-properties 1) commands))) (sort commands (function string<)))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
  (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (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) (setq commands (cons (match-string-no-properties 1) commands))) (sort commands (function string<)))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
  (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (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) (setq commands (cons ... commands))) (sort commands (function string<)))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))
  drupal/pcomplete-drush-commands()
  (defvar drupal/pcomplete-drush-commands (drupal/pcomplete-drush-commands) "List of `drush' commands.")
  eval-buffer(#<buffer  *load*-506106> nil "/home/xen/.emacs.d/elpa/drupal-mode-20130602.2146/drupal/pcomplete.el" nil t)  ; Reading at buffer position 1485
  load-with-code-conversion("/home/xen/.emacs.d/elpa/drupal-mode-20130602.2146/drupal/pcomplete.el" "/home/xen/.emacs.d/elpa/drupal-mode-20130602.2146/drupal/pcomplete.el" nil t)
  require(drupal/pcomplete)
  (lambda nil (require (quote drupal/pcomplete)))()
  funcall((lambda nil (require (quote drupal/pcomplete))))
  eval((funcall (quote (lambda nil (require (quote drupal/pcomplete))))))
  eval-after-load(pcomplete (require (quote drupal/pcomplete)))
  eval-buffer(#<buffer  *load*> nil "/home/xen/.emacs.d/elpa/drupal-mode-20130602.2146/drupal-mode-autoloads.el" nil t)  ; Reading at buffer position 2215
  load-with-code-conversion("/home/xen/.emacs.d/elpa/drupal-mode-20130602.2146/drupal-mode-autoloads.el" "/home/xen/.emacs.d/elpa/drupal-mode-20130602.2146/drupal-mode-autoloads.el" nil t)
  load("/home/xen/.emacs.d/elpa/drupal-mode-20130602.2146/drupal-mode-autoloads" nil t)
  package--make-autoloads-and-compile("drupal-mode" "/home/xen/.emacs.d/elpa/drupal-mode-20130602.2146")
  package-unpack(drupal-mode "20130602.2146")
  package-download-tar(drupal-mode "20130602.2146")
  package-download-transaction((drupal-mode))
  package-install(drupal-mode)
  mapc(package-install (drupal-mode))
  package-menu-execute()
  call-interactively(package-menu-execute nil nil)

Reverting to 6dd8edc4028f3df29a2dda6385fbc847a324d3f1 and things work again.

xendk commented 11 years ago

I've figured out that it was because drupal-drush-program was nil because executable-find couldn't find it.

drupal/pcomplete-drush-commands should check that drupal-drush-program is not nil before trying to run it to avoid compilation errors.

I'm guessing that the "Wrong type argument: stringp, nil" crops up because defcustom drupal-drush-version tries to call drush to get the version, but you'd think that ignore-errors would catch that? Or else there's another uncritical use of drupal-drush-program somewhere that's triggered on startup.