From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gregory Grubbs Subject: Patch for org-table-export Date: Sun, 2 Aug 2009 23:13:35 -0600 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2116065735==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MXprh-0005S7-IH for emacs-orgmode@gnu.org; Mon, 03 Aug 2009 01:13:41 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MXprd-0005RJ-TK for emacs-orgmode@gnu.org; Mon, 03 Aug 2009 01:13:41 -0400 Received: from [199.232.76.173] (port=59918 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MXprd-0005RG-OC for emacs-orgmode@gnu.org; Mon, 03 Aug 2009 01:13:37 -0400 Received: from mail-ew0-f211.google.com ([209.85.219.211]:64978) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MXprd-0001Yu-GM for emacs-orgmode@gnu.org; Mon, 03 Aug 2009 01:13:37 -0400 Received: by ewy7 with SMTP id 7so1052108ewy.42 for ; Sun, 02 Aug 2009 22:13:36 -0700 (PDT) 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: emacs-orgmode@gnu.org --===============2116065735== Content-Type: multipart/alternative; boundary=0016e64c23dcff1a9c047035d48e --0016e64c23dcff1a9c047035d48e Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit I like to make org-mode tables in arbitrary buffers, then save them as CVS files. The export fails when done from a buffer with no associated file. Here's a little patch that allows exporting a table from any buffer (org-mode version 6.28trans): diff --git a/lisp/org-table.el b/lisp/org-table.el index 410f721..4b85f97 100644 --- a/lisp/org-table.el +++ b/lisp/org-table.el @@ -471,8 +471,9 @@ property, locally or anywhere up in the hierarchy." (error "Abort"))) (if (file-directory-p file) (error "This is a directory path, not a file")) - (if (equal (file-truename file) - (file-truename (buffer-file-name))) + (if (and (buffer-file-name) + (equal (file-truename file) + (file-truename (buffer-file-name)))) (error "Please specify a file name that is different from current")) (unless format (setq deffmt-readable org-table-export-default-format) --0016e64c23dcff1a9c047035d48e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I like to make org-mode tables in arbitrary buffers, then save them as CVS = files. The export fails when done from a buffer with no associated file.
=A0Here's a little patch that allows exporting a table from any b= uffer (org-mode version 6.28trans):

diff --git a/lisp/org-table.el b/lisp/org-table.el
index 410f721..4b= 85f97 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -4= 71,8 +471,9 @@ property, locally or anywhere up in the hierarchy."
=A0=A0=A0=A0=A0=A0=A0 (error "Abort")))
=A0=A0=A0=A0 (if (file= -directory-p file)
=A0=A0=A0=A0=A0=A0=A0 (error "This is a director= y path, not a file"))
-=A0=A0=A0 (if (equal (file-truename file)-=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (file-truename (buffer-file-name)= ))
+=A0=A0=A0 (if (and (buffer-file-name)
+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0 (equal (file-truename file)
+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0 (file-truename (buffer-file-name))))
=A0=A0=A0=A0=A0=A0= =A0 (error "Please specify a file name that is different from current&= quot;))
=A0=A0=A0=A0 (unless format
=A0=A0=A0=A0=A0=A0 (setq deffmt-readable org= -table-export-default-format)

--0016e64c23dcff1a9c047035d48e-- --===============2116065735== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --===============2116065735==--