From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id uJ+HFjiLUF9gCwAA0tVLHw (envelope-from ) for ; Thu, 03 Sep 2020 06:20:40 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id MC6FEjiLUF9QPgAAbx9fmQ (envelope-from ) for ; Thu, 03 Sep 2020 06:20:40 +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 72FC59404CF for ; Thu, 3 Sep 2020 06:20:39 +0000 (UTC) Received: from localhost ([::1]:52380 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDibs-0005Gd-E7 for larch@yhetil.org; Thu, 03 Sep 2020 02:20:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56488) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDibD-0005GQ-PN for emacs-orgmode@gnu.org; Thu, 03 Sep 2020 02:19:55 -0400 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]:36297) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDibC-0002U7-2H for emacs-orgmode@gnu.org; Thu, 03 Sep 2020 02:19:55 -0400 Received: by mail-pg1-x52b.google.com with SMTP id p37so1276470pgl.3 for ; Wed, 02 Sep 2020 23:19:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version; bh=hRmKxBs1qswmytkCmaHOuOM+UnnKqJNlVUbcWkJ6iFw=; b=Ty3ndcCFoorvcZdnTPVXJ4gc+sxaT+Ko5gcypWS6+OBevGr4dgWvy6GkQCYpcUoyMH oNEO3LtGlFmlY1jHxA9+2t2B89+KqS4wGsQUlZRT+5prhykGlthtzgXJ6hvjX8esNKID U1qZM/bbTDcE0/s67gc0TOJFPZmQXLACT/C+9SIk7e3MHYsQm/dANB6Su468HB7SChY1 m9gSRmWukSexRDBpu1X+k/wiacKef42JgKDWeNeFFdNNyjaXE2Z762qobV4V1D+eH5wP x1epKHmccFoMnOL53HLWOl6t2w9QkZNmKZemb4MlS1t1KWsaeSKs6jgQogKgXCySfxjy SZgw== 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:date:message-id:mime-version; bh=hRmKxBs1qswmytkCmaHOuOM+UnnKqJNlVUbcWkJ6iFw=; b=XNmJYOu4QKA5vT7+Ri5fvmFD9FJoZdq7DC3el6awHztdlSZYTFSPLr2D+1ZK9An51x NFisQI66HI8XY9btbSpmVzxIA34vDSsriptsydqIDrwB0CVImKdkhFqkuxuH580q2L32 YPML2sl6mL8hExpuej2P65c1z0X+NljalXFi3afFrblEXGJr5abREJZH8z3t+J9xyxtN O7nGhHWKpapuQF5lZXwSKrF80JBT6Cqq1YrtYQc6/3a30fMIaKlDB7Z8Eb1uKd20ZZ7E Tlx0Ppp3fWsUmWAPgSCTu+Rt5wOSx4ZueVSqmMguOtDmNRqnLl1bRcwTBB3wip5CBZTJ g2HQ== X-Gm-Message-State: AOAM533acICPGllbuDYt+U+0rGg1xDY3399/YgMYNu4KvFJZ1cMTdkgw tDtT34nV93ZImk+wa4I6+TmoVST7HRf8AQ== X-Google-Smtp-Source: ABdhPJyiWnJCNQBYoV3gCodWPyGqU7QL4dJ1t7fN2Pm9/S+XrEPw6q1GZnpgxPrG/uvilBszFmQefw== X-Received: by 2002:aa7:9f41:0:b029:137:ceb9:7553 with SMTP id h1-20020aa79f410000b0290137ceb97553mr704848pfr.3.1599113991990; Wed, 02 Sep 2020 23:19:51 -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 n67sm1260584pgn.14.2020.09.02.23.19.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2020 23:19:51 -0700 (PDT) From: Matt Huszagh To: "emacs-orgmode@gnu.org" Cc: Subject: [PATCH] Omit file description when :file-desc has nil value Date: Wed, 02 Sep 2020 23:19:49 -0700 Message-ID: <87sgbzl6uy.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::52b; envelope-from=huszaghmatt@gmail.com; helo=mail-pg1-x52b.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=Ty3ndcCF; 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: +py5gfgNcngh --=-=-= Content-Type: text/plain Hello, This patch omits a file description when :file-desc has a nil value. Previously, the following src block #+BEGIN_SRC asymptote :results value file :file circle.pdf :file-desc :output-dir img/ size(2cm); draw(unitcircle); #+END_SRC would yield #+RESULTS: [[file:img/circle.pdf][circle.pdf]] This makes it impossible (I think) to provide :file-desc with a default value and prevent the description in some cases. This patch would cause the same code block to execute to #+RESULTS: [[file:img/circle.pdf]] I feel I may be missing something in regard to why this previously had the functionality it did. Is there a use case I've missed? To me, the documentation seems to indicate that my patch is the desired behavior: The =file-desc= header argument defines the description (see [[*Link Format]]) for the link. If =file-desc= has no value, the "description" part of the link will be omitted. Full disclaimer: I wrote this section of the documentation as part of this patch: https://lists.gnu.org/archive/html/emacs-orgmode/2020-07/msg00320.html Thanks Matt --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-lisp-ob-core.el-Omit-file-description-when-file-desc.patch >From edcfa85add6ac71a1e13b7731779ccf4a8e12868 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. 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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/ob-core.el b/lisp/ob-core.el index 578622232..55165ebc5 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -2257,9 +2257,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 --=-=-=--