emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [BUG] org-create-file-search-functions and description [9.5.5 (relea


From: Magnus Therning
Subject: Re: [BUG] org-create-file-search-functions and description [9.5.5 (release_9.5.5 @ /usr/share/emacs/29.0.50/lisp/org/)]
Date: Mon, 26 Sep 2022 14:15:47 +0200
User-agent: mu4e 1.8.9; emacs 29.0.50


Ihor Radchenko <yantar92@gmail.com> writes:

Magnus Therning <magnus@therning.org> 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.

For some more info look at
https://www.reddit.com/r/orgmode/comments/xmvtsy/orgcreatefilesearchfunctions_and_description/

Thanks for reporting!
Confirmed.

This is a regression after we switched to lexical binding, and after we
removed the apparently uninitialized `description' variable from
let-binding in `org-store-link'.

    a85b4cc5c64b1eb6b97f5d7843dd54eb0632ef91
    Author:     Stefan Monnier <monnier@iro.umontreal.ca>
    AuthorDate: Thu Mar 11 13:07:37 2021 -0500
    Commit:     Kyle Meyer <kyle@kyleam.com>
    CommitDate: Sun Mar 14 17:54:17 2021 -0400

    Backport commit 7d0dc3183 from Emacs

    ...
    * lisp/ol.el (org-store-link):
    Remove always-nil variable `description`.

In order to make things work now with lexical binding, we need to create a top-level defvar in ol.el, which is not nice since `description'
variable name is a bad name to define.

Interestingly, this issue has not been noticed for a long time and not
many users are probably making use of it.

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.

WDYT?

I think returning a cons cell would be a very nice solution.

/M

--
Magnus Therning                   OpenPGP: 0x927912051716CE39
email: magnus@therning.org
@magthe@mastodon.technology       http://magnus.therning.org/

Never argue with stupid people, they will drag you down to their level
and then beat you with experience.
    ― Mark Twain

Attachment: signature.asc
Description: PGP signature


reply via email to

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