>>> 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.
Stefan
_______________________________________________
emacs-pretest-bug mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug