Browse Source

Fix file name for source export

Hsiu-Khuern writes:

> Hi all,
>
> The footnote at the bottom of section 13.1.4 ("Publishing
> action") of the Org manual says that publishing org files to
> the same directory using org-publish-org-to-org results in
> files named like file-source.org.  It actually results in
> file.org-source, which is not as nice.  I believe the
> problem is in the org-export-as-org function in org-exp.el.
Carsten Dominik 15 years ago
parent
commit
7151414aeb
2 changed files with 6 additions and 1 deletions
  1. 3 0
      lisp/ChangeLog
  2. 3 1
      lisp/org-exp.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2009-08-01  Carsten Dominik  <carsten.dominik@gmail.com>
 2009-08-01  Carsten Dominik  <carsten.dominik@gmail.com>
 
 
+	* org-exp.el (org-export-as-org): Insert the "-source" string
+	before the extension.
+
 	* org.el (org-read-date): Make sure the calendar is in the current
 	* org.el (org-read-date): Make sure the calendar is in the current
 	frame.
 	frame.
 	(org-set-emph-re): Remove the ? from the post-match.
 	(org-set-emph-re): Remove the ? from the post-match.

+ 3 - 1
lisp/org-exp.el

@@ -2509,7 +2509,9 @@ directory."
 	 (filename (and filename
 	 (filename (and filename
 			(if (equal (file-truename filename)
 			(if (equal (file-truename filename)
 				   (file-truename bfname))
 				   (file-truename bfname))
-			    (concat filename "-source")
+			    (concat (file-name-sans-extension filename)
+				    "-source."
+				    (file-name-extension filename))
 			  filename)))
 			  filename)))
 	 (backup-inhibited t)
 	 (backup-inhibited t)
 	 (buffer (find-file-noselect filename))
 	 (buffer (find-file-noselect filename))