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 gN6QKZuJ8F/HBgAA0tVLHw (envelope-from ) for ; Sat, 02 Jan 2021 14:56:27 +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 +OtkJZuJ8F9oWgAA1q6Kng (envelope-from ) for ; Sat, 02 Jan 2021 14:56:27 +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 C38659402A9 for ; Sat, 2 Jan 2021 14:56:26 +0000 (UTC) Received: from localhost ([::1]:47548 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kviKP-00081l-E1 for larch@yhetil.org; Sat, 02 Jan 2021 09:56:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41680) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kviK0-00081e-1O for emacs-orgmode@gnu.org; Sat, 02 Jan 2021 09:56:00 -0500 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]:34222) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kviJx-0000J0-Fj for emacs-orgmode@gnu.org; Sat, 02 Jan 2021 09:55:59 -0500 Received: by mail-pf1-x431.google.com with SMTP id w6so13712609pfu.1 for ; Sat, 02 Jan 2021 06:55:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=andrew-cmu-edu.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=h+z4MBHfKFL25EwV9g1oVG29Su+BVOYrAuWvTdpwSAE=; b=NyonFfgUa1Ipf7OMr3UzMxm4ot9VRGiadGiq/myD9gef/gI2myvg8BbZd9tmd3S5hl amtNnO6i+5Cocn4jQ7UENA1JrSbixgEA7Ep107lkrpVFPfpmS9ZAkROisieRNQHtQ9UX A0zjr2mZ5QZaqpoDvzM9T5/pai5x5krE8YG7yO+YQacsOWrO7EwxXtNj0rGcIIZaLFYg TwfX635o1XCA3Cs1nvX048AIFq8h3X09GtbeX7Mpr6n9ZWHo6cRjd3qwr6J/O2lcfb/W oP/M8cR+gfVsERYNGfrszMbvO8qaVJlXgVtzcN7C0edDJ6w+qVhu7zD7DJezmVEqEx/V /urw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=h+z4MBHfKFL25EwV9g1oVG29Su+BVOYrAuWvTdpwSAE=; b=jWO5I6bGonkRWbc1TctmKmPmtOoXgnFy8f5fe2Wy49a+38G4bai6RyxB5HA5//9Vn4 jVdexyET0OEqnH7bZAkfbhEfnUFaYJEee7zrIV8SYmmnt3WVHgSzwfzNZTZH4anuSJyc 6ovWewAt5AE5OaTQvgzfvBXjiFbtp0DM0S2dtyv3O0hxXji60WCYQRZDd/ZtAl8B4GbV +n16CfXUaXpgqbnP0XNMb+qPz/oWn0q73uFsj0Uh82QG1zYptyJ7N4XKZ9Ce3S4zlonE Rj9/tCz3hl5Ur1TjekSMNHthhiAFqs4yFCrRGaRqJ4bl01f5MjC3fOwiRkWf5kKwGK1/ Xhxw== X-Gm-Message-State: AOAM530qFZX/fjyIObF5N/G4p80gmbXVKiYN8Q9l/cEI6zyoaHY4hb1o NSeCsEp3YBDYxmt8FE8dDUDNx5mVNK9HK6bmMlB2rE2gSMZSkg== X-Google-Smtp-Source: ABdhPJzL9mIjlGVZBxYmEfdgcaH2lk/E2jRQQHBjHTTTWiJIhZbTuYFYltlgWNLiQfpuTb/Wjgkd82inFGND02LNy2A= X-Received: by 2002:a62:6d06:0:b029:1a8:4d3f:947a with SMTP id i6-20020a626d060000b02901a84d3f947amr59029398pfc.6.1609599355569; Sat, 02 Jan 2021 06:55:55 -0800 (PST) MIME-Version: 1.0 References: <54d60a65-eee0-deac-c7ba-9d18dbce27b6@grinta.net> In-Reply-To: <54d60a65-eee0-deac-c7ba-9d18dbce27b6@grinta.net> From: John Kitchin Date: Sat, 2 Jan 2021 09:55:44 -0500 Message-ID: Subject: Re: what do do when multiple functions store a link To: Daniele Nicolodi Content-Type: multipart/alternative; boundary="000000000000d1c82c05b7ec0d9f" Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=johnrkitchin@gmail.com; helo=mail-pf1-x431.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Cc: org-mode-email Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.43 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=andrew-cmu-edu.20150623.gappssmtp.com header.s=20150623 header.b=NyonFfgU; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=andrew.cmu.edu (policy=none); 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-Migadu-Queue-Id: C38659402A9 X-Spam-Score: -2.43 X-Migadu-Scanner: scn0.migadu.com X-TUID: 5dG1pUjEpac8 --000000000000d1c82c05b7ec0d9f Content-Type: text/plain; charset="UTF-8" Here is a very grungy solution: (defun scimax-store-link-advice (orig-fun &rest args) (cl-letf (((symbol-function 'symbol-name) (lambda (_) ""))) (apply orig-fun args))) (advice-add 'org-store-link :around 'scimax-store-link-advice) It works by temporarily redefining symbol-name to return an empty string. It's only redeeming qualities are 1) it works, 2) you don't have to modify the org src code! John ----------------------------------- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu On Sat, Jan 2, 2021 at 9:37 AM Daniele Nicolodi wrote: > On 02/01/2021 14:49, John Kitchin wrote: > > Recently I have had an issue where multiple functions may store a link, > > e.g. to a bibtex entry. > > > > In this case, org-mode seems to prompt me to ask which function to store > > the link with, with an initial input of the first function, which masks > > all the options that are available. This happens > > inside |org-store-link| in ol.el at line 1495 for me. in > > > > (apply #'org-link-store-props > > (cdr (assoc-string > > (completing-read > > "Which function for creating the link? " > > (mapcar #'car results-alist) > > nil t (symbol-name name)) > > results-alist))) > > > > because of the (symbol-name name). > > > > Is there an easy way to avoid this, or to modify the order of the > > functions used? I want to see all the options for storing, or better, to > > just store them all and let me choose later when I use org-insert-link. > > I have the exact same problem. I think it comes from having org-bibtex > and org-ref loaded at the same time. I haven't investigated a possible > solution. > > Cheers, > Dan > --000000000000d1c82c05b7ec0d9f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Here is a very grungy solution:

