GNU bug report logs - #14824
24.3.50; Regression: problem with undo in Mail mode

Previous Next

Package: emacs;

Reported by: rms <at> gnu.org

Date: Mon, 8 Jul 2013 17:30:03 UTC

Severity: important

Found in version 24.3.50

Fixed in version 24.4

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 14824 in the body.
You can then email your comments to 14824 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#14824; Package emacs. (Mon, 08 Jul 2013 17:30:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to rms <at> gnu.org:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 08 Jul 2013 17:30:06 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Richard Stallman <rms <at> gnu.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; Regression: problem with undo in Mail mode
Date: Mon, 08 Jul 2013 13:29:36 -0400
I type C-x m rms C-c C-s, and it sends the message.
(I am using Mail mode.)  The buffer is marked unmodified.

I type 1, and the buffer becomes modified.
I type C-x u, and it deletes the 1,
but the buffer is still marked as modified.

In Emacs 23.2, that undo also marks the buffer as unmodified again.

Unfortunately I can't try intermediate versions; they don't
remain in my machine.



In GNU Emacs 24.3.50.2 (mips64el-unknown-linux-gnu, GTK+ Version 2.20.1)
 of 2013-05-25 on chiefs-gnewsense
Bzr revision: 112729 monnier <at> iro.umontreal.ca-20130525030804-6onx9rhvib7pv3fc
System Description:	gNewSense GNU/Linux 3.0 (parkes)

