unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#3863: 23.1.50; possible save-match-data in copyright.el
@ 2009-07-16 14:33 Chong Yidong
  2009-07-16 17:24 ` Stefan Monnier
  2009-08-06  0:56 ` Kevin Ryde
  0 siblings, 2 replies; 13+ messages in thread
From: Chong Yidong @ 2009-07-16 14:33 UTC (permalink / raw)
  To: Kevin Ryde; +Cc: 3863

> In recent copyright.el I noticed copyright-update using the match data
> after a y-or-n-p query.  Is that a good idea?
>
> When running it in emacs 22 I seemed to sometimes get the match data
> clobbered by y-or-n-p.

If so, we should change y-or-n-p to save the match data.  Could you
provide a reproducible test-case for the clobbering of the match data?





^ permalink raw reply	[flat|nested] 13+ messages in thread
* bug#3863: 23.1.50; possible save-match-data in copyright.el
@ 2009-07-16  0:05 Kevin Ryde
  2009-07-16  2:01 ` Stefan Monnier
  0 siblings, 1 reply; 13+ messages in thread
From: Kevin Ryde @ 2009-07-16  0:05 UTC (permalink / raw)
  To: emacs-pretest-bug

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

In recent copyright.el I noticed copyright-update using the match data
after a y-or-n-p query.  Is that a good idea?

When running it in emacs 22 I seemed to sometimes get the match data
clobbered by y-or-n-p.  I never tracked down the circumstances, but
wondered if copyright.el shouldn't rely on what an input func like
y-or-n-p could do, per diff below.


In GNU Emacs 23.1.50.1 (i586-pc-linux-gnu, GTK+ Version 2.16.4)
 of 2009-07-12 on blah.blah
configured using `configure  'CFLAGS=-O -g' '--prefix=/down/emacs/b/inst' '--with-x-toolkit=gtk''

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


2009-07-16  Kevin Ryde  <user42@zip.com.au>

	* emacs-lisp/copyright.el (copyright-update): save-match-data across
	y-or-n-p, for safety.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: copyright.el.save-match-data.diff --]
[-- Type: text/x-diff, Size: 917 bytes --]

*** copyright.el	16 Jul 2009 09:44:20 +1000	1.81
--- copyright.el	16 Jul 2009 09:55:57 +1000	
***************
*** 223,230 ****
                 (< (string-to-number (match-string 3))
                    (string-to-number copyright-current-gpl-version))
  	       (or noquery
! 		   (y-or-n-p (format "Replace GPL version by %s? "
! 				     copyright-current-gpl-version)))
  	       (progn
  		 (if (match-end 2)
  		     ;; Esperanto bilingual comment in two-column.el
--- 223,231 ----
                 (< (string-to-number (match-string 3))
                    (string-to-number copyright-current-gpl-version))
  	       (or noquery
!                    (save-match-data
!                      (y-or-n-p (format "Replace GPL version by %s? "
!                                        copyright-current-gpl-version))))
  	       (progn
  		 (if (match-end 2)
  		     ;; Esperanto bilingual comment in two-column.el

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2009-08-06  0:56 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-16 14:33 bug#3863: 23.1.50; possible save-match-data in copyright.el Chong Yidong
2009-07-16 17:24 ` Stefan Monnier
2009-07-16 18:42   ` Lennart Borgman
2009-07-17  3:23     ` Stefan Monnier
2009-07-17  4:00       ` Lennart Borgman
2009-07-17  7:57       ` martin rudalics
2009-07-16 18:54   ` Chong Yidong
2009-07-17  3:24     ` Stefan Monnier
2009-07-17  3:54       ` Chong Yidong
2009-07-17 16:00         ` Stefan Monnier
2009-08-06  0:56 ` Kevin Ryde
  -- strict thread matches above, loose matches on Subject: below --
2009-07-16  0:05 Kevin Ryde
2009-07-16  2:01 ` Stefan Monnier

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).