emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: "Rudolf Adamkovič" <salutis@me.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Case insensitivity of simple [[links]]
Date: Fri, 20 Oct 2023 09:41:53 +0000	[thread overview]
Message-ID: <877cnhd40u.fsf@localhost> (raw)
In-Reply-To: <m2mswe6h0m.fsf@me.com>

Rudolf Adamkovič <salutis@me.com> writes:

>>> [...] call to 'org-toggle-link-display' does nothing.
>
>> It does nothing because it is one of the options that must be set before
>> Org mode is loaded. Resolving buffer-local variables happens after the
>> major mode is loaded.
>
> I have noticed that 'org-use-extra-keys', for example, is documented as
> "must set it before loading Org", but there is nothing similar in the
> 'org-link-descriptive' docstring.  So perhaps this is a bug, not a
> feature?

I was not precise. `org-link-descriptive' must be set before Org major
mode is loaded in current buffer. In general, all the Emacs
customization are not guaranteed to do anything when the major mode is
already loaded. There is a mechanism with :set function for defcustom,
but most people use setq that ignores this mechanism.

Anyway, I just added a :set function for `org-link-descriptive' on main.
It will be used when customization interface, `setopt', or
`custom-set-variables' is used.

> Upon a quick look, 'org-toggle-link-display' does exactly two things:
>
>   1. (setq org-link-descriptive (not org-link-descriptive)) and
>   2. (org-link-descriptive-ensure),
>
> where 'org-link-descriptive-ensure' wraps exactly one expression:
>
>   (org-fold-core-set-folding-spec-property
>      (car org-link--link-folding-spec)
>      :visible (not org-link-descriptive))
>
> Could Org execute this expression after loading a document, given the
> buffer-local value of 'org-link-descriptive' necessitates it?

No. Because the code execution during Org loading happens before Emacs
loads file-local variables. This is by major mode design and we cannot
do much about this. See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=57003

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


  reply	other threads:[~2023-10-20  9:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-23  0:45 Case insensitivity of simple [[links]] Rudolf Adamkovič
2023-09-23 10:10 ` Ihor Radchenko
2023-09-24 14:46   ` Rudolf Adamkovič
2023-09-26 10:44     ` Ihor Radchenko
2023-09-27  8:35       ` Rudolf Adamkovič
2023-10-05 13:52         ` Ihor Radchenko
2023-10-06 10:43           ` Rudolf Adamkovič
2023-10-14  9:01             ` Ihor Radchenko
2023-10-16 20:28               ` Rudolf Adamkovič
2023-10-17 10:49                 ` Ihor Radchenko
2023-10-19 10:30                   ` Rudolf Adamkovič
2023-10-20  9:41                     ` Ihor Radchenko [this message]
2023-10-21 11:40                       ` Rudolf Adamkovič
2023-10-21 13:23                         ` Ihor Radchenko
2023-12-09 12:17                     ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877cnhd40u.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=salutis@me.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).