[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v6] ol.el: add description format parameter to org-link-param

From: Hugo Heagren
Subject: Re: [PATCH v6] ol.el: add description format parameter to org-link-parameters
Date: Sun, 17 Jul 2022 21:59:14 +0100

On 17/07/2022 04:20, Ihor Radchenko wrote:
> The return value of org-link-make-description-function can also be nil
> in addition to string.  I suggest documenting this, just as you did for
> :insert-description parameter.

Ah I understand. Done. Also updated the changelog commit message to
reflect the new documentation.

On 17/07/2022 04:20, Max Nikulin wrote:
> See info "(elisp) Indenting Macros".

I understand now. Fixed in this version. Thanks for clarifying.

> In addition to changing behavior, you decision is still a trade-off.
> Consider the case when, editing some link, a user changes link path
> and expects to get new default description.

Yes, I see what you mean. I suppose that without a user option or
similar to control this behaviour, it will always be a trade-off. I
think the behaviour I have written makes the most sense, and as you
say, a solution to completely resolve it might be unwieldy. If someone
else really wants different behaviour I suppose they can submit a

> You do not check that `org-link-make-description-function' is not nil.

This is a good point. I've substituted
`org-link-make-description-function' for `t', which has exactly the
effect of only running that clause if
`org-link-make-description-function' is not nil. This also means that
in the case where `:insert-description' *and*
`org-link-make-description-function' are both nil then the user won't
get a 2-second error message. Since this configuration is the default
state which ships with org, an error message seems rather odd, so this
is probably a good result!

This also means that if we reach that clause and
`org-link-make-description-function' *is* nil, then the whole `cond'
just returns nil, and so the link inserted with no default
description, which makes sense to me.

> You might even add a test for such configuration (no
> :insert-description is defined).

Good idea. Done in the latest version.



Attachment: 0002-test-ol-tests-for-insert-description-param-when-inse.patch
Description: Text Data

Attachment: 0001-ol.el-add-description-format-parameter-to-org-link-p.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]