From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs Subject: bug#8147: 24.0.50; Inserting *Help* buffer can lead to data loss Date: Sun, 06 Mar 2011 17:38:54 +0100 Message-ID: <87k4gcxkyp.fsf@escher.fritz.box> References: <8762s2akxq.fsf@escher.fritz.box> <87oc5pff43.fsf@stupidchicken.com> <878vwtt7t0.fsf@escher.fritz.box> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1299432325 780 80.91.229.12 (6 Mar 2011 17:25:25 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 6 Mar 2011 17:25:25 +0000 (UTC) Cc: 8147@debbugs.gnu.org To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Mar 06 18:25:19 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PwHhn-0004TC-G0 for geb-bug-gnu-emacs@m.gmane.org; Sun, 06 Mar 2011 18:25:19 +0100 Original-Received: from localhost ([127.0.0.1]:42939 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwHhm-0005q9-OF for geb-bug-gnu-emacs@m.gmane.org; Sun, 06 Mar 2011 12:25:18 -0500 Original-Received: from [140.186.70.92] (port=57950 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwHT3-0008Ma-Ic for bug-gnu-emacs@gnu.org; Sun, 06 Mar 2011 12:10:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwHPv-0004eG-Nh for bug-gnu-emacs@gnu.org; Sun, 06 Mar 2011 12:06:52 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40877) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwHPv-0004e0-Jy for bug-gnu-emacs@gnu.org; Sun, 06 Mar 2011 12:06:51 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PwGzz-0005Ua-LC; Sun, 06 Mar 2011 11:40:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 06 Mar 2011 16:40:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8147 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8147-submit@debbugs.gnu.org id=B8147.129942954621040 (code B ref 8147); Sun, 06 Mar 2011 16:40:03 +0000 Original-Received: (at 8147) by debbugs.gnu.org; 6 Mar 2011 16:39:06 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PwGz3-0005TI-R8 for submit@debbugs.gnu.org; Sun, 06 Mar 2011 11:39:06 -0500 Original-Received: from mailout-de.gmx.net ([213.165.64.23]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1PwGz0-0005Sn-I8 for 8147@debbugs.gnu.org; Sun, 06 Mar 2011 11:39:04 -0500 Original-Received: (qmail invoked by alias); 06 Mar 2011 16:38:56 -0000 Original-Received: from i59F5B595.versanet.de (EHLO escher.home) [89.245.181.149] by mail.gmx.net (mp071) with SMTP; 06 Mar 2011 17:38:56 +0100 X-Authenticated: #20778731 X-Provags-ID: V01U2FsdGVkX1+Lj2oE/zCLi8ndoM8XfGskhofMN9xhYhKbSAl4Ia D0EHBbNZlRc+rQ Original-Received: by escher.home (Postfix, from userid 1000) id 42BB4638FA; Sun, 6 Mar 2011 17:38:54 +0100 (CET) In-Reply-To: <878vwtt7t0.fsf@escher.fritz.box> (Stephen Berman's message of "Sun, 06 Mar 2011 01:24:27 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-Y-GMX-Trusted: 0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sun, 06 Mar 2011 11:40:03 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:44703 Archived-At: On Sun, 06 Mar 2011 01:24:27 +0100 Stephen Berman wrote: > On Sat, 05 Mar 2011 16:10:20 -0500 Chong Yidong wrote: > >> Stefan Monnier 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