From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: table refresh: when should the buffer be marked modified? Date: Mon, 22 Jun 2009 07:56:18 +0200 Message-ID: <414DFC1C-65FE-4188-BF2C-8670A58856A0@gmail.com> References: <4A3DFE89.7070508@alumni.ethz.ch> Mime-Version: 1.0 (Apple Message framework v935.3) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MIdSf-0006iP-48 for emacs-orgmode@gnu.org; Mon, 22 Jun 2009 02:57:01 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MIdSa-0006g7-6c for emacs-orgmode@gnu.org; Mon, 22 Jun 2009 02:57:00 -0400 Received: from [199.232.76.173] (port=57552 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MIdSa-0006g3-1a for emacs-orgmode@gnu.org; Mon, 22 Jun 2009 02:56:56 -0400 Received: from mx20.gnu.org ([199.232.41.8]:52281) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MIdSZ-0003qG-6u for emacs-orgmode@gnu.org; Mon, 22 Jun 2009 02:56:55 -0400 Received: from mail-ew0-f220.google.com ([209.85.219.220]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MIdSY-0006TP-AI for emacs-orgmode@gnu.org; Mon, 22 Jun 2009 02:56:54 -0400 Received: by mail-ew0-f220.google.com with SMTP id 20so1176205ewy.42 for ; Sun, 21 Jun 2009 23:56:54 -0700 (PDT) In-Reply-To: <4A3DFE89.7070508@alumni.ethz.ch> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Michael Brand Cc: emacs-orgmode@gnu.org On Jun 21, 2009, at 11:34 AM, Michael Brand wrote: > I was not able to find a description about buffer modification after > a table refresh. A table refresh always *does* modify the buffer, even if the resulting buffer is the same. You have observed correctly that I am by-passing this when aligning all tables on startup, but I don't think I want to check this each time a table is being aligned, this would cause overhead. If you really want this, you could use advice on org-table-align, temporarily binding inhibit-read-only, storing the value of buffer-modified-flag, doing the alignment and then restoring the value of buffer-modified-flag. SOmething like (let ((inhibit-read-only t)) (org-unmodified ad-do-it) ..... What are the practical situations when you are reading read-only files in Org-mode? Maybe you can change this? HTH - Carsten > > When a table gets a refresh like after C-c C-c or moving around with > Tab the buffer is marked modified also when no change for > realignment of the table grid is necessary. Is this an > implementation limitation for simplification? If yes my vote for > which of the features to be next would be that during a table > refresh there is a check if an automatic realignment changed the > table grid. If the buffer's file does not need an update I would > like the buffer to remain not modified. Beside other advantages it > would make it possible to narrow columns in read-only buffers which > are not narrowed before for any reason and I am not sure if it would > eventually help me with multiple undo in tables which confused me > sometimes. > > My opposite finding is that - interestingly only with org-startup- > align-all-tables t ! - when I open a file with a misaligned table > not in org-mode and then invoke org-mode the table gets aligned but > the buffer does not get modified. I expected it modified, org-mode > version is 6.27a. > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode