emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] problem with org-table-export


From: Andreas Amann
Subject: Re: [O] problem with org-table-export
Date: Sat, 28 May 2016 20:39:50 +0100
User-agent: Notmuch/0.22 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-unknown-linux-gnu)

Nicolas Goaziou <address@hidden> writes:
>
> IIRC I fixed it already some time ago. Besides, I'm not able to
> reproduce the problem.

The problem I reported exists with current master, but maybe I did not
describe it well enough. Let me try once more with a specific file which
shows the problem.  Open the attached file "table.org" in emacs.  Then
do

M-x org-table-export

you will then be prompted with "Export table to:" for a filename, where
you wish to export to.  Note that already at this point two stars appear
in the emacs status line, which indicate that the buffer has been
modified.  This is a bug, as no real modification of the buffer
has happened at this point.  

The attached patch solves the problem for me by only calling
org-table-align if both org-table-automatic-realign and
org-table-may-need-update.  However, I am not completely sure if this is
the correct solution though, I simply used the same idiom as is used in
org-table-next-field and org-table-previous-field functions.

Regards,
Andreas

| test |
>From 1aa422b0008af1c0375037eac2f075db8d4ef23c Mon Sep 17 00:00:00 2001
From: Andreas Amann <address@hidden>
Date: Sat, 28 May 2016 20:23:52 +0100
Subject: [PATCH] org-table-export: fix problem with modified flags

org-table-export did always set the modified flags of a buffer, even
if no modification happens during export.  Fix by only calling
org-table-align if required.
---
 lisp/org-table.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/org-table.el b/lisp/org-table.el
index c6a84b8..89677cc 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -662,7 +662,9 @@ extension of the given file name, and finally on the 
variable
 `org-table-export-default-format'."
   (interactive)
   (unless (org-at-table-p) (user-error "No table at point"))
-  (org-table-align)           ; Make sure we have everything we need.
+  (if (and org-table-automatic-realign
+          org-table-may-need-update)
+      (org-table-align))
   (let ((file (or file (org-entry-get (point) "TABLE_EXPORT_FILE" t))))
     (unless file
       (setq file (read-file-name "Export table to: "))
-- 
2.8.2


reply via email to

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