emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: No "back" button in *Help* with `C-x n n'


From: Stephen Berman
Subject: Re: No "back" button in *Help* with `C-x n n'
Date: Tue, 01 Mar 2005 01:04:21 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

On Mon, 28 Feb 2005 06:25:25 -0500 Richard Stallman <address@hidden> wrote:

> How about this patch?
>
> *** novice.el 14 Feb 2005 04:51:15 -0500      1.37
> --- novice.el 27 Feb 2005 17:11:52 -0500      
> ***************
> *** 49,55 ****
>   (defun disabled-command-function (&rest ignore)
>     (let (char)
>       (save-window-excursion
> !      (with-output-to-temp-buffer "*Help*"
>          (let ((keys (this-command-keys)))
>        (if (or (eq (aref keys 0)
>                    (if (stringp keys)
> --- 49,55 ----
>   (defun disabled-command-function (&rest ignore)
>     (let (char)
>       (save-window-excursion
> !      (with-output-to-temp-buffer "*Disabled Command*"
>          (let ((keys (this-command-keys)))
>        (if (or (eq (aref keys 0)
>                    (if (stringp keys)

This fixes the bug I reported but it introduces two other problems.
First, now typing `C-x n n' with narrow-to-region disabled and no
*Help* buffer in the buffer list produces the following error:

Debugger entered--Lisp error: (error "No buffer named *Help*")
  byte-code("ÆÇ ‰ÈH;ƒÉÈH‚Ê=„/GËYƒ;ÈH 
=ƒ;ÌHÍ=ƒ;ÎÏÐÑ\n!\"!ˆ‚GÎÏÒÓ!Ñ\n!#!ˆ)\nÔN;ƒXÎ\nÔN!ˆ‚ÎÕ!ˆÎÖ!ˆr×qˆdbˆ`ŠÎØÙڏ†sÛ!ˆ)ÜÝØÞ#ƒƒÈ”d|ˆdbˆß`à#ˆ*Îá!ˆÎâ!ˆŠ\fqˆã
 )‘ˆäå!ˆÞæ —‰*ç>„¹è ˆäé!ˆ‚€)؇" [keys meta-prefix-char this-command start 
standard-output cursor-in-echo-area "*Disabled Command*" this-command-keys 0 
"ø" 134217848 2 1 120 princ format "You have invoked the disabled command 
%s.\n" symbol-name "You have typed %s, invoking disabled command %s.\n" 
key-description disabled "It is disabled because new users often find it 
confusing.\n" "Here's the first part of its description:\n\n" "*Help*" nil 
(documentation this-command) ((error)) "<< not documented >>" search-forward 
"\n\n" t indent-rigidly 3 "\n\nDo you want to use this command anyway?\n\n" 
"You can now type\ny   to try it and enable it (no questions if you use it 
again).\nn   to cancel--don't try the command, and it remains disabled.\nSPC to 
try the command just this once, but leave it disabled.\n!   to try it, and 
enable all disabled commands for this session only." help-mode message "Type y, 
n, ! or SPC (the space bar): " read-char (33 121 110 32) ding "Please type y, 
n, ! or SPC (the space bar): " char] 8)
  disabled-command-function()
  run-hooks(disabled-command-function)

This would be avoided by reusing your patch a few lines further down:

*** 69,75 ****
         (princ "It is disabled because new users often find it confusing.\n")
         (princ "Here's the first part of its description:\n\n")
         ;; Keep only the first paragraph of the documentation.
!        (with-current-buffer "*Help*"
           (goto-char (point-max))
           (let ((start (point)))
             (save-excursion
--- 69,75 ----
         (princ "It is disabled because new users often find it confusing.\n")
         (princ "Here's the first part of its description:\n\n")
         ;; Keep only the first paragraph of the documentation.
!        (with-current-buffer "*Disabled Command*"
           (goto-char (point-max))
           (let ((start (point)))
             (save-excursion

However, the second problem seems more serious: in the *Disabled
Command* buffer clicking on `save-restriction' pops up its help text
-- but it too is in the *Disabled Command* buffer, which is now
certainly misleadingly labelled (moreover, you can now also
simultaneously have the same text in the *Help* buffer via `C-h f').
There is still no "back" button (help-xref-stack is nil).  Clicking on
any of the underlined function names in this buffer pops up its help
text, still in the *Disabled Command* buffer, and now there is a
"back" button, which brings you back to the previous state of the
*Disabled Command* buffer.  In short, you have a stack of *Disabled
Command* buffers which can exist in parallel to the *Help* buffer
stack and, except for the initial disabled command, may contain the
same command names.

Aside from these issues with your patch, I have a clarification to my
bug report.  I thought I had observed the lack of a "back" button in
the *Help* buffer on typing `C-x n n' with an existing *Help* buffer
with a "back" button, but now I cannot reproduce this.  The exact
behavior I now see with Emacs -Q is this: 

(i) If there no *Help* buffer, typing `C-x n n' pops up a *Help*
buffer without a "back" button.

(ii) If there is a *Help* buffer without a "back" button
(help-xref-stack is nil), typing `C-x n n' replaces the text of that
buffer with the disabled command help text but doesn't add a "back"
button, so you can't go back to the initial state of the *Help* buffer
(in which help-xref-stack is nil).

(iii) If there is a *Help* buffer with a "back" button
(help-xref-stack is not nil), typing `C-x n n' replaces the text of
that buffer and now does add a "back" button.  However, the command
whose help text was in the previous state of the *Help* buffer is not
pushed onto help-xref-stack, so that clicking on the "back" button
brings you back to the second to last help text before typing `C-x n
n'.

Steve Berman





reply via email to

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