[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] ol.el: add description format parameter to org-link-paramete
From: |
Ihor Radchenko |
Subject: |
Re: [PATCH] ol.el: add description format parameter to org-link-parameters |
Date: |
Mon, 04 Apr 2022 17:49:35 +0800 |
Hugo Heagren <hugo@heagren.com> writes:
> * ol.el (org-link-parameters): add parameter `:default-description', a
> string or a function.
LGTM in general. Note that I proposed (and never followed up on) a
similar patch in the past:
https://orgmode.org/list/87pnauvxht.fsf@localhost
I like that you introduced an option to set default description to
string, but I have several comments on the patch itself.
> - (t (condition-case nil
> - (funcall org-link-make-description-function link desc)
> + (org-link-make-description-function
> + (funcall org-link-make-description-function link desc))
> + (t (error
> + (message "Can't get link description from %S"
> + (symbol-name org-link-make-description-function))
> + (sit-for 2)
> + nil)))))
It looks like you removed condition-case used to catch errors on
org-link-make-description function. I am pretty sure that it is not
intentional.
Similar condition-case could also be used for the :default-description
function.
+`:default-description'
+
+ String or function used as a default when prompting users for a
+ link's description. A string is used as-is, a function is
+ called with the full link text as the sole argument, and should
+ return a single string.
Why not two arguments like in org-link-make-description-function?
Best,
Ihor
- Re: [PATCH] ol.el: add description format parameter to org-link-parameters,
Ihor Radchenko <=