magit-menu-make-option-list rewritten

The previous implementation generated a single list element for
arguments of the type --arg value. That should be separate list
elements, otherwise the process sees it as a single argument with an
embedded space.
This commit is contained in:
oscar 2010-05-18 03:56:45 +02:00
parent b2c0fcb7b8
commit bf7bc1a0c5

View file

@ -1513,19 +1513,18 @@ FUNC should leave point at the end of the modified region"
(call-interactively chosen-fn)))))) (call-interactively chosen-fn))))))
(defun magit-menu-make-option-list (menu-items) (defun magit-menu-make-option-list (menu-items)
(let ((result '()) (let ((result '()))
(option))
(dolist (item menu-items) (dolist (item menu-items)
(when (and (stringp (nth 3 item)) (nth 5 item)) (let ((option (nth 3 item))
(setq option (value (nth 5 item)))
(concat (nth 3 item) (when (and (stringp option) value)
(if (stringp (nth 5 item)) (when (and (stringp value)
(if (string= "=" (string= "=" (substring option (- (length option) 1))))
(substring (nth 3 item) (setq option (concat option value))
(- (length (nth 3 item)) 1))) (setq value nil))
(shell-quote-argument (nth 5 item)) (setq result (append result (list (shell-quote-argument option))))
(concat " " (shell-quote-argument (nth 5 item))))))) (when (stringp value)
(setq result (append result (list option))))) (setq result (append result (list (shell-quote-argument value))))))))
result)) result))
;;; Mode ;;; Mode