emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: Ingo Lohmar <ingo.lohmar@posteo.net>
Cc: emacs-orgmode@gnu.org, Gustavo Barros <gusbrs.2016@gmail.com>
Subject: Re: Bug: org-link-descriptive needs to be buffer-local [9.4.4 (release_9.4.4 @ /usr/local/share/emacs/28.0.50/lisp/org/)]
Date: Mon, 05 Apr 2021 22:36:49 -0400	[thread overview]
Message-ID: <87zgycb0la.fsf@kyleam.com> (raw)
In-Reply-To: <87pmzdhl4b.fsf@kenko.localhost.com>

Ingo Lohmar writes:

> I stumbled upon weird behavior when using `org-toggle-link-display', and
> I finally checked what that is about.
>
> Observation:
> - use `org-toggle-link-display' in org buffer A, and (coming
>   from the defaults) links are now shown in full (not just the
>   description), but only in buffer A
> - switch to org buffer B, still only showing the description part, and
>   again use `o-t-l-d' --- nothing changes
> - the state for new org buffers is as before, onle link descriptions are
>   shown.
>
> This behavior is very confusing, IMO.  The reason is simple.  The
> display hiding comes from changing the `buffer-invisibility-spec', which
> is automatically buffer-local.  But the state of the org toggle is kept
> in `org-link-descriptive', which is global!

Thanks for the clear problem description and analysis.  I agree that
this is a bug and don't suspect that anyone is relying on
org-toggle-link-display to toggling the global value.

Gustavo reported the same issue at
<https://orgmode.org/list/87lfeqzm3a.fsf@gmail.com>, but unfortunately
it didn't get any attention back then.

> I suggest a simple fix that I just tested: make `org-link-descriptive'
> automatically buffer-local, by adding ":local t" to the defcustom.

Hmm, I think a problem with `:local t' (or, equivalently,
make-variable-buffer-local for backward compatibility reasons) is that
then you'd interfere with user customization that directly sets this
after ol.el is loaded.  You could also still get into a mismatched state
like you described above if you load an Org buffer, set the value
through the customization interface, and then call
org-toggle-link-display in that buffer.

Instead I've updated the body of `org-mode' to make org-link-descriptive
buffer-local (702e782cb).


  reply	other threads:[~2021-04-06  2:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-01 19:15 Bug: org-link-descriptive needs to be buffer-local [9.4.4 (release_9.4.4 @ /usr/local/share/emacs/28.0.50/lisp/org/)] Ingo Lohmar
2021-04-06  2:36 ` Kyle Meyer [this message]
2021-04-06 18:08   ` Ingo Lohmar
2021-04-07  4:56     ` Kyle Meyer

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=87zgycb0la.fsf@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=gusbrs.2016@gmail.com \
    --cc=ingo.lohmar@posteo.net \
    /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).