On 26/09/2022 19:12, Ihor Radchenko wrote:
Magnus Therning writes:

The documenation on org-create-file-search-functions contains this
piece of text

   A function in this hook may also use setq to set the variable
   description to provide a suggestion for the descriptive text to
   be used for this link when it gets inserted into an Org buffer
   with org-insert-link.

This doesn't seem to be true though. I really would love for there
to be a way to influence the link description, but no matter what
the documentation should be corrected.

Thus, we may as well take this opportunity and allow
`org-create-file-search-functions' to return a cons cell
("search term" . "description"). This will not require unintuitive
global variables.

There is the `org-store-link-plist' variable used by :store functions from `org-link-parameters' but not by the `org-create-file-search-functions' hook. Maybe it is enough to add

   (setq desc (plist-get org-store-link-plist :description))

after calling of the hook.

For a while, I hope, it is possible to create a workaround using

  (org-link-set-parameters
   "file"
   :store ...)


Reply via email to