From: Eli Zaretskii Date: Wed, 31 May 2023 14:50:53 +0000 (+0300) Subject: Fix infloop in info-look.el X-Git-Tag: emacs-29.0.92~69 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0a354d65784e5cd25da408c4b102fb1c15fa7a73;p=emacs.git Fix infloop in info-look.el * lisp/info-look.el (info-lookup-guess-gdb-script-symbol): Fix infloop when there are no completions. (Bug#63808) --- diff --git a/lisp/info-look.el b/lisp/info-look.el index 7858ed58774..da45e30cd36 100644 --- a/lisp/info-look.el +++ b/lisp/info-look.el @@ -733,7 +733,11 @@ Return nil if there is nothing appropriate in the buffer near point." (let ((str (string-join str-list " "))) (when (assoc str completions) (throw 'result str)) - (nbutlast str-list))))))) + ;; 'nbutlast' will not destructively set its argument + ;; to nil when the argument is a list of 1 element. + (if (= (length str-list) 1) + (setq str-list nil) + (nbutlast str-list)))))))) (error nil))) ;;;###autoload