GNU bug report logs - #3863
23.1.50; possible save-match-data in copyright.el

Previous Next

Package: emacs;

Reported by: Kevin Ryde <user42 <at> zip.com.au>

Date: Thu, 16 Jul 2009 00:10:05 UTC

Severity: normal

Done: Kevin Ryde <user42 <at> zip.com.au>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (Emacs bug Tracking System)
To: Kevin Ryde <user42 <at> zip.com.au>
Subject: bug#3863 closed by Kevin Ryde <user42 <at> zip.com.au> (Re: bug#3863:
 23.1.50; possible save-match-data in copyright.el)
Date: Fri, 02 Oct 2009 00:20:07 +0000
[Message part 1 (text/plain, inline)]
This is an automatic notification regarding your bug report
which was filed against the emacs package:

#3863: 23.1.50; possible save-match-data in copyright.el

It has been closed by Kevin Ryde <user42 <at> zip.com.au>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Kevin Ryde <user42 <at> zip.com.au> by
replying to this email.


-- 
3863: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3863
Emacs Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Kevin Ryde <user42 <at> zip.com.au>
To: 3863-done <at> debbugs.gnu.org
Subject: Re: bug#3863: 23.1.50; possible save-match-data in copyright.el
Date: Fri, 02 Oct 2009 10:14:07 +1000
Closing for,

Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>
> installed,
[Message part 3 (message/rfc822, inline)]
From: Kevin Ryde <user42 <at> zip.com.au>
To: emacs-pretest-bug <at> gnu.org
Subject: 23.1.50; possible save-match-data in copyright.el
Date: Thu, 16 Jul 2009 10:05:39 +1000
[Message part 4 (text/plain, inline)]
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 <at> zip.com.au>

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

[copyright.el.save-match-data.diff (text/x-diff, inline)]
*** 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

This bug report was last modified 15 years and 239 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.