From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: Changing of line format and undo Date: Wed, 21 Jun 2006 18:47:27 +0200 Message-ID: <4499781F.7090802@student.lu.se> References: <44987375.2010000@student.lu.se> <449961F6.6020001@student.lu.se> <85mzc6y204.fsf@lola.goethe.zz> <44996AE1.7020907@student.lu.se> <858xnqxyg9.fsf@lola.goethe.zz> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1150908482 20909 80.91.229.2 (21 Jun 2006 16:48:02 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 21 Jun 2006 16:48:02 +0000 (UTC) Cc: Eli Zaretskii , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 21 18:47:54 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Ft5rk-00047t-18 for ged-emacs-devel@m.gmane.org; Wed, 21 Jun 2006 18:47:44 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ft5rj-00013l-GN for ged-emacs-devel@m.gmane.org; Wed, 21 Jun 2006 12:47:43 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ft5rY-00013F-Bc for emacs-devel@gnu.org; Wed, 21 Jun 2006 12:47:32 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ft5rW-00012k-Ni for emacs-devel@gnu.org; Wed, 21 Jun 2006 12:47:32 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ft5rW-00012g-Ew for emacs-devel@gnu.org; Wed, 21 Jun 2006 12:47:30 -0400 Original-Received: from [81.228.8.83] (helo=pne-smtpout1-sn2.hy.skanova.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Ft62H-00075e-J7; Wed, 21 Jun 2006 12:58:37 -0400 Original-Received: from [192.168.123.121] (83.249.218.244) by pne-smtpout1-sn2.hy.skanova.net (7.2.072.1) id 4499398D000129C6; Wed, 21 Jun 2006 18:47:27 +0200 User-Agent: Thunderbird 1.5.0.4 (Windows/20060516) Original-To: David Kastrup In-Reply-To: <858xnqxyg9.fsf@lola.goethe.zz> X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:56058 Archived-At: David Kastrup wrote: > Lennart Borgman writes: > > >> David Kastrup wrote: >> >>> Lennart Borgman writes: >>> >>> >>> >>>> Eli Zaretskii wrote: >>>> >>>> >>>>>> Date: Wed, 21 Jun 2006 00:15:17 +0200 >>>>>> From: Lennart Borgman >>>>>> >>>>>> If you change line endings this change is not saved to undo. Is >>>>>> this the expected behaviour? >>>>>> >>>>>> >>>>> If you mean "C-x RET f", then it doesn't really change anything. It >>>>> just sets a buffer-local variable to some value. So there's nothing >>>>> to undo. >>>>> >>>>> >>>> That is an internal Emacs perpective. From a users point of view there >>>> is truly a change. If you for example change the line endings the file >>>> will be saved with this new line endings. >>>> >>>> BTW should not changes of this kind also set the buffer to modified? >>>> >>>> >>> What makes you think they don't? >>> >>> >>> >> Test this for example: >> >> (defun test-set-eol() >> (interactive) >> (let* ((coding buffer-file-coding-system) >> (new-coding (coding-system-change-eol-conversion coding 2))) >> (setq buffer-file-coding-system new-coding))) >> > > Very funny. setq most certainly does not trigger effects like a > changed buffer modification flag. But setq is not a user-level > command. Here is one that is: > Thanks, you are right ;-) Now I see what Eli meant. I still believe that everything that can result in changing an external file should go into the undo history but this is really a corner case of course.