emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] ob-tangle.el: Fix error in org-tangle from org-src edit buffer
@ 2021-09-11  7:05 Mark Dawson
  2021-09-19 12:57 ` Timothy
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Dawson @ 2021-09-11  7:05 UTC (permalink / raw)
  To: emacs-orgmode

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

[PATCH] ob-tangle.el: Fix error in org-tangle from org-src edit
 buffer

(org-babel-tangle) : Fix stringp error which happens when confirming
successful tangle when `org-babel-tangle` is called from an org-src edit
buffer.

TINYCHANGE
---
 lisp/ob-tangle.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el
index 2f60ef9a4..0768c8588 100644
--- a/lisp/ob-tangle.el
+++ b/lisp/ob-tangle.el
@@ -281,7 +281,10 @@ matching a regular expression."
  (if (= block-counter 1) "" "s")
  (file-name-nondirectory
   (buffer-file-name
-   (or (buffer-base-buffer) (current-buffer)))))
+   (or (buffer-base-buffer)
+                       (current-buffer)
+                       (and (org-src-edit-buffer-p)
+                            (org-src-source-buffer))))))
  ;; run `org-babel-post-tangle-hook' in all tangled files
  (when org-babel-post-tangle-hook
   (mapc
-- 
2.30.1

[-- Attachment #2: Type: text/html, Size: 1139 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ob-tangle.el: Fix error in org-tangle from org-src edit buffer
  2021-09-11  7:05 [PATCH] ob-tangle.el: Fix error in org-tangle from org-src edit buffer Mark Dawson
@ 2021-09-19 12:57 ` Timothy
  0 siblings, 0 replies; 2+ messages in thread
From: Timothy @ 2021-09-19 12:57 UTC (permalink / raw)
  To: markgdawson; +Cc: emacs-orgmode


Hi Mark,

Many thanks for not only tracking down this problem but making a fix and
submitting it 🙂. I've just pushed this as 986341b with minor tweaks to the
commit message.

Mark Dawson <markgdawson@gmail.com> writes:

> [PATCH] ob-tangle.el: Fix error in org-tangle from org-src edit
>  buffer
>
> (org-babel-tangle) : Fix stringp error which happens when confirming
> successful tangle when `org-babel-tangle` is called from an org-src edit
> buffer.
>
> TINYCHANGE
> ---
>  lisp/ob-tangle.el | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el
> index 2f60ef9a4..0768c8588 100644
> --- a/lisp/ob-tangle.el
> +++ b/lisp/ob-tangle.el
> @@ -281,7 +281,10 @@ matching a regular expression."
>   (if (= block-counter 1) "" "s")
>   (file-name-nondirectory
>    (buffer-file-name
> -   (or (buffer-base-buffer) (current-buffer)))))
> +   (or (buffer-base-buffer)
> +                       (current-buffer)
> +                       (and (org-src-edit-buffer-p)
> +                            (org-src-source-buffer))))))
>   ;; run `org-babel-post-tangle-hook' in all tangled files
>   (when org-babel-post-tangle-hook
>    (mapc

--
Timothy


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-19 12:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-11  7:05 [PATCH] ob-tangle.el: Fix error in org-tangle from org-src edit buffer Mark Dawson
2021-09-19 12:57 ` Timothy

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).