From: Chris Mann Date: Wed, 4 Mar 2009 09:41:28 +0000 (+1030) Subject: * wesnoth-mode.el (wesnoth-element-completion): Fix leaky macro. Fix a bug X-Git-Url: https://repo.or.cz/w/wesnoth-mode.git/commitdiff_plain/022f8e1fb0cc82d42875165a43ff4350342fbe01 * wesnoth-mode.el (wesnoth-element-completion): Fix leaky macro. Fix a bug where when only a single element is available for insertion, nil is returned. --- diff --git a/wesnoth-mode.el b/wesnoth-mode.el index 5e4468e..cfd0627 100644 --- a/wesnoth-mode.el +++ b/wesnoth-mode.el @@ -477,7 +477,7 @@ If COMPLETEP is non-nil, do not prompt if no completion is found." `(let* ((element (when ,partial (try-completion ,partial ,completions)))) (cond ((eq element t) ,partial) - ((and completep (null element)) + ((and ,completep (null element)) nil) ((and element (eq (try-completion element ,completions) t)) element) @@ -485,6 +485,8 @@ If COMPLETEP is non-nil, do not prompt if no completion is found." (completing-read ,prompt ,completions nil nil element 'wesnoth-history-list)) + ((= (length ,completions) 1) + (car ,completions)) (t element))))