emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Vincent Beffara <vbeffara+ml@gmail.com>
To: Org Mode List <emacs-orgmode@gnu.org>
Subject: Re: Problem with org-html-format-latex
Date: Thu, 7 Feb 2013 17:26:16 +0100	[thread overview]
Message-ID: <BBBB9CACB86845A4B6AD6EC435961A18@gmail.com> (raw)
In-Reply-To: <20E4E4D8E34D465D9CF893C7EE0BBEFC@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 421 bytes --]

Hi again, 
> A bug occurs with org-html-format-latex (in ox-html.el) when called from a non-file buffer. In the context of o-blog, it gets called as (org-html-format-latex "$x$" 'mathjax) but still tries to bind some ltxpng related support. This ends up calling file-name-sans-extension to the output of (file-name-nondirectory (buffer-file-name)) which is nil ...

Cleaner patch uses ignore-errors, that's simpler...

/v

[-- Attachment #2: 0001-Fix-the-non-file-buffer-bug.patch --]
[-- Type: application/octet-stream, Size: 1032 bytes --]

From 5378851c8bbdac5b3932aa8857b5b2878b31f2d3 Mon Sep 17 00:00:00 2001
From: Vincent Beffara <vbeffara@ens-lyon.fr>
Date: Thu, 7 Feb 2013 17:22:38 +0100
Subject: [PATCH] Fix the non-file-buffer bug

---
 lisp/ox-html.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index f4fc27b..67b5880 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -1992,10 +1992,10 @@ CONTENTS is nil.  INFO is a plist holding contextual information."
 ;;;; Latex Environment
 
 (defun org-html-format-latex (latex-frag processing-type)
-  (let* ((cache-relpath
+  (let* ((cache-relpath (ignore-errors
 	  (concat "ltxpng/" (file-name-sans-extension
-			     (file-name-nondirectory (buffer-file-name)))))
-	 (cache-dir (file-name-directory (buffer-file-name )))
+			     (file-name-nondirectory (buffer-file-name))))))
+	 (cache-dir (ignore-errors (file-name-directory (buffer-file-name ))))
 	 (display-msg "Creating LaTeX Image..."))
 
     (with-temp-buffer
-- 
1.7.12.4 (Apple Git-37)


  reply	other threads:[~2013-02-07 16:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-07 15:44 Problem with org-html-format-latex Vincent Beffara
2013-02-07 16:26 ` Vincent Beffara [this message]
2013-02-08 18:49   ` Bastien
2013-02-10 23:28     ` Vincent Beffara
2013-02-10 23:43       ` Vincent Beffara
2013-02-11 15:12         ` Bastien
2013-02-11 21:44           ` Vincent Beffara
2013-02-12  7:39             ` Bastien
2013-02-12 20:26               ` Vincent Beffara

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=BBBB9CACB86845A4B6AD6EC435961A18@gmail.com \
    --to=vbeffara+ml@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).