From 022f8e1fb0cc82d42875165a43ff4350342fbe01 Mon Sep 17 00:00:00 2001 From: Chris Mann Date: Wed, 4 Mar 2009 20:11:28 +1030 Subject: [PATCH] * 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. --- wesnoth-mode.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)))) -- 2.11.4.GIT