From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id wAiOA8xUMmNzQAEAbAwnHQ (envelope-from ) for ; Tue, 27 Sep 2022 03:41:32 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 0JSSA8xUMmNaIgEAauVa8A (envelope-from ) for ; Tue, 27 Sep 2022 03:41:32 +0200 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 BBDE5E3B9 for ; Tue, 27 Sep 2022 03:41:31 +0200 (CEST) Received: from localhost ([::1]:54382 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oczbG-0001xa-0O for larch@yhetil.org; Mon, 26 Sep 2022 21:41:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49500) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oczZx-0001xO-AW for emacs-orgmode@gnu.org; Mon, 26 Sep 2022 21:40:09 -0400 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]:36666) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oczZi-0005G6-42 for emacs-orgmode@gnu.org; Mon, 26 Sep 2022 21:40:04 -0400 Received: by mail-pg1-x52e.google.com with SMTP id s206so8115277pgs.3 for ; Mon, 26 Sep 2022 18:39:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date; bh=i4fODCJp7rV9wH9q4AtW53L69N2jN/U/I8jyIzmdRrQ=; b=DWHLRSiE3/zrWKH63vegpgE3rUt0yP7yoVf7NVgEqx4sTGyovFj0qdAX9T+HUy3my+ 4U4piq7V2lYAiHmy+cRzMe9+vR6WeULv7cMmGtnM/zEBqtsIuuPtk0CNc2MrdTst7gaJ wf4cPL94iZOjjJZUyAeCatDaWBOlDKLlcu9GB0+76QZsqq27CJfnwfbiFA/6wZzLIFJe LJbaOIYwf0MwQmCX3tZeEy1uPaiA3iusHiLHPEQr6Bv4Rkwzom+wGfzeH8LDxT7cDg34 A+IFvYh7HtdE+AfadigvEQ103FGRd0hn5OasuIqktPila1gM9pd7amdfJfV/huqR8uI1 GZ0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date; bh=i4fODCJp7rV9wH9q4AtW53L69N2jN/U/I8jyIzmdRrQ=; b=YsiG8EbH2cYkYwS7rZHgpqbMBtMmDse0AFkfYlmX3EYgYbePJTTiM9v9wsxAvW7Ldt VYLOoOAAe/4vEj8ZBBNSg/ScjAsPeBbZhNpW1Gu0p4uv7sUUXyxjD+xWLx/XdZmN4rKC xmMk+5vasaKE+h/fiQ/Uv6b88UElqpHNn/bEN22etBeA822EN4yVUMibF2PaNYaktQFZ Gad+PaxBBU8z6LoiH8sW6NGFkcq+cgw6dmzwqaRwem9T8DNW12cBtGRWqIxIAgvaT+h1 VMrTZwMVgPaNodkOzjR1yVCf9LpLi+FpMKHseMCYuErqKdOximGXsEnWvMfakaoWm6x+ kzWw== X-Gm-Message-State: ACrzQf3dZmI5RhIUBf3rzWuq2VbgoUN52VeXkiVoqimbcnmoe1mpTa1L +qB0aki+bfkurzj44pQnBPw= X-Google-Smtp-Source: AMsMyM4tWUPh5gudCdy2O944O0/SWa2TnD2B/sCU+MrwVIXA6MFDqOXmCZeJHLFyRk6/NHHcTRGAOQ== X-Received: by 2002:aa7:8a49:0:b0:53e:6a9c:9a04 with SMTP id n9-20020aa78a49000000b0053e6a9c9a04mr27165493pfa.85.1664242792543; Mon, 26 Sep 2022 18:39:52 -0700 (PDT) Received: from localhost ([115.154.175.57]) by smtp.gmail.com with ESMTPSA id mn12-20020a17090b188c00b00205d8d4f870sm111269pjb.41.2022.09.26.18.39.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Sep 2022 18:39:51 -0700 (PDT) From: Ihor Radchenko To: Max Nikulin Cc: Magnus Therning , emacs-orgmode@gnu.org Subject: [BUG] org-store-link-functions advertizes that the first non-nil return value is used, but it is not how org-store-link handles it (was: [BUG] org-create-file-search-functions and description [9.5.5 (release_9.5.5 @ /usr/share/emacs/29.0.50/lisp/org/)]) In-Reply-To: References: <878rm7s61r.fsf@therning.org> <87k05qjpwg.fsf@localhost> Date: Tue, 27 Sep 2022 09:40:45 +0800 Message-ID: <87tu4tppb6.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::52e; envelope-from=yantar92@gmail.com; helo=mail-pg1-x52e.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, 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.29 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-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1664242891; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=i4fODCJp7rV9wH9q4AtW53L69N2jN/U/I8jyIzmdRrQ=; b=Xk6kEcZd2/W4x7jETUG5tUR2uzbXmifvf90R+75N2LRfuIRZEib2GGiLrKpJ7gJ2mRDQ6w /SmWH4A5ABKCMbQYqliuEu51XzbIvtAUVghBapjIjbLmkDQnq6VD5dKfHrE/+ERhup30GD VUzChtwO5bLly/pl8ensbbTbinZM//ykT2cfUa2Tv+OY5bIdXki53sUf++d+KdP7pxzCo6 eL38fBCvjxBcvMMX6EkWjGeiud0MS1zbgQ+sI+92P56/tXmW3aeJFCKfWzwUccfKHOEjLb sh/n2i2zGWjpoWh3FqHYI+JwMdES1Zx8Gtzwms2J8ks6yNU6hAiUjlS8KWDv4w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1664242891; a=rsa-sha256; cv=none; b=EiN8PwSwn25ZFw2SlS1KJMFtuHBFRTMd5xGwFTsWRySvSNeHDPA7eOGvlt8iqAQfApa2Gg XkYZ1HYtvARPlz8qJWhh1aCWVjUT1CRoxTsH2FUdqDCBv2wkLZIejWC4mPE2DCnKYWyNYI l2a7XFJSQ30lSJES8vJ12o3A+9lvq2rA36AJOVkKQfwZ3K9Bmb/GCHJW0fd/NyiXbBLWKP ij1NLVmA5jYJHkEiQaD/ec/UfYTOAYj7K6OANNiwekjMEO0mrcJY+jdx+jOkriDiaefyON 60fQSxNNK1lJzqTX4bRpwy4Zd9KbQaVeUFsvAu5dAORNCr23gK7d5TjOubiG1w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=DWHLRSiE; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 0.06 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=DWHLRSiE; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: BBDE5E3B9 X-Spam-Score: 0.06 X-Migadu-Scanner: scn1.migadu.com X-TUID: j4sp8FJDBwGh Max Nikulin writes: > There is the `org-store-link-plist' variable used by :store functions > from `org-link-parameters' but not by the > `org-create-file-search-functions' hook. Maybe it is enough to add Reading through `org-store-link-functions' docstring and `org-store-link' code, I noticed that `org-store-link-functions' promises the following: Each function will be called in turn until one returns a non-nil value. Yet, `org-store-link' does the following: (dolist (f (org-store-link-functions)) (when (funcall f) (push (cons f (copy-sequence org-store-link-plist)) results-alist))) (pcase results-alist ... ;; Reinstate link plist associated to the chosen ;; function. (apply #'org-link-store-props (cdr (assoc-string (completing-read (format "Store link with (default %s): " name) (mapcar #'car results-alist) nil t nil nil (symbol-name name)) results-alist))) t)) That is, all the store link functions are actually being executed, not until first non-nil return value. If multiple non-nil values are returned, an interactive query is displayed to the user. --- The actual behaviour is indeed nice, but I am wondering how it is going to work in non-interactive case. Thoughts? -- Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92