From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: bug-gnu-emacs@gnu.org (Emacs bug Tracking System) Newsgroups: gmane.emacs.bugs Subject: bug#5273: marked as done (23.1; format-alist encode vs write-region-post-annotation-function) Date: Sun, 10 Jan 2010 07:36:02 +0000 Message-ID: References: <20091006184604.9A5B2EFE6F@sonic02.math.uni-bielefeld.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----------=_1263108962-29223-0" X-Trace: ger.gmane.org 1263109778 610 80.91.229.12 (10 Jan 2010 07:49:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 10 Jan 2010 07:49:38 +0000 (UTC) Cc: emacs-bug-tracker@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jan 10 08:49:31 2010 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.50) id 1NTsYE-0001cd-Be for geb-bug-gnu-emacs@m.gmane.org; Sun, 10 Jan 2010 08:49:30 +0100 Original-Received: from localhost ([127.0.0.1]:42746 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NTsYE-00053d-Gy for geb-bug-gnu-emacs@m.gmane.org; Sun, 10 Jan 2010 02:49:30 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NTsY0-00051S-IA for bug-gnu-emacs@gnu.org; Sun, 10 Jan 2010 02:49:16 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NTsXv-0004x2-8N for bug-gnu-emacs@gnu.org; Sun, 10 Jan 2010 02:49:15 -0500 Original-Received: from [199.232.76.173] (port=34922 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NTsXn-0004uk-59; Sun, 10 Jan 2010 02:49:03 -0500 Original-Received: from mx20.gnu.org ([199.232.41.8]:47692) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NTsXm-0002Rt-87; Sun, 10 Jan 2010 02:49:02 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NTsXl-0002vm-1Y; Sun, 10 Jan 2010 02:49:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NTsLC-0007bN-AA; Sun, 10 Jan 2010 02:36:02 -0500 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: bug-gnu-emacs@gnu.org X-Emacs-PR-Message: closed 5273 X-Emacs-PR-Package: emacs X-detected-operating-system: by mx20.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list 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:34156 Archived-At: This is a multi-part message in MIME format... ------------=_1263108962-29223-0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Your message dated Sun, 10 Jan 2010 01:31:00 -0500 with message-id and subject line Re: bug#5273: 23.1; format-alist encode vs write-region-po= st-annotation-function has caused the Emacs bug report #5273, regarding 23.1; format-alist encode vs write-region-post-annotation-function to be marked as done. This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact bug-gnu-emacs@gnu.org immediately.) --=20 5273: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D5273 Emacs Bug Tracking System Contact bug-gnu-emacs@gnu.org with problems ------------=_1263108962-29223-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NOh8U-00082R-IO for mharc-bug-gnu-emacs@gnu.org; Sat, 26 Dec 2009 19:37:30 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NOh8S-000826-PI for bug-gnu-emacs@gnu.org; Sat, 26 Dec 2009 19:37:28 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NOh8O-00081e-AF for bug-gnu-emacs@gnu.org; Sat, 26 Dec 2009 19:37:28 -0500 Received: from [199.232.76.173] (port=39321 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NOh8O-00081b-1V for bug-gnu-emacs@gnu.org; Sat, 26 Dec 2009 19:37:24 -0500 Received: from debbugs.gnu.org ([140.186.70.43]:55170) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NOh8N-0002Rh-Ly for bug-gnu-emacs@gnu.org; Sat, 26 Dec 2009 19:37:23 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NOgyM-0007kF-By; Sat, 26 Dec 2009 19:27:02 -0500 X-Loop: bug-gnu-emacs@gnu.org Mail-Followup-To: Kevin Ryde , 5273@debbugs.gnu.org Resent-From: Kevin Ryde Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Dec 2009 00:27:02 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-Emacs-PR-Message: report 5273 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@debbugs.gnu.org id=B.126187358729761 (code B ref -1); Sun, 27 Dec 2009 00:27:02 +0000 Received: (at submit) by debbugs.gnu.org; 27 Dec 2009 00:26:27 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NOgxm-0007jy-VU for submit@debbugs.gnu.org; Sat, 26 Dec 2009 19:26:27 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NOgxl-0007jp-Pr for submit@debbugs.gnu.org; Sat, 26 Dec 2009 19:26:26 -0500 Received: from mx10.gnu.org ([199.232.76.166]:40213) by fencepost.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NOgxT-0005Xx-2L for submit@debbugs.gnu.org; Sat, 26 Dec 2009 19:26:08 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NOgpP-0001C6-GF for submit@debbugs.gnu.org; Sat, 26 Dec 2009 19:17:49 -0500 Received: from lists.gnu.org ([199.232.76.165]:56919) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NOgpP-0001C2-Bm for submit@debbugs.gnu.org; Sat, 26 Dec 2009 19:17:47 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NOgpP-0000G0-1r for bug-gnu-emacs@gnu.org; Sat, 26 Dec 2009 19:17:47 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NOgpK-0000CX-6u for bug-gnu-emacs@gnu.org; Sat, 26 Dec 2009 19:17:46 -0500 Received: from [199.232.76.173] (port=58901 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NOgpJ-0000CI-Ox for bug-gnu-emacs@gnu.org; Sat, 26 Dec 2009 19:17:41 -0500 Received: from mailout1-6.pacific.net.au ([61.8.2.213]:40712 helo=mailout1.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NOgpI-0001BH-Ut for bug-gnu-emacs@gnu.org; Sat, 26 Dec 2009 19:17:41 -0500 Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.2.162]) by mailout1.pacific.net.au (Postfix) with ESMTP id D61F750E19B for ; Sun, 27 Dec 2009 11:17:34 +1100 (EST) Received: from blah.blah (ppp2BAA.dyn.pacific.net.au [61.8.43.170]) by mailproxy1.pacific.net.au (Postfix) with ESMTP id F11418C13 for ; Sun, 27 Dec 2009 11:17:33 +1100 (EST) Received: from gg by blah.blah with local (Exim 4.71) (envelope-from ) id 1NOgoi-00040T-S5 for bug-gnu-emacs@gnu.org; Sun, 27 Dec 2009 11:17:05 +1100 From: Kevin Ryde To: bug-gnu-emacs@gnu.org Date: Sun, 27 Dec 2009 11:17:04 +1100 Message-ID: <87eimhi83j.fsf@blah.blah> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -3.9 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.8 (----) Resent-Date: Sat, 26 Dec 2009 19:27:02 -0500 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: Subject: bug#5273: 23.1; format-alist encode vs write-region-post-annotation-function X-BeenThere: bug-gnu-emacs@gnu.org Reply-To: Kevin Ryde , 5273@debbugs.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: , X-List-Received-Date: Sun, 27 Dec 2009 00:37:28 -0000 In a format-alist "TO-FN" encode function, the buffer provided to that function to operate on has write-region-post-annotation-function set to `kill-buffer'. This is extremely dangerous, and almost certainly incompatible with past emacs, as it means any write-region done by the encode function will kill the buffer it's operating on, causing it to then mangle some other buffer, quite possibly with no indication that this happened. A write-region in an encode function is likely if the function works by putting data through an external program. I struck this in three of my file formats where I use make-temp-file. (Two for an error files for call-process-region, one because the program needed an actual file to write to, not a pipe etc.) Because make-temp-file does its job by a writing an empty string to the new file, it ran the kill-buffer from write-region-post-annotation-function. I'm was unsure if make-temp-file ought to guard itself against this. My inclination is not. There's an awful lot of read/write hooks and stuff, and to set them so "write a string to a file" means "kill the current buffer" is so unreasonable that there's no point anticipating it in one particular place when so many things will be similarly affected. I couldn't tell what that write-region-post-annotation-function is trying to achieve. If it's to kill the temporary buffer after writing then an unwind-protect would sound far better, or at least apply the kill setting only after running the format-alist encode func. In GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.16.5) of 2009-09-14 on raven, modified by Debian configured using `configure '--build=i486-linux-gnu' '--host=i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.1/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.1/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS='' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_AU value of $XMODIFIERS: nil locale-coding-system: iso-latin-1-unix default-enable-multibyte-characters: t ------------=_1263108962-29223-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 5273-done) by debbugs.gnu.org; 10 Jan 2010 07:35:05 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NTsKG-0007ah-KQ for submit@debbugs.gnu.org; Sun, 10 Jan 2010 02:35:05 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NTrKK-00078A-PC for 5273-done@debbugs.gnu.org; Sun, 10 Jan 2010 01:31:05 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArgEAGsDSUvO+KPG/2dsb2JhbACBRNAjhC8Eiik X-IronPort-AV: E=Sophos;i="4.49,250,1262581200"; d="scan'208";a="53457134" Received: from 206-248-163-198.dsl.teksavvy.com (HELO pastel.home) ([206.248.163.198]) by ironport2-out.pppoe.ca with ESMTP; 10 Jan 2010 01:31:00 -0500 Received: by pastel.home (Postfix, from userid 20848) id 7ED7481C9; Sun, 10 Jan 2010 01:31:00 -0500 (EST) From: Stefan Monnier To: Kevin Ryde Subject: Re: bug#5273: 23.1; format-alist encode vs write-region-post-annotation-function Message-ID: References: <87eimhi83j.fsf@blah.blah> <87fx6gdzuu.fsf@blah.blah> Date: Sun, 10 Jan 2010 01:31:00 -0500 In-Reply-To: (Stefan Monnier's message of "Sun, 10 Jan 2010 00:25:14 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 5273-done X-Mailman-Approved-At: Sun, 10 Jan 2010 02:35:02 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.1 (--) >>> Does the patch below help? >> Yep. > Thanks, installed. I think this closes this bug, Stefan ------------=_1263108962-29223-0--