emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* table refresh: when should the buffer be marked modified?
@ 2009-06-21  9:34 Michael Brand
  2009-06-22  5:56 ` Carsten Dominik
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Brand @ 2009-06-21  9:34 UTC (permalink / raw)
  To: emacs-orgmode

I was not able to find a description about buffer modification after a table refresh.

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: table refresh: when should the buffer be marked modified?
  2009-06-21  9:34 table refresh: when should the buffer be marked modified? Michael Brand
@ 2009-06-22  5:56 ` Carsten Dominik
  0 siblings, 0 replies; 2+ messages in thread
From: Carsten Dominik @ 2009-06-22  5:56 UTC (permalink / raw)
  To: Michael Brand; +Cc: emacs-orgmode


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-06-22  6:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-21  9:34 table refresh: when should the buffer be marked modified? Michael Brand
2009-06-22  5:56 ` Carsten Dominik

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).