GNU bug report logs - #4597
Antwort: Re: bug#4587: 23.1; sort-lines and sort-fields always set buffer modified

Previous Next

Package: emacs;

Reported by: Roland.Meier <at> continental-corporation.com

Date: Wed, 30 Sep 2009 10:10:04 UTC

Severity: minor

Merged with 4587

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.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 4597 in the body.
You can then email your comments to 4597 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-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4597; Package emacs. (Wed, 30 Sep 2009 10:10:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Roland.Meier <at> continental-corporation.com:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Wed, 30 Sep 2009 10:10:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Roland.Meier <at> continental-corporation.com
To: monnier <at> iro.umontreal.ca
Cc: 4587 <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
Subject: Antwort: Re: bug#4587: 23.1; sort-lines and sort-fields always set buffer
 modified
Date: Wed, 30 Sep 2009 12:00:56 +0200
[Message part 1 (text/plain, inline)]
> Yes, that's generally desirable.  But in the above cases, given the way
> the code currently works, it's fairly inconvenient to do (the code does
> modify the buffer, it just so happens that the end text is the same as
> the original text), so it doesn't seem worth the trouble.

Wouldn't it be possible in case of an unmodified buffer to copy the 
content of the region at the beginning to a temporary buffer, compare it 
to the result afterwards, and if they match to restore the unmodified 
status?

I sometimes need to check a list (which isn't small enough to be checked 
at a glance) after editing it if it is still sorted.
Now I write he region before and after sorting it to separate files and 
compare them, but I wonder if a powerful tool like emacs must keep such an 
obvious annoyance like this...

Thanks!
-- 
Mit freundlichen Grüßen
Roland Meier
     \|||/ 
     (o o) 
==ooO==U==Ooo== 
[Message part 2 (text/html, inline)]

Forcibly Merged 4587 4597 4601. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Wed, 30 Sep 2009 16:35:08 GMT) Full text and rfc822 format available.

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4597; Package emacs. (Wed, 30 Sep 2009 17:05:14 GMT) Full text and rfc822 format available.

Acknowledgement sent to Magnus Henoch <mange <at> freemail.hu>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Wed, 30 Sep 2009 17:05:15 GMT) Full text and rfc822 format available.

Message #12 received at 4597 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Magnus Henoch <mange <at> freemail.hu>
To: Roland.Meier <at> continental-corporation.com
Cc: 4597 <at> debbugs.gnu.org
Subject: Re: bug#4597: Antwort: Re: bug#4587: 23.1; sort-lines and sort-fields always set buffer modified
Date: Wed, 30 Sep 2009 17:56:57 +0100
Roland.Meier <at> continental-corporation.com writes:

> I sometimes need to check a list (which isn't small enough to be checked 
> at a glance) after editing it if it is still sorted.

Maybe M-x diff-buffer-with-file could do that for you?

HTH,
Magnus



Disconnected #4601 from all other report(s). Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 27 Jan 2010 19:06:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#4597; Package emacs. (Tue, 03 May 2022 19:25:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Roland.Meier <at> continental-corporation.com
Cc: 4587 <at> debbugs.gnu.org, rm369 <at> arcor.de, 4597 <at> debbugs.gnu.org
Subject: Re: bug#4597: Antwort: Re: bug#4587: 23.1; sort-lines and
 sort-fields always set buffer modified
Date: Tue, 03 May 2022 21:24:09 +0200
Roland.Meier <at> continental-corporation.com writes:

> M-x sort-lines and M-x sort-fields always set the buffer modified 
> status ("-" -> "*" in column 5 of the status line), even if the region 
> was sorted and the command did not modify anything. 
> An unmodified buffer should stay unmodified if nothing was changed. 

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

I've now fixed this in Emacs 29.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 29.1, send any further explanations to 4597 <at> debbugs.gnu.org and Roland.Meier <at> continental-corporation.com Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 03 May 2022 19:25:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#4597; Package emacs. (Wed, 04 May 2022 07:22:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 4587 <at> debbugs.gnu.org, Roland.Meier <at> continental-corporation.com,
 4597 <at> debbugs.gnu.org, rm369 <at> arcor.de
Subject: Re: bug#4597: Antwort: Re: bug#4587: 23.1;
 sort-lines and sort-fields always set buffer modified
Date: Wed, 04 May 2022 10:21:08 +0300
> Resent-From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
> Resent-CC: bug-gnu-emacs <at> gnu.org
> Resent-Sender: help-debbugs <at> gnu.org
> Cc: 4587 <at> debbugs.gnu.org, rm369 <at> arcor.de, 4597 <at> debbugs.gnu.org
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date: Tue, 03 May 2022 21:24:09 +0200
> 
> Roland.Meier <at> continental-corporation.com writes:
> 
> > M-x sort-lines and M-x sort-fields always set the buffer modified 
> > status ("-" -> "*" in column 5 of the status line), even if the region 
> > was sorted and the command did not modify anything. 
> > An unmodified buffer should stay unmodified if nothing was changed. 
> 
> (I'm going through old bug reports that unfortunately weren't resolved
> at the time.)
> 
> I've now fixed this in Emacs 29.

This uses buffer-hash, which is only sensitive to changes in the byte
sequences of the buffer text.  AFAIU, it doesn't know about other
possible changes we perceive as "buffer changes", like changes in
faces, overlays, buffer-file-coding-system, etc.  Shouldn't this be
prominently documented in the macro's doc string?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#4597; Package emacs. (Wed, 04 May 2022 07:54:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 4587 <at> debbugs.gnu.org, Roland.Meier <at> continental-corporation.com,
 4597 <at> debbugs.gnu.org, rm369 <at> arcor.de
Subject: Re: bug#4597: Antwort: Re: bug#4587: 23.1; sort-lines and
 sort-fields always set buffer modified
Date: Wed, 04 May 2022 09:53:24 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> This uses buffer-hash, which is only sensitive to changes in the byte
> sequences of the buffer text.  AFAIU, it doesn't know about other
> possible changes we perceive as "buffer changes", like changes in
> faces, overlays, buffer-file-coding-system, etc.  Shouldn't this be
> prominently documented in the macro's doc string?

(Adding overlays doesn't change modification status.)

If you think that needs to be spelled out, please go ahead, but it
doesn't seem necessary to me.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




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

This bug report was last modified 3 years and 21 days ago.

Previous Next


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