Issues with emacs cmake-mode
There is currently an issue with the Emacs mode cmake-mode
. When interactively calling commands like cmake-help-list-commands
, I keep getting these kind of error messages:
shell-quote-argument: Wrong type argument: arrayp, nil
Here is a full debugger output:
Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
replace-regexp-in-string("[^-0-9a-zA-Z_./\n]" "\\\\\\&" nil)
shell-quote-argument(nil)
(concat cmake-mode-cmake-executable " " type " " (shell-quote-argument topic))
(let* ((bufname (if buffer buffer (concat "*CMake" type (if topic "-") topic "*"))) (buffer (if (get-buffer bufname) (get-buffer bufname) (generate-new-buffer bufname))) (command (concat cmake-mode-cmake-executable " " type " " (shell-quote-argument topic))) (resize-mini-windows nil)) (shell-command command buffer) (let ((save-selected-window--state (internal--before-save-selected-window))) (save-current-buffer (unwind-protect (progn (select-window (display-buffer buffer 'not-this-window)) (rst-mode) (read-only-mode 1) (view-mode 1)) (internal--after-save-selected-window save-selected-window--state)))))
cmake-command-run-help2("--help")
(progn (cmake-command-run-help2 "--help"))
elisp--eval-last-sexp(nil)
eval-last-sexp(nil)
funcall-interactively(eval-last-sexp nil)
command-execute(eval-last-sexp)
I believe this was introduced with commit 915ef090c9c62d9e67652af3d75c46dd75abc5d0
. The issue is basically that calling shell-quote-argument
with a nil
argument is not handled properly by that function.
I propose the following changes to fix that behavior. Replace this:
(command (concat cmake-mode-cmake-executable " " type " " (shell-quote-argument topic)))
with this:
(command (concat cmake-mode-cmake-executable " " type " " (if topic (shell-quote-argument topic) topic)))
Let me know if you'd like me to create a merge request with those changes.
Edited by Nguyen Damien