Configured using:
 `configure CFLAGS=-g -O0'

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: RMAIL

Minor modes in effect:
  shell-dirtrack-mode: t
  gpm-mouse-mode: t
  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
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t
  abbrev-mode: t

Recent input:
o ESC > RET RET ESC , C-@ C-p C-p C-p C-w C-x C-s C-x 
b R TAB RET ESC , C-_ C-x o r y ESC , C-o RET I SPC 
a m SPC s o r r y SPC t o SPC h e a r SPC i t . SPC 
SPC I t SPC i s SPC a SPC g o o d SPC i d e a SPC t 
o SPC g e t SPC m e d i c a l SPC t r e a t m e n t 
RET i f SPC y o u SPC a r e SPC d e p r e s s e d . 
C-a C-k C-p ESC e SPC SPC C-y C-x C-x ESC c ESC f ESC 
f ESC f C-d C-d , ESC l ESC q C-n . C-p ESC f ESC f 
ESC f ESC f ESC f C-f C-o SPC a n d SPC i t SPC i s 
SPC n o t SPC c a u s e d RET b SPC y SPC DEL DEL DEL 
DEL y SPC DEL DEL b y SPC t h e SPC r e a l SPC s i 
t u a t i o n SPC a r o n d SPC DEL DEL DEL u d SPC 
y o u , SPC ESC q ESC b ESC b C-f C-f C-f C-f n ESC 
q C-n C-n C-x o C-x 1 C-u C-v C-u C-v C-u C-n C-u C-n 
C-n C-u C-v C-u C-v C-u C-v C-u C-v C-u C-v c C-c C-c 
C-d x x m C-x 0 ESC x r e p o r t SPC e m a c s SPC 
b SPC u g DEL DEL RET

Recent messages:
Undo!
Unsent message being composed; erase it? (y or n)  y
Mark set
Auto-saving...done
Mark set
Auto save file for draft message exists; consider M-x mail-recover
Sending...
Wrote /home/rms/outgoing/out-23
Sending...done
Expunging deleted messages...done

Load-path shadows:
/home/rms/emacs-bzr/trunk/lisp/net/shr-color hides /home/rms/emacs-bzr/trunk/lisp/gnus/shr-color
/home/rms/emacs-bzr/trunk/lisp/net/shr hides /home/rms/emacs-bzr/trunk/lisp/gnus/shr

Features:
(shadow emacsbug epa-mail epa derived epg epg-config ispell dired-aux
parse-time vc-cvs sgml-mode quail shell pcomplete grep compile comint
ansi-color rmailout dabbrev novice misearch multi-isearch etags ring
help-mode rmailsum mailalias qp rmailmm message sendmail format-spec
rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mailabbrev
gmm-utils mailheader mail-parse rfc2231 dired t-mouse time-date
finder-inf package rmailedit rmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils paren cus-start cus-load nadvice advice help-fns
tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment
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 macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
dbusbind inotify dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)
        [ To any NSA and FBI agents reading my email: please consider
        [ whether defending the US Constitution against all enemies,
        [ foreign or domestic, requires you to follow Snowden's example.


-- 
Dr Richard Stallman
President, Free Software Foundation
51 Franklin St
Boston MA 02110
USA
www.fsf.org  www.gnu.org
Skype: No way! That's nonfree (freedom-denying) software.
  Use Ekiga or an ordinary phone call.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14824; Package emacs. (Mon, 08 Jul 2013 17:48:02 GMT) Full text and rfc822 format available.

Message #8 received at 14824 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: rms <at> gnu.org
Cc: 14824 <at> debbugs.gnu.org
Subject: Re: bug#14824: 24.3.50; Regression: problem with undo in Mail mode
Date: Mon, 08 Jul 2013 13:47:45 -0400
Richard Stallman wrote:

> I type C-x m rms C-c C-s, and it sends the message.
> (I am using Mail mode.)  The buffer is marked unmodified.
>
> I type 1, and the buffer becomes modified.
> I type C-x u, and it deletes the 1,
> but the buffer is still marked as modified.
>
> In Emacs 23.2, that undo also marks the buffer as unmodified again.
>
> Unfortunately I can't try intermediate versions; they don't
> remain in my machine.

Seems to have nothing to do with Mail mode. Minimal example with current
trunk:

emacs -Q
1
C-x u
    ; buffer still marked modified


Issue not present in 24.3.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14824; Package emacs. (Tue, 09 Jul 2013 00:47:02 GMT) Full text and rfc822 format available.

Message #11 received at 14824 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: aaron.s.hawley <at> gmail.com, monnier <at> iro.umontreal.ca
Cc: 14824 <at> debbugs.gnu.org, rms <at> gnu.org
Subject: Re: bug#14824: 24.3.50; Regression: problem with undo in Mail mode
Date: Mon, 08 Jul 2013 20:46:00 -0400
Glenn Morris wrote:

> Seems to have nothing to do with Mail mode. Minimal example with current
> trunk:
>
> emacs -Q
> 1
> C-x u
>     ; buffer still marked modified
>
>
> Issue not present in 24.3.

Bisected to:

revno: 111447
author: Aaron S. Hawley <aaron.s.hawley <at> gmail.com>
committer: Stefan Monnier <monnier <at> iro.umontreal.ca>
branch nick: trunk
timestamp: Tue 2013-01-08 14:13:31 -0500
message:
  * lisp/simple.el (primitive-undo): Move from undo.c.
  * src/undo.c (Fprimitive_undo): Move to simple.el.
  (syms_of_undo): Remove declaration for Sprimitive_undo.
  * test/automated/undo-tests.el: New file.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14824; Package emacs. (Tue, 09 Jul 2013 08:57:02 GMT) Full text and rfc822 format available.

Message #14 received at 14824 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: aaron.s.hawley <at> gmail.com
Cc: Glenn Morris <rgm <at> gnu.org>, 14824 <at> debbugs.gnu.org, rms <at> gnu.org
Subject: Re: bug#14824: 24.3.50; Regression: problem with undo in Mail mode
Date: Tue, 09 Jul 2013 04:56:10 -0400
>> emacs -Q
>> 1
>> C-x u
>> ; buffer still marked modified

> Bisected to:

> revno: 111447
> author: Aaron S. Hawley <aaron.s.hawley <at> gmail.com>
> committer: Stefan Monnier <monnier <at> iro.umontreal.ca>
> branch nick: trunk
> timestamp: Tue 2013-01-08 14:13:31 -0500
> message:
>   * lisp/simple.el (primitive-undo): Move from undo.c.
>   * src/undo.c (Fprimitive_undo): Move to simple.el.
>   (syms_of_undo): Remove declaration for Sprimitive_undo.
>   * test/automated/undo-tests.el: New file.

A shot in the dark: it might be due to the finer timestamps (since
these were introduced fairly recently, whereas Aaron's code is actually
pretty old (even tho it was installed only recently)).

Aaron?


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14824; Package emacs. (Tue, 09 Jul 2013 14:21:02 GMT) Full text and rfc822 format available.

Message #17 received at 14824 <at> debbugs.gnu.org (full text, mbox):

From: "Aaron S. Hawley" <aaron.s.hawley <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Glenn Morris <rgm <at> gnu.org>, 14824 <at> debbugs.gnu.org, rms <at> gnu.org
Subject: Re: bug#14824: 24.3.50; Regression: problem with undo in Mail mode
Date: Tue, 9 Jul 2013 10:20:48 -0400
> A shot in the dark: it might be due to the finer timestamps (since
> these were introduced fairly recently, whereas Aaron's code is actually
> pretty old (even tho it was installed only recently)).

That is a good theory.  I remember studying the time precision changes
by Paul Eggert from last year.  I think these were them:

http://bzr.savannah.gnu.org/lh/emacs/trunk/revision/108687
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9000

The changes to time values in Emacs were a concern of mine when the
new Lisp version of undo was finally merged to trunk.  I don't have an
Emacs trunk build at the moment, so I can't confirm.  It would be this
section of the new undo code, though:

http://bzr.savannah.gnu.org/lh/emacs/trunk/annotate/113327/lisp/simple.el#L2132

I am a little surprised this was broken in trunk for the last 6
months, and nobody had noticed.  The automated test suite could catch
this by adding a line containing (should (not (buffer-modified-p))) to
one of the unit tests.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14824; Package emacs. (Tue, 09 Jul 2013 16:01:02 GMT) Full text and rfc822 format available.

Message #20 received at 14824 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: "Aaron S. Hawley" <aaron.s.hawley <at> gmail.com>
Cc: 14824 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>,
 rms <at> gnu.org
Subject: Re: bug#14824: 24.3.50; Regression: problem with undo in Mail mode
Date: Tue, 09 Jul 2013 11:59:53 -0400
>> A shot in the dark: it might be due to the finer timestamps (since
>> these were introduced fairly recently, whereas Aaron's code is actually
>> pretty old (even tho it was installed only recently)).

As another data point, the problem only happens with buffers that are
not visiting files.

> I am a little surprised this was broken in trunk for the last 6
> months, and nobody had noticed. 

I'm not that surprised.

> The automated test suite could catch this by adding a line containing
> (should (not (buffer-modified-p))) to one of the unit tests.

Yep.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14824; Package emacs. (Tue, 09 Jul 2013 17:59:02 GMT) Full text and rfc822 format available.

Message #23 received at 14824 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: "Aaron S. Hawley" <aaron.s.hawley <at> gmail.com>
Cc: 14824 <at> debbugs.gnu.org, rms <at> gnu.org
Subject: Re: bug#14824: 24.3.50; Regression: problem with undo in Mail mode
Date: Tue, 09 Jul 2013 13:58:35 -0400
Glenn Morris wrote:

> As another data point, the problem only happens with buffers that are
> not visiting files.

I think the issue might be:

buffer-undo-list has an element of the form:

 (t 0 0 0 -2000)

I don't know where -2000 picosecs comes from.

In undo.c, the test was:

  EMACS_TIME_NE (mod_time, base_buffer->modtime)

Now the test is:

(equal time (visited-file-modtime))

But visited-file-modtime returns 0 rather than -2000 picoseconds.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14824; Package emacs. (Tue, 09 Jul 2013 18:21:01 GMT) Full text and rfc822 format available.

Message #26 received at 14824 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: "Aaron S. Hawley" <aaron.s.hawley <at> gmail.com>
Cc: 14824 <at> debbugs.gnu.org, rms <at> gnu.org
Subject: Re: bug#14824: 24.3.50; Regression: problem with undo in Mail mode
Date: Tue, 09 Jul 2013 14:20:42 -0400
Glenn Morris wrote:

>  (t 0 0 0 -2000)
>
> I don't know where -2000 picosecs comes from.

Oh, I guess it is UNKNOWN_MODTIME_NSECS = -2.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14824; Package emacs. (Tue, 09 Jul 2013 18:27:02 GMT) Full text and rfc822 format available.

Message #29 received at 14824 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: "Aaron S. Hawley" <aaron.s.hawley <at> gmail.com>
Cc: Paul Eggert <eggert <at> cs.ucla.edu>, 14824 <at> debbugs.gnu.org, rms <at> gnu.org
Subject: Re: bug#14824: 24.3.50; Regression: problem with undo in Mail mode
Date: Tue, 09 Jul 2013 14:26:25 -0400
Glenn Morris wrote:

> Glenn Morris wrote:
>
>>  (t 0 0 0 -2000)
>>
>> I don't know where -2000 picosecs comes from.
>
> Oh, I guess it is UNKNOWN_MODTIME_NSECS = -2.

So I guess the actual problem is that there seems no way to replicate

EMACS_TIME_NE (mod_time, base_buffer->modtime)

at the Lisp level.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14824; Package emacs. (Wed, 10 Jul 2013 06:31:02 GMT) Full text and rfc822 format available.

Message #32 received at 14824 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 14824 <at> debbugs.gnu.org, "Aaron S. Hawley" <aaron.s.hawley <at> gmail.com>,
 rms <at> gnu.org
Subject: Re: bug#14824: 24.3.50; Regression: problem with undo in Mail mode
Date: Tue, 09 Jul 2013 23:29:49 -0700
I installed what I hope is a fix for the bug --
please try Emacs trunk bzr 113351 or later.
It works for me, for the simple test case
that Glenn gave yesterday.




bug marked as fixed in version 24.4, send any further explanations to 14824 <at> debbugs.gnu.org and rms <at> gnu.org Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 10 Jul 2013 16:48:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 08 Aug 2013 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 270 days ago.

Previous Next


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