emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: info-lookup-alist mangled, breaks C-h S


From: Eli Zaretskii
Subject: Re: info-lookup-alist mangled, breaks C-h S
Date: Tue, 04 Jan 2022 16:54:44 +0200

> From: Tassilo Horn <tsdh@gnu.org>
> Date: Mon, 03 Jan 2022 21:02:05 +0100
> Cc: emacs-devel@gnu.org, Daniel Martín <mardani29@yahoo.es>
> 
> "T.V Raman" <raman@google.com> writes:
> 
> > tried that already -- leads down various twisty ratholes since too many
> > things in emacs core itself touch that variable, and some of that code
> > was beyond my abilities, eg see the code in tramp-integration.el
> >
> > -- that one appears to be an earlier offendor with respect to adding an
> > invalid entry.
> 
> FWIW, the problematic entry doesn't seem to come from some external
> package, at least I can reproduce the error using
> 
>   1. emacs -Q
>   2. M-x fundamental-mode RET in *stratch*
>   3. C-h S
> 
> with GNU Emacs 29.0.50 of 2022-01-03.  The step 2 above is needed
> because `C-h S' in an emacs-lisp-mode or lisp-interaction-mode buffer
> works just fine whereas I get the error in fundamental-mode or
> Info-mode.  I can't reproduce with emacs 27 or 28.

Does the patch below give good results?

diff --git a/lisp/info-look.el b/lisp/info-look.el
index e6f267d..9224aa3 100644
--- a/lisp/info-look.el
+++ b/lisp/info-look.el
@@ -347,7 +347,10 @@ info-lookup-select-mode
 
 (defun info-lookup-change-mode (topic)
   (let* ((completions (mapcar (lambda (arg)
-                               (cons (symbol-name (car arg)) (car arg)))
+                                (let ((mode-spec (car arg)))
+                                  (and (consp mode-spec)
+                                       (setq mode-spec (car mode-spec)))
+                                 (cons (symbol-name mode-spec) mode-spec)))
                              (info-lookup->topic-value topic)))
         (mode (completing-read
                (format "Use %s help mode: " topic)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]