From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id sGiSCRaTUF9LGQAA0tVLHw (envelope-from ) for ; Thu, 03 Sep 2020 06:54:14 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id kHZxBRaTUF8PcgAA1q6Kng (envelope-from ) for ; Thu, 03 Sep 2020 06:54:14 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 86F2F9403A8 for ; Thu, 3 Sep 2020 06:54:13 +0000 (UTC) Received: from localhost ([::1]:38260 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDj8O-0005c2-Cv for larch@yhetil.org; Thu, 03 Sep 2020 02:54:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33402) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDj7t-0005bt-Um for emacs-orgmode@gnu.org; Thu, 03 Sep 2020 02:53:41 -0400 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]:46438) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDj7r-0006DP-8P for emacs-orgmode@gnu.org; Thu, 03 Sep 2020 02:53:41 -0400 Received: by mail-pg1-x542.google.com with SMTP id 31so1318331pgy.13 for ; Wed, 02 Sep 2020 23:53:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=gDZ0oZLFKTdyuISU4+kpypTdxCAmpxG/8405GYK5smE=; b=YjJ7tUgIRIEE+KujSL4go6QOwOFoDM6mvMamQnK2tVnyHX990U5kSkS/275bUKTOHg Ls+jZDDhbINkyF4xUFVKn2qP6AQ7J4x8CsANZ2ag9pka2lhorWqVOH2zSPfbmL9k+OQi +LIAPfOyf0eQQngdOxWBo6LwGsbDKeSBP3uASCdQW62U2hBrSjSCeGX2t4PfhhaN/pqP TN7GyqqAuiIrgMWWMKorFKTttpakU8QWRIreRQ3vc8iOpH5D/mepkfRzvJzq75ZRIZCW +TC5l11y7Wo1dOV8WLCZ3HuM8ix9sLPuscAKGKaZES310FBviYTmJZ7GF0i+ZBmf+vX5 hqGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=gDZ0oZLFKTdyuISU4+kpypTdxCAmpxG/8405GYK5smE=; b=KXwVy8NQlocfBmLYcj86w5qyLcmCwML8YfQIvbCkIejbgHsZPwj40wrgWHzltg7aec rnnATSYom63pqS97Pe3EjnTyF3G229p5+cC/Lgc610/aMS4p9kUZDKt/0i18GkLkjTGy BdB//ZY1AqaWG0iyKduMRLybnc4RXrAz9gIAku9SrKSXT+BcEMeU5lEMOoPaiww9Cew/ llsNLYggLu2Ytnf+oO6nMzkqjrH3K/IRzaJGuogLAfx/UjaTn0YqwYeCOIh9QWSqJR+r N75gkfcZsU91A8YmU8zMm8rnPKR7ZvPjdBQXict9jgQH7Ko9KAWyVV589xql5TaZbRcj 72Rg== X-Gm-Message-State: AOAM531iQ47JVlDOR+tUX8Zr0oXcKwf6R5gXEkoySf5lxDhBq2i/oieH IRC8pQ3cuAm9By0QCXSlImIJB2NN38K24Q== X-Google-Smtp-Source: ABdhPJyGym9FbwjLU372aqJzclwHhGlPkkrQZIiqaugOZ23301ewStVQkn4Wght4eJVmC8XOAsVlVA== X-Received: by 2002:a17:902:7d8e:: with SMTP id a14mr2326715plm.89.1599116016930; Wed, 02 Sep 2020 23:53:36 -0700 (PDT) Received: from ryzen3950 (c-73-71-89-135.hsd1.ca.comcast.net. [73.71.89.135]) by smtp.gmail.com with ESMTPSA id a5sm1797953pfb.26.2020.09.02.23.53.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2020 23:53:36 -0700 (PDT) From: Matt Huszagh To: "emacs-orgmode@gnu.org" Cc: Subject: Re: [PATCH] Omit file description when :file-desc has nil value In-Reply-To: <87sgbzl6uy.fsf@gmail.com> References: <87sgbzl6uy.fsf@gmail.com> Date: Wed, 02 Sep 2020 23:53:31 -0700 Message-ID: <87imcv5p1w.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::542; envelope-from=huszaghmatt@gmail.com; helo=mail-pg1-x542.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=YjJ7tUgI; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -1.71 X-TUID: GXoSju1sUSSB --=-=-= Content-Type: text/plain Matt Huszagh 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 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-lisp-ob-core.el-Omit-file-description-when-file-desc.patch >From 24d156e421973b5a97f1c797d48f1daa95348898 Mon Sep 17 00:00:00 2001 From: Matt Huszagh 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 --=-=-=--