all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stephen Berman <stephen.berman@gmx.net>
To: Chong Yidong <cyd@stupidchicken.com>
Cc: 8147@debbugs.gnu.org
Subject: bug#8147: 24.0.50; Inserting *Help* buffer can lead to data loss
Date: Sun, 06 Mar 2011 17:38:54 +0100	[thread overview]
Message-ID: <87k4gcxkyp.fsf@escher.fritz.box> (raw)
In-Reply-To: <878vwtt7t0.fsf@escher.fritz.box> (Stephen Berman's message of "Sun, 06 Mar 2011 01:24:27 +0100")

On Sun, 06 Mar 2011 01:24:27 +0100 Stephen Berman <stephen.berman@gmx.net> wrote:

> On Sat, 05 Mar 2011 16:10:20 -0500 Chong Yidong <cyd@stupidchicken.com> wrote:
>
>> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>
>>>> I reported this problem to emacs-devel in May 2008 (see
>>>> http://thread.gmane.org/gmane.emacs.devel/97367/) and there were a few
>>>> ideas about how to deal with it, but none were pursued.  I just got bit
>>>> by it again -- more fool me, perhaps, but it gives me the opportunity to
>>>> put it in the bug tracker.  And I offer a fix to the immediate problem
>>>
>>> Maybe another approach is for those buttons to check that the current
>>> buffer is (derived-mode-p 'help-mode) before reusing it.
>>
>> I've committed just such a change.
>
> I just tested this with the doc string of help-buffer in *Help*.  There
> are two links in this doc string: clicking on `help-xref-following'
> shows the error message "Current buffer is not in Help mode", which is
> certainly better than overwriting the content of the buffer; but
> clicking on `help-mode.el' finds that file and puts point on the
> beginning of help-buffer's definition, i.e., still does what this kind
> of link has always done.  It is confusing to have this divergence in
> behavior between the two kinds of links.  Instead of signalling an
> error, couldn't the help-xref-following buttons just show the help in
> the *Help* buffer, as in the following patch?

Sorry, that should have been a patch against the version with your
patch:

*** /data/steve/bzr/emacs/trunk/lisp/help-mode.el	2011-03-06 17:31:58.000000000 +0100
--- /data/steve/bzr/emacs/quickfixes/lisp/help-mode.el	2011-03-06 01:13:36.000000000 +0100
***************
*** 408,424 ****
  ;;;###autoload
  (defun help-buffer ()
    "Return the name of a buffer for inserting help.
! If `help-xref-following' is non-nil, this is the name of the
! current buffer.  Signal an error if this buffer is not derived
! from `help-mode'.
  Otherwise, return \"*Help*\", creating a buffer with that name if
  it does not already exist."
    (buffer-name				;for with-output-to-temp-buffer
!    (if (not help-xref-following)
!        (get-buffer-create "*Help*")
!      (unless (derived-mode-p 'help-mode)
!        (error "Current buffer is not in Help mode"))
!      (current-buffer))))
  
  (defvar help-xref-override-view-map
    (let ((map (make-sparse-keymap)))
--- 408,422 ----
  ;;;###autoload
  (defun help-buffer ()
    "Return the name of a buffer for inserting help.
! If `help-xref-following' is non-nil and the current buffer is
! derived from `help-mode', this is the name of the current buffer.
  Otherwise, return \"*Help*\", creating a buffer with that name if
  it does not already exist."
    (buffer-name				;for with-output-to-temp-buffer
!    (if (and help-xref-following
! 	    (derived-mode-p 'help-mode))
!        (current-buffer)
!      (get-buffer-create "*Help*"))))
  
  (defvar help-xref-override-view-map
    (let ((map (make-sparse-keymap)))


Steve Berman





  reply	other threads:[~2011-03-06 16:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-01 16:02 bug#8147: 24.0.50; Inserting *Help* buffer can lead to data loss Stephen Berman
2011-03-02 17:07 ` Stefan Monnier
2011-03-05 21:10   ` Chong Yidong
2011-03-06  0:24     ` Stephen Berman
2011-03-06 16:38       ` Stephen Berman [this message]
2011-03-06 20:28         ` Chong Yidong
2011-03-06 23:41           ` Stephen Berman
2011-03-06 23:58             ` Stephen Berman
2011-03-07 16:20           ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k4gcxkyp.fsf@escher.fritz.box \
    --to=stephen.berman@gmx.net \
    --cc=8147@debbugs.gnu.org \
    --cc=cyd@stupidchicken.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.