From: Aidan Gauland <aidalgol@no8wireless.co.nz>
To: 14207@debbugs.gnu.org
Subject: bug#14207: 24.2; insert-file-contents clobbers match data
Date: Mon, 15 Apr 2013 12:56:26 +1200 [thread overview]
Message-ID: <87fvysbohx.fsf@dimension8.tehua.net> (raw)
If (and only if) the match data is non-nil when `insert-file-contents'
is called, it clobbers the match-data.
To demonstrate:
*** Welcome to IELM *** Type (describe-mode) for help.
ELISP> (match-data)
nil
ELISP> (equal
(match-data)
(progn
(write-region "foo bar baz wiz" nil "/tmp/foo-file")
(with-temp-buffer (insert-file-contents "/tmp/foo-file"))
(match-data)))
t
ELISP> (match-data)
nil
ELISP> (search-backward "elisp" nil t)
340
ELISP> (match-data)
(#<marker at 340 in *ielm*> #<marker at 345 in *ielm*>)
ELISP> (equal
(match-data)
(progn
(write-region "foo bar baz wiz" nil "/tmp/foo-file")
(with-temp-buffer (insert-file-contents "/tmp/foo-file"))
(match-data)))
nil
ELISP> (match-data)
(0 0)
ELISP>
In GNU Emacs 24.2.1 (x86_64-pc-linux-gnu, GTK+ Version 2.20.1)
of 2013-04-03 on dimension8, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.10707000
Configured using:
`configure '--build' 'x86_64-linux-gnu' '--build' 'x86_64-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/emacs24:/etc/emacs:/usr/local/share/emacs/24.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.2/site-lisp:/usr/share/emacs/site-lisp'
'--without-gconf' '--with-crt-dir=/usr/lib/' '--with-x=yes'
'--with-x-toolkit=gtk' '--with-toolkit-scroll-bars'
'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fstack-protector
--param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall'
'LDFLAGS=-Wl,-z,relro' 'CPPFLAGS=-D_FORTIFY_SOURCE=2''
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_NZ.utf8
value of $XMODIFIERS: nil
locale-coding-system: utf-8-unix
default enable-multibyte-characters: t
Major mode: IELM
Minor modes in effect:
tooltip-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
line-number-mode: t
transient-mark-mode: t
Recent input:
M-x i e l m <return> C-y <return> C-y <return> ( m
a t c h - d a t a ) <return> C-y <return> M-p M-p <return>
M-p M-p M-p M-p <return> M-p M-p <return> M-< C-n C-p
C-SPC M-> M-w M-x r e p o r <tab> <return>
Recent messages:
History item: 1
History item: 2
History item: 1
History item: 2
History item: 3
History item: 4
Wrote /tmp/foo-file
History item: 1
History item: 2
Mark set [2 times]
Load-path shadows:
/usr/share/emacs/24.2/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup
/usr/share/emacs/24.2/site-lisp/dictionaries-common/flyspell hides /usr/share/emacs/24.2/lisp/textmodes/flyspell
/usr/share/emacs/24.2/site-lisp/dictionaries-common/ispell hides /usr/share/emacs/24.2/lisp/textmodes/ispell
Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils ielm pp comint regexp-opt ansi-color ring
time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd
tool-bar dnd fontset image fringe lisp-mode register page menu-bar
rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax
facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak
czech european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces
cus-face files text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget hashtable-print-readable backquote
make-network-process dbusbind dynamic-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty emacs)
next reply other threads:[~2013-04-15 0:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-15 0:56 Aidan Gauland [this message]
2013-04-15 5:16 ` bug#14207: 24.2; insert-file-contents clobbers match data Eli Zaretskii
2013-04-16 1:22 ` Aidan Gauland
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=87fvysbohx.fsf@dimension8.tehua.net \
--to=aidalgol@no8wireless.co.nz \
--cc=14207@debbugs.gnu.org \
/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.