emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Darlan Cavalcante Moreira <darcamo@gmail.com>
To: Orgmode Mailing List <emacs-orgmode@gnu.org>
Subject: [PATCH] org-preview-latex-fragment in indirect buffers
Date: Thu, 28 Apr 2011 21:46:42 -0300	[thread overview]
Message-ID: <4dba0a77.4bb7ec0a.32f5.60c2@mx.google.com> (raw)


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	other threads:[~2011-04-29  0:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-29  0:46 Darlan Cavalcante Moreira [this message]
2011-05-10 21:19 ` [PATCH] org-preview-latex-fragment in indirect buffers Darlan Cavalcante Moreira
2011-05-13 12:45   ` [Accepted] " Carsten Dominik

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=4dba0a77.4bb7ec0a.32f5.60c2@mx.google.com \
    --to=darcamo@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).