(defun scimax-store-link-advice (orig-fun &rest args)<=
br>=C2=A0 (cl-letf (((symbol-function 'symbol-name)
=C2=A0 =C2=A0 = (lambda (_)
=C2=A0 =C2=A0 =C2=A0 "")))
=C2=A0 =C2=A0 (app= ly orig-fun args)))

(advice-add 'org-store-link :around 'sci= max-store-link-advice)
It works= by temporarily redefining symbol-name to return an empty string. It's = only redeeming qualities are 1) it works, 2) you don't have to modify t= he org src code!

John

---------= --------------------------
Professor John Kitchin=C2=A0
Doherty Hall = A207F
Department of Chemical Engineering
Carnegie Mellon UniversityPittsburgh, PA 15213
412-268-7803


On Sat, Jan 2, 2021 at 9:37 AM Daniele Nicolodi <daniele@grinta.net> wrote:
On 02/01/2021 14:49, John Kitchin wrote:<= br> > Recently I have had an issue where multiple functions may store a link= ,
> e.g. to a bibtex entry.=C2=A0
> =C2=A0
> In this case, org-mode seems to prompt me to ask which function to sto= re
> the link with, with an initial input of the first function, which mask= s
> all the options that are available.=C2=A0This happens
> inside=C2=A0|org-store-link|=C2=A0in ol.el at line 1495 for me. in
>
> (apply #'org-link-store-props
> (cdr (assoc-string
> =C2=A0 =C2=A0 =C2=A0 (completing-read
> "Which function for creating the link? "
> (mapcar #'car results-alist)
> nil t (symbol-name name))
> =C2=A0 =C2=A0 =C2=A0 results-alist)))=C2=A0
>
> because of the=C2=A0(symbol-name name).
> =C2=A0
> Is there an easy way to avoid this,=C2=A0or to modify the=C2=A0order o= f the
> functions used? I want to see all the options for storing, or better, = to
> just store them all and let me choose later when I use org-insert-link= .

I have the exact same problem. I think it comes from having org-bibtex
and org-ref loaded at the same time. I haven't investigated a possible<= br> solution.

Cheers,
Dan
--000000000000d1c82c05b7ec0d9f--