org.el: Mark org-link-descriptive as buffer-local

* lisp/org.el (org-mode): Mark org-link-descriptive as buffer-local.

Calling org-toggle-link-display is an inherently buffer-local
operation because it works via the buffer-local
buffer-invisibility-spec, so toggling the global value leads to a
mismatched, invalid state in all other buffers.

Reported-by: Gustavo Barros <gusbrs.2016@gmail.com>
Ref: https://orgmode.org/list/87lfeqzm3a.fsf@gmail.com
Reported-by: Ingo Lohmar <ingo.lohmar@posteo.net>
Ref: https://orgmode.org/list/87pmzdhl4b.fsf@kenko.localhost.com
This commit is contained in:
Kyle Meyer 2021-04-05 22:13:16 -04:00
parent bcfe6f985c
commit 702e782cb6
1 changed files with 1 additions and 0 deletions

View File

@ -4792,6 +4792,7 @@ The following commands are available:
(org-load-modules-maybe)
(org-install-agenda-files-menu)
(when org-link-descriptive (add-to-invisibility-spec '(org-link)))
(make-local-variable 'org-link-descriptive)
(add-to-invisibility-spec '(org-hide-block . t))
(setq-local outline-regexp org-outline-regexp)
(setq-local outline-level 'org-outline-level)