Re: [O] [PATCH] org-store-link: Fixed a bug where source block edit buffers were not recognized
At Wed, 14 Mar 2012 15:37:20 +, Shaun Johnson wrote: > > On 08/03/2012 22:33, Ilya Shlyakhter wrote: > > attached. > > Having just run into this same problem (being unable to create > and store a code reference link using C-l in a source block edit > buffer) I would like to second the inclusion of this or an > equivalent patch. Ilya's patch can be seen on the patchwork server > at: > http://patchwork.newartisans.com/patch/1209/ > > I am currently using the following patch to work around this > problem: http://patchwork.newartisans.com/patch/1209/ was recently accepted -- This problem should be fixed now. Best, -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. dm...@ictsoc.de pgp4BfyuVPw1B.pgp Description: OpenPGP Digital Signature
Re: [O] [PATCH] org-store-link: Fixed a bug where source block edit buffers were not recognized
Hi Ilya, Ilya Shlyakhter writes: > attached. Applied, thanks a lot. -- Bastien
Re: [O] [PATCH] org-store-link: Fixed a bug where source block edit buffers were not recognized
On 08/03/2012 22:33, Ilya Shlyakhter wrote: attached. Having just run into this same problem (being unable to create and store a code reference link using C-l in a source block edit buffer) I would like to second the inclusion of this or an equivalent patch. Ilya's patch can be seen on the patchwork server at: http://patchwork.newartisans.com/patch/1209/ I am currently using the following patch to work around this problem: diff --git a/lisp/org.el b/lisp/org.el index ad63213..4a97cc9 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -8684,7 +8684,7 @@ For file links, arg negates `org-context-in-file-links'." (setq link (plist-get org-store-link-plist :link) desc (or (plist-get org-store-link-plist :description) link))) - ((equal (buffer-name) "*Org Edit Src Example*") + ((org-bound-and-true-p org-edit-src-from-org-mode) (let (label gc) (while (or (not label) (save-excursion Shaun Johnson.
[O] [PATCH] org-store-link: Fixed a bug where source block edit buffers were not recognized
attached. >From 134c2ba772081ee7ca356b0dcabeb131bcb41b3b Mon Sep 17 00:00:00 2001 From: Ilya Shlyakhter Date: Thu, 8 Mar 2012 17:25:18 -0500 Subject: [PATCH 2/2] org-store-link: Fixed a bug where source block edit buffers were not recognized * lisp/org.el (org-store-link): Use a new predicate from org-src.el to test whether we're in a source block edit buffer. * lisp/org-src.el (org-src-edit-buffer-p): New predicate to tell if we're in a source block edit buffer. TINYCHANGE --- lisp/org-src.el |9 + lisp/org.el |2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lisp/org-src.el b/lisp/org-src.el index 9cd56d2..e08fe89 100644 --- a/lisp/org-src.el +++ b/lisp/org-src.el @@ -374,6 +374,15 @@ buffer." "Construct the buffer name for a source editing buffer." (concat "*Org Src " org-buffer-name "[ " lang " ]*")) +(defun org-src-edit-buffer-p (&optional buffer) + "Test whether BUFFER (or the current buffer if BUFFER is nil) +is a source block editing buffer." + (let ((buffer (org-base-buffer (or buffer (current-buffer) +(and (buffer-name buffer) +(string-match "\\`*Org Src " (buffer-name buffer)) +(local-variable-p 'org-edit-src-beg-marker buffer) +(local-variable-p 'org-edit-src-end-marker buffer + (defun org-edit-src-find-buffer (beg end) "Find a source editing buffer that is already editing the region BEG to END." (catch 'exit diff --git a/lisp/org.el b/lisp/org.el index e4fb497..6074a01 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -8684,7 +8684,7 @@ For file links, arg negates `org-context-in-file-links'." (setq link (plist-get org-store-link-plist :link) desc (or (plist-get org-store-link-plist :description) link))) - ((equal (buffer-name) "*Org Edit Src Example*") + ((org-src-edit-buffer-p) (let (label gc) (while (or (not label) (save-excursion -- 1.7.9.3