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: Tue, 01 Mar 2011 17:02:09 +0100 Message-ID: <8762s2akxq.fsf@escher.fritz.box> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: dough.gmane.org 1298995621 23532 80.91.229.12 (1 Mar 2011 16:07:01 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 1 Mar 2011 16:07:01 +0000 (UTC) To: 8147@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Mar 01 17:06:56 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 1PuS6B-00041w-FO for geb-bug-gnu-emacs@m.gmane.org; Tue, 01 Mar 2011 17:06:55 +0100 Original-Received: from localhost ([127.0.0.1]:59870 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PuS6A-0006OM-Ng for geb-bug-gnu-emacs@m.gmane.org; Tue, 01 Mar 2011 11:06:54 -0500 Original-Received: from [140.186.70.92] (port=47306 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PuS64-0006Nx-Ov for bug-gnu-emacs@gnu.org; Tue, 01 Mar 2011 11:06:49 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PuS63-0005ce-Hb for bug-gnu-emacs@gnu.org; Tue, 01 Mar 2011 11:06:48 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33383) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PuS63-0005cS-Fq for bug-gnu-emacs@gnu.org; Tue, 01 Mar 2011 11:06:47 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PuS2Q-0003wu-PT; Tue, 01 Mar 2011 11:03:02 -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: Tue, 01 Mar 2011 16:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 8147 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.129899534815134 (code B ref -1); Tue, 01 Mar 2011 16:03:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 1 Mar 2011 16:02:28 +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 1PuS1s-0003w2-Fz for submit@debbugs.gnu.org; Tue, 01 Mar 2011 11:02:28 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PuS1p-0003vp-Lu for submit@debbugs.gnu.org; Tue, 01 Mar 2011 11:02:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PuS1h-0004iz-Ro for submit@debbugs.gnu.org; Tue, 01 Mar 2011 11:02:20 -0500 Original-Received: from lists.gnu.org ([199.232.76.165]:37637) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PuS1h-0004ir-PL for submit@debbugs.gnu.org; Tue, 01 Mar 2011 11:02:17 -0500 Original-Received: from [140.186.70.92] (port=35111 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PuS1g-0001nO-I8 for bug-gnu-emacs@gnu.org; Tue, 01 Mar 2011 11:02:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PuS1f-0004hY-FR for bug-gnu-emacs@gnu.org; Tue, 01 Mar 2011 11:02:16 -0500 Original-Received: from mailout-de.gmx.net ([213.165.64.23]:37908) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1PuS1f-0004gn-4N for bug-gnu-emacs@gnu.org; Tue, 01 Mar 2011 11:02:15 -0500 Original-Received: (qmail invoked by alias); 01 Mar 2011 16:02:11 -0000 Original-Received: from i59F576BB.versanet.de (EHLO escher.home) [89.245.118.187] by mail.gmx.net (mp023) with SMTP; 01 Mar 2011 17:02:11 +0100 X-Authenticated: #20778731 X-Provags-ID: V01U2FsdGVkX18d/9xTfrAd+y4+0lTTrW8sJi9NiWpbNr2EdbhC4g LOp1dAiNeGPpNp Original-Received: by escher.home (Postfix, from userid 1000) id 2EA5A638E6; Tue, 1 Mar 2011 17:02:09 +0100 (CET) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Tue, 01 Mar 2011 11:03:02 -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:44475 Archived-At: --=-=-= Content-Type: text/plain In GNU Emacs 24.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.20.1) of 2011-02-23 on escher Windowing system distributor `The X.Org Foundation', version 11.0.10800000 configured using `configure '--without-toolkit-scroll-bars' 'CFLAGS=-g -O2 -fno-optimize-sibling-calls'' 1. emacs -Q 2. Start editing some buffer. 3. Bring up a doc string in a *Help* buffer with content that contains buttons to other doc strings, e.g. `C-h f completing-read'. 4. Return to the buffer in step 2 and type `M-x insert-buffer RET *Help*'. Note that the buttons in the inserted text are active. 5. Click on one of the buttons in the inserted text that links to another doc string, e.g. `try-completion'. => The previous content of the buffer you were editing is replaced by the doc string of the just clicked button (e.g. that of `try-completion'). This buffer is read-only, but if you make it writable and type `C-x _' to restore the previous content, you get the message "No undo information in this buffer". So whatever unsaved data was in the buffer prior to clicking the button is unrecoverable. 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 in the following patch, which prevents insert-buffer from inserting active help buttons. This extends to insert-buffer the default behavior of yanking the content of *Help*, since the help button text properties are in yank-excluded-properties by default. --=-=-= Content-Type: text/x-emacs-lisp Content-Disposition: inline Content-Description: insert-buffer patch *** /data/steve/bzr/emacs/trunk/lisp/simple.el 2011-02-23 15:11:01.000000000 +0100 --- /data/steve/bzr/emacs/quickfixes/lisp/simple.el 2011-03-01 15:04:22.000000000 +0100 *************** *** 3626,3631 **** --- 3626,3632 ---- (save-excursion (insert-buffer-substring (get-buffer buffer)) (point))) + (remove-yank-excluded-properties (point) (mark)) nil) (defun append-to-buffer (buffer start end) --=-=-= Content-Type: text/plain Steve Berman --=-=-=--