From bf7bc1a0c5ee7d9a86d1f7411d626144db61e19a Mon Sep 17 00:00:00 2001 From: oscar Date: Tue, 18 May 2010 03:56:45 +0200 Subject: [PATCH] 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. --- magit.el | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/magit.el b/magit.el index c5504870..adbbeec6 100644 --- a/magit.el +++ b/magit.el @@ -1513,19 +1513,18 @@ FUNC should leave point at the end of the modified region" (call-interactively chosen-fn)))))) (defun magit-menu-make-option-list (menu-items) - (let ((result '()) - (option)) + (let ((result '())) (dolist (item menu-items) - (when (and (stringp (nth 3 item)) (nth 5 item)) - (setq option - (concat (nth 3 item) - (if (stringp (nth 5 item)) - (if (string= "=" - (substring (nth 3 item) - (- (length (nth 3 item)) 1))) - (shell-quote-argument (nth 5 item)) - (concat " " (shell-quote-argument (nth 5 item))))))) - (setq result (append result (list option))))) + (let ((option (nth 3 item)) + (value (nth 5 item))) + (when (and (stringp option) value) + (when (and (stringp value) + (string= "=" (substring option (- (length option) 1)))) + (setq option (concat option value)) + (setq value nil)) + (setq result (append result (list (shell-quote-argument option)))) + (when (stringp value) + (setq result (append result (list (shell-quote-argument value)))))))) result)) ;;; Mode