From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Bug: Fix for org-make-link-description-function use in org-insert-link [9.0.10 (9.0.10-5-g1654a5-elpa @ /home/rrt/.emacs.d/elpa/org-20170904/)] Date: Tue, 05 Sep 2017 22:49:25 +0200 Message-ID: <87a828na5m.fsf@nicolasgoaziou.fr> References: <874lsh5cwj.fsf@sc3d.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45945) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dpKmr-00011k-D8 for emacs-orgmode@gnu.org; Tue, 05 Sep 2017 16:49:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dpKmm-0006rm-Le for emacs-orgmode@gnu.org; Tue, 05 Sep 2017 16:49:33 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:41537) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dpKmm-0006rO-Fr for emacs-orgmode@gnu.org; Tue, 05 Sep 2017 16:49:28 -0400 In-Reply-To: <874lsh5cwj.fsf@sc3d.org> (Reuben Thomas's message of "Tue, 05 Sep 2017 17:27:24 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Reuben Thomas Cc: emacs-orgmode@gnu.org Hello, Reuben Thomas writes: > This seems to be incorrect behaviour, as the docstring for > org-insert-link says: > > If `org-make-link-description-function' is non-nil, this function will = be > called with the link target, and the result will be the default > link description. > > The implication is that the value returned is used as the default, not > that it overrides the prompt. I agree. > First, org-make-link-description-function is called if it is non-nil, > and used to set default-description. I think the optional parameter from the function call should still prevail. I.e., shouldn't this function be called when DEFAULT-DESCRIPTION is nil (e.g., called interatively)? > Then (unless auto-desc is non-nil) the description is prompted for with > default-description as the default value (unless > org-make-link-description-function returned nil, in which case the > current value of desc, if any, is used). > > There is one further matter that my patch does not address: the > docstring for org-make-link-description-function says: > > =E2=80=9CWhen [org-make-link-description-function is] nil, the link locat= ion > will be used.=E2=80=9D > > This does not happen (it=E2=80=99s precisely the behaviour I=E2=80=99ve b= een trying to > obtain!), and my patch does not make it happen. Indeed, it=E2=80=99s not = clear > that it=E2=80=99s desirable (if one is using numbered sections, for examp= le). Obviously, it would not be desirable.=20 However, I think it should read "When `org-make-link-description-function' _returns_ nil, the link location is used". This is not what is implemented either, tho. Regards, --=20 Nicolas Goaziou