From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nick Roberts Newsgroups: gmane.emacs.bugs,gmane.emacs.pretest.bugs Subject: bug#451: 23.0.60; x-gtk-map-stock destroys match data Date: Sat, 21 Jun 2008 11:01:17 +1200 Message-ID: <18524.14013.836890.285017@kahikatea.snap.net.nz> References: <20080620023825.6AED48FC6D@kahikatea.snap.net.nz> Reply-To: Nick Roberts , 451@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1214004500 11143 80.91.229.12 (20 Jun 2008 23:28:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 Jun 2008 23:28:20 +0000 (UTC) Cc: emacs-pretest-bug@gnu.org, 451@emacsbugs.donarmstrong.com To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 21 01:29:03 2008 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 1K9q2Q-00030b-CN for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Jun 2008 01:29:02 +0200 Original-Received: from localhost ([127.0.0.1]:55442 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K9q1b-0008S1-Hu for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Jun 2008 19:28:11 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K9q0j-00080z-L9 for bug-gnu-emacs@gnu.org; Fri, 20 Jun 2008 19:27:17 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K9q0i-0007zW-6u for bug-gnu-emacs@gnu.org; Fri, 20 Jun 2008 19:27:17 -0400 Original-Received: from [199.232.76.173] (port=42751 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K9q0h-0007zJ-Ot for bug-gnu-emacs@gnu.org; Fri, 20 Jun 2008 19:27:15 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:57375) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K9q0g-00042C-Iz for bug-gnu-emacs@gnu.org; Fri, 20 Jun 2008 19:27:15 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m5KNR9TE016966; Fri, 20 Jun 2008 16:27:09 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m5KNA4Ne012448; Fri, 20 Jun 2008 16:10:04 -0700 X-Loop: don@donarmstrong.com Resent-From: Nick Roberts Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 20 Jun 2008 23:10:04 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 451 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 451-submit@emacsbugs.donarmstrong.com id=B451.121400291110385 (code B ref 451); Fri, 20 Jun 2008 23:10:04 +0000 Original-Received: (at 451) by emacsbugs.donarmstrong.com; 20 Jun 2008 23:01:51 +0000 Original-Received: from viper.snap.net.nz (viper.snap.net.nz [202.37.101.25]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m5KN1g8W010369 for <451@emacsbugs.donarmstrong.com>; Fri, 20 Jun 2008 16:01:43 -0700 Original-Received: from kahikatea.snap.net.nz (30.31.255.123.static.snap.net.nz [123.255.31.30]) by viper.snap.net.nz (Postfix) with ESMTP id BB2D33DA176; Sat, 21 Jun 2008 11:01:36 +1200 (NZST) Original-Received: by kahikatea.snap.net.nz (Postfix, from userid 1000) id BA9B38FC6D; Sat, 21 Jun 2008 11:01:18 +1200 (NZST) In-Reply-To: X-Mailer: VM 7.19 under Emacs 22.2.50.3 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Resent-Date: Fri, 20 Jun 2008 19:27:17 -0400 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:18466 gmane.emacs.pretest.bugs:22660 Archived-At: > > 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