unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: bug-gnu-emacs@gnu.org (Emacs bug Tracking System)
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-bug-tracker@debbugs.gnu.org
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	[thread overview]
Message-ID: <handler.5273.D5273.126310890529189.ackdone@debbugs.gnu.org> (raw)
In-Reply-To: 20091006184604.9A5B2EFE6F@sonic02.math.uni-bielefeld.de

[-- Attachment #1: Type: text/plain, Size: 900 bytes --]

Your message dated Sun, 10 Jan 2010 01:31:00 -0500
with message-id <jwv3a2eiia3.fsf-monnier+emacs@gnu.org>
and subject line Re: bug#5273: 23.1; format-alist encode vs write-region-post-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.)


-- 
5273: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=5273
Emacs Bug Tracking System
Contact bug-gnu-emacs@gnu.org with problems

[-- Attachment #2: Type: message/rfc822, Size: 8352 bytes --]

From: Kevin Ryde <user42@zip.com.au>
To: bug-gnu-emacs@gnu.org
Cc: 
Subject: bug#5273: 23.1; format-alist encode vs write-region-post-annotation-function
Date: Sun, 27 Dec 2009 11:17:04 +1100
Message-ID: <87eimhi83j.fsf@blah.blah>

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



[-- Attachment #3: Type: message/rfc822, Size: 2629 bytes --]

From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Kevin Ryde <user42@zip.com.au>
Subject: Re: bug#5273: 23.1; format-alist encode vs write-region-post-annotation-function
Date: Sun, 10 Jan 2010 01:31:00 -0500
Message-ID: <jwv3a2eiia3.fsf-monnier+emacs@gnu.org>

>>> Does the patch below help?
>> Yep.
> Thanks, installed.

I think this closes this bug,


        Stefan


  parent reply	other threads:[~2010-01-10  7:36 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <jwv3a2eiia3.fsf-monnier+emacs@gnu.org>
2009-10-06 18:46 ` bug#4655: 23.1.50; buffer-swap-text oddity Markus Rost
2009-10-07  4:01   ` Juanma Barranquero
2009-10-07  5:41     ` Stefan Monnier
2009-10-07  8:53       ` Markus Rost
2009-10-07 10:07       ` Juanma Barranquero
2009-10-07 14:29         ` Stefan Monnier
2009-10-08 16:48           ` Markus Rost
2011-07-13 14:08           ` Lars Magne Ingebrigtsen
2016-07-11  1:58             ` npostavs
2016-07-11 14:37               ` Eli Zaretskii
2016-07-11 18:50                 ` Markus Rost
2016-07-11 19:07                   ` Dmitry Gutov
2016-07-12  1:58                     ` npostavs
2016-07-12  5:16                       ` Eli Zaretskii
2016-07-13 23:50                         ` npostavs
2016-07-14 15:03                           ` Eli Zaretskii
2016-07-15  0:05                             ` npostavs
2010-01-10  7:36   ` Emacs bug Tracking System [this message]
2010-01-13  0:45   ` bug#5256: marked as done (conjunct formation should follow input sequence when inserting text) Emacs bug Tracking System
2010-01-13  0:49   ` bug#5265: marked as done (23.1.90; vc - can't reread redirected stdin for log message) Emacs bug Tracking System
2010-01-14  1:22   ` bug#5276: marked as done (23.1; Doc string of bookmark-bmenu-execute-deletions) Emacs bug Tracking System
2010-01-16 20:05   ` bug#5267: 23.1; doc string of defstruct Chong Yidong
2010-01-16 21:39   ` bug#5279: 23.1; VC: should set LC_MESSAGES to C (with patch) Chong Yidong
2010-05-13 19:20   ` bug#5284: 23.1; gnus-summary-expire-thread does not work Glenn Morris
2010-05-24 19:53   ` bug#5270: [PATCH] * lisp/image-dired.el (image-dired-dired-insert-marked-thumbs) Insert thumbnails before file names of marked files in the dired buffer Thierry Volpiatto
2010-05-25 15:49     ` Juri Linkov
2010-05-25 16:59       ` Thierry Volpiatto
2010-05-25 17:46         ` Juri Linkov
2010-06-30 20:35   ` bug#5281: 23.1; xml-parse-region causes infinite loops if the region is not well-formed XML Chong Yidong
2009-12-29 18:19 bug#5284: 23.1; gnus-summary-expire-thread does not work Tom Tromey
2010-05-11  6:04 ` Andreas Seltenreich
     [not found]   ` <mailman.7.1273778942.8369.bug-gnu-emacs@gnu.org>
2010-06-30 21:35     ` Ted Zlatanov

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=handler.5273.D5273.126310890529189.ackdone@debbugs.gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=emacs-bug-tracker@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).