From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id aFKcK6g7bWBDbwEAgWs5BA (envelope-from ) for ; Wed, 07 Apr 2021 06:57:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id oIeFJag7bWADcgAA1q6Kng (envelope-from ) for ; Wed, 07 Apr 2021 04:57:12 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id F203DCB08 for ; Wed, 7 Apr 2021 06:57:11 +0200 (CEST) Received: from localhost ([::1]:54700 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lU0Fa-0001P4-57 for larch@yhetil.org; Wed, 07 Apr 2021 00:57:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38194) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lU0FD-0001Ou-UU for emacs-orgmode@gnu.org; Wed, 07 Apr 2021 00:56:47 -0400 Received: from out0.migadu.com ([2001:41d0:2:267::]:30172) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lU0FA-0008SR-Ia for emacs-orgmode@gnu.org; Wed, 07 Apr 2021 00:56:47 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kyleam.com; s=key1; t=1617771398; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fqLkSknYJaKop5JqyBktpjrAXac8PFEjXI8HBzjyPW4=; b=ZedvjKTUILxi8B4KoYAA26hl4MdEvdFsWcHHrD/vAaMlmBbB8w/OSLL1ZgXmc9Baxxc30Y BJdNYoUP9223X2/4H35fI6rWtOHYIB3Ulr/lIxiLTbcgPKGGnmxWWhfb9aRiO7XZxXHCwQ 6Cz8GKiH1BU1zC2AmX9YaYDXm9lMKqap0JZsZKrp6307HpLHFv395ediIT9PYk0tVsDEV+ bGsPCVndd+kn8+mv/2EYzI4dOjl0yhxCCNNYctMvxr93fSoDMl7NH+XmdbFzavYNa5Vjr0 Sd5R/CuLNDqrEDtUCD28LgOq70W9mTYijE2724uCT9Mov6YuP1uVFQbQBgO2GQ== From: Kyle Meyer To: Ingo Lohmar 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/)] In-Reply-To: <87lf9ve16c.fsf@kenko.localhost.com> References: <87pmzdhl4b.fsf@kenko.localhost.com> <87zgycb0la.fsf@kyleam.com> <87lf9ve16c.fsf@kenko.localhost.com> Date: Wed, 07 Apr 2021 00:56:28 -0400 Message-ID: <87im4ypu9v.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Auth-User: kyle@kyleam.com Received-SPF: pass client-ip=2001:41d0:2:267::; envelope-from=kyle@kyleam.com; helo=out0.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org, Gustavo Barros Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1617771432; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=fqLkSknYJaKop5JqyBktpjrAXac8PFEjXI8HBzjyPW4=; b=YHvHhMnembkAMkcFIkyarg1BkQ7FiimDPTDQw9zwF7KtxNRpdALtpKoQgAH9sVO7A3Ptaq SZkABLWleSUAHJRrTWswTSWYMqatGE647cqRd+SesDxtzkGs3RXB+D+21YPyrBbmovvTZ9 SN5gl8T1JXXtbL5dudRTecWOE19ZCxzGMzUTzyz/neGcSX+9PUEMw390k+rAQqOj7f3yT9 BWxt514Gv2jPgW9pNbodhBherBu2tF5ogvXgLrVWa4aIbXqG/hWvRyxwbeNcXlZtZoNBw4 QaHcwqvs0JGWrjC+x2dKcWLQjDIf9TOX9ilL2hS7Md839PHjsNgP3xodFz1KBw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1617771432; a=rsa-sha256; cv=none; b=Blk0CPSZaQRonVfQR+UtwxHS+q4/uEwCBqUXKX5Du6McyUhS9IfSwVFQnOQ/t5ObycsoeS a6/mcuFeaui3ZH1SsykuRRCLx8aCl2DfT0eaMZHu1vysqX2Gv4K+yEfIbU9daSxgLWlZSp 6E6tK/FwFFbi4VRbvNGz4l0GzNBSYO7kMd6fJLz4hWlpTNp/ZZgRE6r5tYkDIo7iyuQUGn S7ejHM3638ZYFnIFpUxrgFWBoNxNwsoRuP8Aqb1jaVNZRqRRWA4FdaACXut6+A2KGbNHt2 +krCPh179Mpipp/z9FldZdEP5/p27Rqpa2LrsWkbuA8UWscolHychjn4Dd7Ojw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=kyleam.com header.s=key1 header.b=ZedvjKTU; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -2.64 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=kyleam.com header.s=key1 header.b=ZedvjKTU; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: F203DCB08 X-Spam-Score: -2.64 X-Migadu-Scanner: scn0.migadu.com X-TUID: tNoDyChUDyrN Ingo Lohmar writes: > On Mon, Apr 05 2021 22:36 (-0400), Kyle Meyer wrote: >> 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. [...] > I am not sure that I understand the problem you're describing.. Maybe > it's because I don't use the customize interface myself, but I think any > such customization would only set the default value, wouldn't it? Yes. Here are expanded descriptions for the two problems I'm referring to above. This is based on testing with the `:local t' diff below (on top of bcfe6f985, before the commit I mentioned in my last message). * Breaks customization of direct setq callers if ol.el is already loaded. If (setq org-link-descriptive nil) is executed after ol.el is loaded, links in a visited Org buffer will be displayed according to the default org-link-descriptive value of t. * Setting org-link-descriptive via the customization interface can get into a mismatched state. - Visit an Org file with a link and description. org-link-descriptive is at its global value of t. - Set org-link-descriptive to nil via the customization interface, changing the global value to nil. This value is in effect in the Org buffer because org-link-descriptive isn't yet buffer-local. The description is still hidden because buffer-invisibility-spec hasn't been changed. - Calling org-toggle-link-display sets org-link-descriptive to t, making org-link-descriptive a buffer-local variable. The appearance of the description doesn't change due to the mismatch (like described in your original report). Calling it again aligns the buffer-local value and buffer-invisibility-spec. diff --git a/lisp/ol.el b/lisp/ol.el index d1db1683b..0e225ce4e 100644 --- a/lisp/ol.el +++ b/lisp/ol.el @@ -193,6 +193,7 @@ (defcustom org-link-descriptive t `org-toggle-link-display' or from the \"Org > Hyperlinks\" menu." :group 'org-link :type 'boolean + :local t :safe #'booleanp) (defcustom org-link-make-description-function nil