emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Patch for org-table-export
@ 2009-08-03  5:13 Gregory Grubbs
  2009-08-03  5:42 ` Carsten Dominik
  0 siblings, 1 reply; 2+ messages in thread
From: Gregory Grubbs @ 2009-08-03  5:13 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 943 bytes --]

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)

[-- Attachment #1.2: Type: text/html, Size: 1057 bytes --]

[-- Attachment #2: Type: text/plain, Size: 204 bytes --]

_______________________________________________
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 related	[flat|nested] 2+ messages in thread

* Re: Patch for org-table-export
  2009-08-03  5:13 Patch for org-table-export Gregory Grubbs
@ 2009-08-03  5:42 ` Carsten Dominik
  0 siblings, 0 replies; 2+ messages in thread
From: Carsten Dominik @ 2009-08-03  5:42 UTC (permalink / raw)
  To: Gregory Grubbs; +Cc: emacs-orgmode

Applied, thanks.

- Carsten

On Aug 3, 2009, at 7:13 AM, Gregory Grubbs wrote:

> 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)
>
> _______________________________________________
> 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-08-03  5:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-03  5:13 Patch for org-table-export Gregory Grubbs
2009-08-03  5:42 ` 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).