From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.bugs Subject: bug#4587: Antwort: Re: bug#4587: 23.1; sort-lines and sort-fields always set buffer modified Date: Thu, 01 Oct 2009 06:25:59 -0600 Message-ID: References: Reply-To: Kevin Rodgers , 4587@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1254402820 28527 80.91.229.12 (1 Oct 2009 13:13:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 1 Oct 2009 13:13:40 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 01 15:13:33 2009 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 1MtLTL-0003qw-F5 for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Oct 2009 15:13:27 +0200 Original-Received: from localhost ([127.0.0.1]:34315 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MtLTK-0002r6-Nb for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Oct 2009 09:13:26 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MtL47-0000Kf-Ga for bug-gnu-emacs@gnu.org; Thu, 01 Oct 2009 08:47:23 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MtL43-0000Jy-RQ for bug-gnu-emacs@gnu.org; Thu, 01 Oct 2009 08:47:23 -0400 Original-Received: from [199.232.76.173] (port=49445 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MtL43-0000Jv-Oz for bug-gnu-emacs@gnu.org; Thu, 01 Oct 2009 08:47:19 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:48464) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MtL42-0007KO-0o for bug-gnu-emacs@gnu.org; Thu, 01 Oct 2009 08:47:19 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n91Cl7eG025282; Thu, 1 Oct 2009 05:47:08 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n91CZ8P0023522; Thu, 1 Oct 2009 05:35:08 -0700 Resent-Date: Thu, 1 Oct 2009 05:35:08 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Kevin Rodgers Original-Sender: news Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Thu, 01 Oct 2009 12:35:08 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 4587 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.125440021823184 (code B ref -1); Thu, 01 Oct 2009 12:35:08 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 1 Oct 2009 12:30:18 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n91CUGE0023163 for ; Thu, 1 Oct 2009 05:30:17 -0700 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MtKnX-0003yK-RN for bug-gnu-emacs@gnu.org; Thu, 01 Oct 2009 08:30:15 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MtKnT-0003so-6X for bug-gnu-emacs@gnu.org; Thu, 01 Oct 2009 08:30:15 -0400 Original-Received: from [199.232.76.173] (port=57786 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MtKnS-0003sR-P7 for bug-gnu-emacs@gnu.org; Thu, 01 Oct 2009 08:30:10 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:53216) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MtKnS-0003B7-0Z for bug-gnu-emacs@gnu.org; Thu, 01 Oct 2009 08:30:10 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.50) id 1MtKnL-0008Dw-RE for bug-gnu-emacs@gnu.org; Thu, 01 Oct 2009 14:30:03 +0200 Original-Received: from c-71-237-24-138.hsd1.co.comcast.net ([71.237.24.138]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 01 Oct 2009 14:30:03 +0200 Original-Received: from kevin.d.rodgers by c-71-237-24-138.hsd1.co.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 01 Oct 2009 14:30:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 39 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-71-237-24-138.hsd1.co.comcast.net User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) In-Reply-To: X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Thu, 01 Oct 2009 08:47:23 -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:31614 Archived-At: Stefan Monnier wrote: >>> 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'd indeed expect that to implement the feature you request, the code > would have to do something like that. Most likely not copying the text > itself, but instead storing an md5 or somesuch hash of the text. Not suitable for Emacs, but maybe useful for Roland: (defadvice sort-lines (around restore-buffer-modified-p activate) (let* ((buffer-was-modified-p (buffer-modified-p)) (buffer-was-not-modified-md5 (if (not buffer-was-modified-p) (md5 (current-buffer))))) ad-do-it (when (and (not buffer-was-modified-p) (buffer-modified-p) (not (equal buffer-was-not-modified-md5 (md5 (current-buffer))))) (restore-buffer-modified-p buffer-was-modified-p)))) >> 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... > > No, it definitely doesn't have to keep such obvious annoyances. > But it's not very high on the priority list. -- Kevin Rodgers Denver, Colorado, USA