From: Nick Roberts <nickrob@snap.net.nz>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-pretest-bug@gnu.org, 451@emacsbugs.donarmstrong.com
Subject: bug#451: 23.0.60; x-gtk-map-stock destroys match data
Date: Sat, 21 Jun 2008 11:01:17 +1200 [thread overview]
Message-ID: <18524.14013.836890.285017@kahikatea.snap.net.nz> (raw)
In-Reply-To: <jwvr6as9o95.fsf-monnier+emacsbugreports@gnu.org>
> > In the event loop (?), update_frame_tool_bar calls x-gtk-map-stock (in
> > x-win.el) which uses string-match. This changes the match data that
> > I need for my application. I don't know what the rules are about
> > using string-match from C code but as a minimum x-gtk-map-stock should
> > wrap save-match-data around the call to it.
>
> The match-data is a very volatile piece of data. So while you may be
> right, I think it's more likely that the problem is in your code
> (i.e., your code should save the match-data itself if it needs to use
> it after some non-trivial code has been run, and by "trivial" I *really*
> mean trivial).
I don't think that's right. The problem goes away if I remove the tool bar.
If I do:
(string-match "ox" "The quick lazy fox jumped")
in the *scratch* buffer then
(match-beginning 0)
(match-end 0)
give me false values immediately afterwards.
Presumably update_frame_tool_bar gets called in between the evaluations. I'm
not sure exactly why it's called but I have:
(add-hook 'gdb-mode-hook
'(lambda ()
(tool-bar-mode 1)
(if (eq window-system 'x)
(define-key-after gud-tool-bar-map [function-step]
'(menu-item "Step outer" gud-function-step
:image (image :type xpm
:file "/home/nickrob/emacs/etc/images/jump-to.xpm")
:enable (not gud-running)
:visible (memq gud-minor-mode '(gdbmi gdba)))))))
in my .emacs
--
Nick http://www.inet.net.nz/~nickrob
next prev parent reply other threads:[~2008-06-20 23:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <jwvmyle1sk2.fsf-monnier+emacsbugreports@gnu.org>
2008-06-20 2:38 ` bug#451: 23.0.60; x-gtk-map-stock destroys match data Nick Roberts
2008-06-20 14:28 ` Stefan Monnier
2008-06-20 23:01 ` Nick Roberts [this message]
2008-06-21 2:27 ` Stefan Monnier
2008-06-21 5:07 ` Nick Roberts
2008-06-21 19:55 ` bug#451: marked as done (23.0.60; x-gtk-map-stock destroys match data) Emacs bug Tracking System
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=18524.14013.836890.285017@kahikatea.snap.net.nz \
--to=nickrob@snap.net.nz \
--cc=451@emacsbugs.donarmstrong.com \
--cc=emacs-pretest-bug@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).