emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [PATCH] org-preview-latex-fragment in indirect buffers


From: Darlan Cavalcante Moreira
Subject: [O] [PATCH] org-preview-latex-fragment in indirect buffers
Date: Thu, 28 Apr 2011 21:46:42 -0300
User-agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/24.0 Mule/6.0 (HANACHIRUSATO)

Hello,

I frequently use indirect buffers with org but org-preview-latex-fragment
does not work when in an indirect buffer. The reason is that
org-preview-latex-fragment uses "buffer-file-name" to get the name of the
file associated with the current buffer, but this is nil for indirect
buffers.

To solve this, all its necessary is to define the function below

--8<---------------cut here---------------start------------->8---
(defun org-buffer-file-name ()
  "Similar to buffer-file-name, but also work on indirect buffers."
  (buffer-file-name (buffer-base-buffer))
  )
--8<---------------cut here---------------end--------------->8---

and replace "buffer-file-name" in the org-preview-latex-fragment by
"(org-buffer-file-name)". This works in both: "normal" buffers and indirect
buffers.

--
Darlan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]