From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Amann Subject: Re: problem with org-table-export Date: Sat, 28 May 2016 20:39:50 +0100 Message-ID: <87a8jarmyh.fsf@msstf091.ucc.ie> References: <87d1o7ruis.fsf@msstf091.ucc.ie> <87y46utu0m.fsf@gmx.us> <87a8jao0k5.fsf@saiph.selenimh> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36260) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6kKj-00015u-HT for emacs-orgmode@gnu.org; Sat, 28 May 2016 15:55:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6kKg-0003nz-Ap for emacs-orgmode@gnu.org; Sat, 28 May 2016 15:55:41 -0400 Received: from mail-am1on0058.outbound.protection.outlook.com ([157.56.112.58]:21536 helo=emea01-am1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6kKf-0003nv-Qf for emacs-orgmode@gnu.org; Sat, 28 May 2016 15:55:38 -0400 In-Reply-To: <87a8jao0k5.fsf@saiph.selenimh> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Nicolas Goaziou , Rasmus Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Nicolas Goaziou 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 --=-=-= Content-Type: text/plain Content-Disposition: inline; filename="table.org" | test | --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename="0001-org-table-export-fix-problem-with-modified-flags.patch" >From 1aa422b0008af1c0375037eac2f075db8d4ef23c Mon Sep 17 00:00:00 2001 From: Andreas Amann 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 --=-=-=--