Bläddra i källkod

Allow export of tables from temporary buffers without a file

Gregory Grubbs writes:

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):
Carsten Dominik 15 år sedan
förälder
incheckning
6062cef1c6
2 ändrade filer med 6 tillägg och 2 borttagningar
  1. 3 0
      lisp/ChangeLog
  2. 3 2
      lisp/org-table.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2009-08-03  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-table.el (org-table-export): Also work in file-less
+	buffers.
+
 	* org.el (org-startup-indented): New option.
 	(org-startup-options): Add new options indent and noindent.
 	(org-unfontify-region): Remove line-prefix and wrap-prefix

+ 3 - 2
lisp/org-table.el

@@ -487,8 +487,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)