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>, darcamo@gmail.com
Subject: Re: [PATCH] org-preview-latex-fragment in indirect buffers
Date: Tue, 10 May 2011 18:19:29 -0300	[thread overview]
Message-ID: <4dc9abe5.61adec0a.2a56.0767@mx.google.com> (raw)
In-Reply-To: <4dba0a77.4bb7ec0a.32f5.60c2@mx.google.com>

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


This is a rather small change in org.el. Since I didn't get a response
(even rejected) I suspect this is because I didn't attached a proper patch
so that the patchwork server can get it.

The patch is attached now.

--
Darlan


[-- Attachment #2: org.el.diff --]
[-- Type: text/plain, Size: 1020 bytes --]

diff --git a/lisp/org.el b/lisp/org.el
index acbb261..eb95efa 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -16151,6 +16151,11 @@ Revert to the normal definition outside of these fragments."
   (mapc 'delete-overlay org-latex-fragment-image-overlays)
   (setq org-latex-fragment-image-overlays nil))
 
+(defun org-buffer-file-name ()
+  "Similar to buffer-file-name, but also works on indirect buffers."
+  (buffer-file-name (buffer-base-buffer))
+  )
+
 (defun org-preview-latex-fragment (&optional subtree)
   "Preview the LaTeX fragment at point, or all locally or globally.
 If the cursor is in a LaTeX fragment, create the image and overlay
@@ -16189,7 +16194,7 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]."
 	(org-format-latex
 	 (concat "ltxpng/" (file-name-sans-extension
 			    (file-name-nondirectory
-			     buffer-file-name)))
+			     (org-buffer-file-name))))
 	 default-directory 'overlays msg at 'forbuffer 'dvipng)
       (message msg "done.  Use `C-c C-c' to remove images.")))))
 

  reply	other threads:[~2011-05-10 21:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-29  0:46 [PATCH] org-preview-latex-fragment in indirect buffers Darlan Cavalcante Moreira
2011-05-10 21:19 ` Darlan Cavalcante Moreira [this message]
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=4dc9abe5.61adec0a.2a56.0767@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).