From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id oCCPALrJa2DbOAEAgWs5BA (envelope-from ) for ; Tue, 06 Apr 2021 04:38:50 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id RLsDNrnJa2CYTQAAbx9fmQ (envelope-from ) for ; Tue, 06 Apr 2021 02:38:49 +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 523A419A72 for ; Tue, 6 Apr 2021 04:38:49 +0200 (CEST) Received: from localhost ([::1]:35826 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lTbc8-0000oh-44 for larch@yhetil.org; Mon, 05 Apr 2021 22:38:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59926) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lTbaQ-0000oS-Pr for emacs-orgmode@gnu.org; Mon, 05 Apr 2021 22:37:04 -0400 Received: from out0.migadu.com ([2001:41d0:2:267::]:64842) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lTbaJ-0001yQ-0Y for emacs-orgmode@gnu.org; Mon, 05 Apr 2021 22:36:58 -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=1617676610; 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=hMcfCJZTfaNpuyM/Hor6nrQYjUOKPuWJ3htpjziuPEg=; b=oN74g7ScBPAjLfGV85owcHlH7OQ5Qo7eg1XGMqZzqqBTArofANtojBVCOqUEDq1bgKPOif H+kCdRzrLkskSxFxBpA5rKuxHjfHWAztfFYPSjwPUNPT192m8/JtqVhl6xCPZmm5mUddIT PiSSv+FK+3QBripDCl9LYYDEFfoGzLLooKluw2LTRe13XBb9wU9iVrrHTnFntVrxNfQw4p W+NzLz7unpbSYRT0rT/ERQ+pa40u/PYyEz4HLPAuvTj3hUcceGcDWkoMfVXyHst2rE5pJv xU4JhlgjNADPHAXaNRSuNhcQeRb/SBXC4cC5rZRi0MP9BIrl+1zpcOZlnZtP5g== 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: <87pmzdhl4b.fsf@kenko.localhost.com> References: <87pmzdhl4b.fsf@kenko.localhost.com> Date: Mon, 05 Apr 2021 22:36:49 -0400 Message-ID: <87zgycb0la.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=1617676729; 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=hMcfCJZTfaNpuyM/Hor6nrQYjUOKPuWJ3htpjziuPEg=; b=Zw/z85mdwESZdlyLW9MuIO4I1opVvV1U1si2/qQzBQnbHDmxq0cRAeaP2RwPlq7xWA2D9Y ZXmtgaHeMn045b8JUL+15eestIKfDX5EnuiQSrmSE1sBorFwFFz/A7/Ue1PZapXXePkSuz 5DBypnlROgur0SAWP3PLQpyHENlg08KTabDpC4LPNNITajpKY9Z7Gd02Si2dVrIC239N4l m4V0iip3ak8cGfqRj7NBrudculJUyXmLmJVLaE+6OE4aJq3FgD2TegMpH33huDAYyLc+N7 ovKAXN78Uf0nNV2wbDzNXj7nwrIXdohnjuE9ECeFsmRCTgQfSnrWsc4I3t1jCA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1617676729; a=rsa-sha256; cv=none; b=cfyc4MR69VkoHTL26QhnbkjtZFgsad7jbU7+NyGTCiKV8YF+xEqIPq9AXgf1+RWWH113+Q wfncsCMG83zzxS7erFsPyznTAZK/ePV18jN9V49yZ93FB/ay4/yybaalpcy4VFtTQ/WMzu WJsCYAV3ZcVUA9TP/uE7QZl+Uov7sFmWuRx+8W37AP8K9VAWkImCwfr/qRcN6px23dXlKC sLhjAgk3jCUsuLWspdaaNEmRyhp1+flr+tiXaLbR3bQQcIOQ8E3SLClxRvMFMj9/TYRJtW RQmS/h3eQSAs7P2iMgrdezxfwgf/HLJDw6qXSwtYgVbfPatduYTkrYGSbmrbFA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=kyleam.com header.s=key1 header.b=oN74g7Sc; 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-Spam-Score: -1.14 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=kyleam.com header.s=key1 header.b=oN74g7Sc; 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: 523A419A72 X-Spam-Score: -1.14 X-Migadu-Scanner: scn0.migadu.com X-TUID: 3ZwFosjClpg2 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 , 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).