emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Evgeny Boykov <eugeniy.boykov@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [PATCH]
Date: Thu, 14 Jul 2011 01:13:08 +1100	[thread overview]
Message-ID: <877h7m2rrf.fsf@gmail.com> (raw)


===========================================================================

I want org-publish-current-file ~/git/org/filename.org in ~/pub/org/

Some setup:

(setq org-publish-project-alist
...
         :base-directory "~/git/org"
         :publishing-directory "~/pub/org"
         :publishing-function org-publish-org-to-pdf
...

or just

(org-export-as-pdf 3 nil nil "*Org LaTeX Export*" nil "~/pub/org")

Before patch, incorrectly: 

all pdf-creating files: filename.aux, filename.out, etc,
apart from filename.tex, are here:
../base-directory/

After patch, correctly:

all pdf-creating files are here:
../publishing-directory/

======================================================================

Solution:

All 'cmds' must be called in 'lbuf', but not in filename.org's buffer context.

======================================================================


diff --git a/lisp/org-latex.el b/lisp/org-latex.el
index 1d6e042..5270943 100644
--- a/lisp/org-latex.el
+++ b/lisp/org-latex.el
@@ -1043,26 +1043,28 @@ when PUB-DIR is set, use this as the publishing directory."
     (with-current-buffer outbuf (erase-buffer))
     (message (concat "Processing LaTeX file " file "..."))
     (setq output-dir (file-name-directory file))
-    (if (and cmds (symbolp cmds))
-	(funcall cmds (shell-quote-argument file))
-      (while cmds
-	(setq cmd (pop cmds))
-	(while (string-match "%b" cmd)
-	  (setq cmd (replace-match
-		     (save-match-data
-		       (shell-quote-argument base))
-		     t t cmd)))
-	(while (string-match "%f" cmd)
-	  (setq cmd (replace-match
-		     (save-match-data
-		       (shell-quote-argument file))
-		     t t cmd)))
-	(while (string-match "%o" cmd)
-	  (setq cmd (replace-match
-		     (save-match-data
-		       (shell-quote-argument output-dir))
-		     t t cmd)))
-	(shell-command cmd outbuf)))
+    (with-current-buffer lbuf
+      (save-excursion
+	(if (and cmds (symbolp cmds))
+	    (funcall cmds (shell-quote-argument file))
+	  (while cmds
+	    (setq cmd (pop cmds))
+	    (while (string-match "%b" cmd)
+	      (setq cmd (replace-match
+			 (save-match-data
+			   (shell-quote-argument base))
+			 t t cmd)))
+	    (while (string-match "%f" cmd)
+	      (setq cmd (replace-match
+			 (save-match-data
+			   (shell-quote-argument file))
+			 t t cmd)))
+	    (while (string-match "%o" cmd)
+	      (setq cmd (replace-match
+			 (save-match-data
+			   (shell-quote-argument output-dir))
+			 t t cmd)))
+	    (shell-command cmd outbuf)))))
     (message (concat "Processing LaTeX file " file "...done"))
     (setq errors (org-export-latex-get-error outbuf))
     (if (not (file-exists-p pdffile))

__________________________

С уважением,
Бойков Евгений Алексеевич
сот. 8-924-202-25-65
e-mail: artscan@list.ru

             reply	other threads:[~2011-07-13 14:13 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-13 14:13 Evgeny Boykov [this message]
2011-07-16 17:10 ` [PATCH] Bastien
2021-01-20 10:46 [PATCH] TEC
2021-04-28  3:38 ` [PATCH] Bastien
2021-04-28  3:53   ` [PATCH] Timothy
2021-04-28  6:36     ` [PATCH] Bastien
2021-04-28  6:33 ` [PATCH] Bastien
2021-09-26 11:51 [PATCH] Timothy
2021-09-26 12:01 ` [PATCH] Timothy
2021-09-26 12:14 ` [PATCH] Timothy
2021-09-27  8:19   ` [PATCH] Bastien
2021-09-27 10:35     ` [PATCH] Timothy
2021-09-27 11:45       ` [PATCH] Bastien
2021-09-27 12:20         ` [PATCH] Timothy
2021-09-27 12:31           ` [PATCH] Bastien
2021-09-27 15:26           ` [PATCH] Bastien
2021-09-27 15:36             ` [PATCH] Timothy
2021-09-27 17:44               ` [PATCH] Bastien
2021-09-27 17:52                 ` [PATCH] Timothy
2021-09-27 19:45                   ` [PATCH] Bastien
2021-09-28 15:31                     ` [PATCH] Bastien Guerry
2021-09-28 15:50                       ` [PATCH] Timothy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877h7m2rrf.fsf@gmail.com \
    --to=eugeniy.boykov@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: [PATCH]' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this 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).