[Top][All Lists]

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

Re: describe-char

From: Stefan Monnier
Subject: Re: describe-char
Date: Tue, 27 Dec 2005 11:28:22 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>>> This is not reliable way to restore the old output of `describe-char'
>>> since the original buffer might be killed or the character at the old
>>> position might be deleted,
>> The same holds for most/all other uses of help-setup-xref.

> So it makes sense to preserve the original contents of the help buffer
> in other uses too.

Maybe, yes.

I can see a point to your proposition to save the whole buffer content, tho
I'd do it generically in help-setup-xref:

--- orig/lisp/help-mode.el
+++ mod/lisp/help-mode.el
@@ -276,7 +276,8 @@
 restore it properly when going back."
   (with-current-buffer (help-buffer)
     (when help-xref-stack-item
-      (push (cons (point) help-xref-stack-item) help-xref-stack))
+      (push (list (point) (buffer-string) help-xref-stack-item)
+            help-xref-stack))
     (when interactive-p
       (let ((tail (nthcdr 10 help-xref-stack)))
        ;; Truncate the stack.

and then update all uses of help-xref-stack-item.

But I also like the current behavior which recomputed the contents, because
I use it specifically for this purpose: to update the help based on the
new state (I typically use this for describe-variable).

But maybe the two should be separated: provide a refresh command (which
could be used in revert-buffer-function as well) which uses the
help-xref-stack-item info, while the help-xref-go-back would reproduce the
original buffer contents.


reply via email to

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