From: Matt Huszagh <huszaghmatt@gmail.com>
To: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: [PATCH] Omit file description when :file-desc has nil value
Date: Wed, 02 Sep 2020 23:53:31 -0700 [thread overview]
Message-ID: <87imcv5p1w.fsf@gmail.com> (raw)
In-Reply-To: <87sgbzl6uy.fsf@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 207 bytes --]
Matt Huszagh <huszaghmatt@gmail.com> writes:
> This patch omits a file description when :file-desc has a nil
> value.
I've modified the patch to yield the same effect when executing a source
block.
Matt
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-lisp-ob-core.el-Omit-file-description-when-file-desc.patch --]
[-- Type: text/x-patch, Size: 1771 bytes --]
From 24d156e421973b5a97f1c797d48f1daa95348898 Mon Sep 17 00:00:00 2001
From: Matt Huszagh <huszaghmatt@gmail.com>
Date: Wed, 2 Sep 2020 23:06:10 -0700
Subject: [PATCH] lisp/ob-core.el: Omit file description when :file-desc has
nil value
* lisp/ob-core.el (org-babel-insert-result): Omit file description
when :file-desc value evaluates to nil.
(org-babel-execute-src-block): Perform the same functionality when
executing a src block.
The previous implementation makes it impossible to provide a default
:file-desc and in some cases override it to omit the description.
---
lisp/ob-core.el | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index 578622232..02c0a153c 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -750,7 +750,8 @@ block."
(org-babel-result-to-file
file
(let ((desc (assq :file-desc params)))
- (and desc (or (cdr desc) result)))))))
+ (and (and desc (cdr desc))
+ (cdr desc)))))))
(setq result (org-babel-ref-resolve post))
(when file
(setq result-params (remove "file" result-params))))))
@@ -2257,9 +2258,9 @@ INFO may provide the values of these header arguments (in the
(setq result (org-no-properties result))
(when (member "file" result-params)
(setq result (org-babel-result-to-file
- result (when (assq :file-desc (nth 2 info))
- (or (cdr (assq :file-desc (nth 2 info)))
- result))))))
+ result (when (and (assq :file-desc (nth 2 info))
+ (cdr (assq :file-desc (nth 2 info))))
+ (cdr (assq :file-desc (nth 2 info))))))))
((listp result))
(t (setq result (format "%S" result))))
(if (and result-params (member "silent" result-params))
--
2.28.0
next prev parent reply other threads:[~2020-09-03 6:54 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-03 6:19 [PATCH] Omit file description when :file-desc has nil value Matt Huszagh
2020-09-03 6:53 ` Matt Huszagh [this message]
2020-09-04 5:21 ` Kyle Meyer
2020-09-05 19:19 Huszaghmatt
2020-09-06 4:19 ` Kyle Meyer
2020-09-09 19:50 ` Matt Huszagh
2020-09-15 17:09 ` Matt Huszagh
2020-09-24 5:23 ` Kyle Meyer
2020-09-24 6:16 ` Matt Huszagh
2020-09-24 23:07 ` Kyle Meyer
2020-09-29 21:33 ` Matt Huszagh
2020-10-03 6:08 ` Kyle Meyer
2020-10-06 13:17 ` Matt Huszagh
2020-10-07 3:19 ` Kyle Meyer
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=87imcv5p1w.fsf@gmail.com \
--to=huszaghmatt@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).