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

2022-08-06 Thread Ihor Radchenko
Hugo Heagren writes: > Hugo > From 039c2131462f5454f2804e809e085a055b5bf552 Mon Sep 17 00:00:00 2001 > From: Hugo Heagren > Date: Mon, 28 Mar 2022 23:18:45 +0100 > Subject: [PATCH 1/2] ol.el: add description format parameter to > org-link-param

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

2022-07-30 Thread Ihor Radchenko
Adding Org ML back to CC. Hugo Heagren writes: >> The rx-to-string call may still suffer from the described edge case. > > Yes, I think this is a good idea. > >> (and all-prefixes ...) > > I'm not sure what you mean, but I don't think it will work. I mean (and ,all-prefixes (rx-to-string `(:

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

2022-07-30 Thread Ihor Radchenko
Hugo Heagren writes: > The test fails because of an error in `rx-to-string', which is called > by `org-insert-link'. It was failing because I have the following > code: > > , > | (rx-to-string `(: string-start (submatch (or ,@all-prefixes)) ":")) > ` > ... > We could just as easily do it

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

2022-07-29 Thread Max Nikulin
On 25/07/2022 18:55, Hugo Heagren wrote: In any case, we cannot, unfortunately, use map-do here and should probably fall back to the previous version with cl-loop. You're right, this is strange. Oh well, I've moved back to the version of the macro which used `cl-loop' in the current patch.

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

2022-07-29 Thread Bastien Guerry
Hi Ihor and Hugo, Ihor Radchenko writes: > Bastien, can you please confirm that Hugo is listed in the FSF > records Yes I do! > and then add him to the contributors.org? Done. -- Bastien

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

2022-07-28 Thread Ihor Radchenko
Hugo Heagren writes: > On 18/07/2022 17:55, Max Nikulin wrote: > >> I am sorry if I am wrong, but I do not see you among known Org, >> contributors. You patch is likely greater than it is allowed for >> TINYCHANGE, so before you patch can be committed, copyright assignment >> should be signed,

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

2022-07-24 Thread Ihor Radchenko
Max Nikulin writes: >>> It is `map-do' that causes the problem. Maybe earlier implementation in >>> Emacs-26 has some peculiarities. It is the version available from the >>> system repository for Ubuntu-20.04 LTS focal. >> >> Tests do not fail on my side using Emacs 26.3 > > Ihor, what is the

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

2022-07-24 Thread Max Nikulin
On 23/07/2022 20:06, Ihor Radchenko wrote: Max Nikulin writes: If it still fails, could you try isolating whether it's a specific `should' clause which is the problem, if it fails with any of them? It is `map-do' that causes the problem. Maybe earlier implementation in Emacs-26 has some

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

2022-07-23 Thread Max Nikulin
On 23/07/2022 20:06, Ihor Radchenko wrote: Max Nikulin writes: If it still fails, could you try isolating whether it's a specific `should' clause which is the problem, if it fails with any of them? It is `map-do' that causes the problem. Maybe earlier implementation in Emacs-26 has some

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

2022-07-23 Thread Ihor Radchenko
Max Nikulin writes: >> If it still fails, could you try isolating whether it's a specific >> `should' clause which is the problem, if it fails with any of them? > > It is `map-do' that causes the problem. Maybe earlier implementation in > Emacs-26 has some peculiarities. It is the version

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

2022-07-23 Thread Max Nikulin
On 23/07/2022 14:48, Hugo Heagren wrote: I've already assigned copyright to the FSF for work on Emacs (see attached certificate). Do I need to do anything else for org-mode in particular? Great, I hope, it is enough, but my answer is not authoritative. Emacs-26.3: make test-dirty

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

2022-07-18 Thread Max Nikulin
Hugo, I am sorry if I am wrong, but I do not see you among known Org contributors. You patch is likely greater than it is allowed for TINYCHANGE, so before you patch can be committed, copyright assignment should be signed, see https://orgmode.org/worg/org-contribute.html#copyright for

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

2022-07-17 Thread Ihor Radchenko
Max Nikulin writes: > Ihor, Hugo raised a question how to interpret nil returned by > :insert-description functions. Do you have any opinion? I do not like > the idea to consider it as an error since string is expected. I would > prefer to call `org-link-make-description-function' as a

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

2022-07-17 Thread Ihor Radchenko
Hugo Heagren writes: >> Can you also update the documentation for >> org-link-make-description-function? > > I'm not sure what sort of documentation you have in mind? What should > I add? I referred to my earlier statement: > tl;dr The question is: what is the Good Behaviour when

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

2022-07-17 Thread Max Nikulin
Hi, Ihor, Hugo raised a question how to interpret nil returned by :insert-description functions. Do you have any opinion? I do not like the idea to consider it as an error since string is expected. I would prefer to call `org-link-make-description-function' as a fallback. On 17/07/2022

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

2022-07-16 Thread Ihor Radchenko
link-make-description-function? > From cd5268bc05324140a4cf384ce12b99bba1ddab47 Mon Sep 17 00:00:00 2001 > From: Hugo Heagren > Date: Mon, 28 Mar 2022 23:18:45 +0100 > Subject: [PATCH] ol.el: add description format parameter to > org-link-parameters Also, can you please review the comments from Max:

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

2022-07-10 Thread Max Nikulin
On 08/07/2022 02:57, Hugo Heagren wrote: Since the last version of this patch, I have: Thank you, this version should be more reliable. tl;dr The question is: what is the Good Behaviour when :default-description is set to something, which is meant to return a string and returns 'nil instead?

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

2022-07-08 Thread Ihor Radchenko
rtn) > + ;; In case of error, restore state anyway AND really error > + (error > +(apply 'org-link-set-parameters ,type orig-parameters) > + (signal (car err) (cdr err)) unwind-protect is more suitable here and will lead to more concise code.

[PATCH v4] ol.el: add description format parameter to org-link-parameters

2022-07-07 Thread Hugo Heagren
obar") + (test-ol-insert-link-get-desc "id:foo-bar" "notfoobar"))))) + (provide 'test-ol) ;;; test-ol.el ends here -- 2.20.1 >From 12726d18487298907ff63374120d17ee733383a7 Mon Sep 17 00:00:00 2001 From: Hugo Heagren Date: Mon, 28 Mar 2022 23:18:45 +0100 Subject:

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

2022-06-21 Thread Max Nikulin
On 21/06/2022 19:03, Hugo Heagren wrote: +(defmacro test-ol-with-link-parameters-as (type parameters body) [...] + `(progn + (setq orig-parameters org-link-parameters) I can easily miss something, but wouldn't it be enough to use let-binding `(let ((org-link-parameters

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

2022-06-21 Thread Robert Pluim
> On Tue, 21 Jun 2022 13:03:32 +0100, Hugo Heagren said: Hugo> They're very nearly just right, but for some reason Hugo> `test-ol-with-link-parameters-as' doesn't always reset the parameters Hugo> correctly for me. However I have them set to originally, it sets Hugo>

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

2022-06-21 Thread Hugo Heagren
ters-as + "id" (:default-description "foobar") + (test-ol-insert-link-get-desc "id:foo-bar" "notfoobar") + (provide 'test-ol) ;;; test-ol.el ends here -- 2.20.1 >From 437155c2394b5c9961ecc0af4e1e1a54b63416fe Mon Sep 17 00:00:00 2001 From: Hug

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

2022-04-06 Thread Ihor Radchenko
Hugo Heagren writes: > I've added the condition-case back to the check on > `org-link-make-description', and added a new one to the check for the > `:default-description' parameter, as Ihor suggested. I've also > modified the handling of that parameter, to reflect > `org-link-make-description',

[PATCH v2] ol.el: add description format parameter to org-link-parameters

2022-04-05 Thread Hugo Heagren
* ol.el (org-link-parameters): add parameter `:default-description', a string or a function. * (org-insert-link): if no description is provided (pre-existing or as an argument), next option is to use the `:default-description' (if non-nil) parameter to generate one. Default descriptions are

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

2022-04-04 Thread Ihor Radchenko
Hugo Heagren 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

[PATCH] ol.el: add description format parameter to org-link-parameters

2022-03-28 Thread Hugo Heagren
* ol.el (org-link-parameters): add parameter `:default-description', a string or a function. * (org-insert-link): if no description is provided (pre-existing or as an argument), next option is to use the `:default-description' (if non-nil) parameter to generate one. Default descriptions are

ol.el: add description format parameter to org-link-parameters

2022-03-28 Thread Hugo Heagren
Suggested patch to add a new link parameter controlling how the default description is generated. As explained in the commit, this behaviour is often similar between links of the same type, but differs between those types, so a parameter seems like a good place to specify it. I've tried to make