emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] table refresh: when should the buffer be marked modified?


From: Carsten Dominik
Subject: Re: [Orgmode] table refresh: when should the buffer be marked modified?
Date: Mon, 22 Jun 2009 07:56:18 +0200


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.
address@hidden
http://lists.gnu.org/mailman/listinfo/emacs-orgmode





reply via email to

[Prev in Thread] Current Thread [Next in Thread]