From mboxrd@z Thu Jan 1 00:00:00 1970 From: Evgeny Boykov Subject: [PATCH] Date: Thu, 14 Jul 2011 01:13:08 +1100 Message-ID: <877h7m2rrf.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:36448) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qh0Br-0005Zd-EW for emacs-orgmode@gnu.org; Wed, 13 Jul 2011 10:13:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qh0Bj-0001pf-CR for emacs-orgmode@gnu.org; Wed, 13 Jul 2011 10:13:27 -0400 Received: from mail-bw0-f41.google.com ([209.85.214.41]:45822) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qh0Bi-0001ol-9L for emacs-orgmode@gnu.org; Wed, 13 Jul 2011 10:13:19 -0400 Received: by bwd14 with SMTP id 14so3025280bwd.0 for ; Wed, 13 Jul 2011 07:13:16 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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:=20 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/ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Solution: All 'cmds' must be called in 'lbuf', but not in filename.org's buffer conte= xt. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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 dir= ectory." (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)) __________________________ =D0=A1 =D1=83=D0=B2=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D0=B5=D0=BC, =D0=91=D0=BE=D0=B9=D0=BA=D0=BE=D0=B2 =D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8= =D0=B9 =D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B5=D0=B2=D0=B8=D1=87 =D1=81=D0=BE=D1=82. 8-924-202-25-65 e-mail: artscan@list.ru