GNU bug report logs - #51974
29.0.50; [PATCH] Fix deactivation of outline-minor-mode-cycle-map bindings

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: miha@HIDDEN; Keywords: patch; dated Fri, 19 Nov 2021 11:38:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 51974 <at> debbugs.gnu.org:


Received: (at 51974) by debbugs.gnu.org; 20 Nov 2021 09:45:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 20 04:45:32 2021
Received: from localhost ([127.0.0.1]:41727 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1moMw8-00017F-Dh
	for submit <at> debbugs.gnu.org; Sat, 20 Nov 2021 04:45:32 -0500
Received: from quimby.gnus.org ([95.216.78.240]:41788)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1moMw6-000101-9B
 for 51974 <at> debbugs.gnu.org; Sat, 20 Nov 2021 04:45:31 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=mvGy4wIfv5U8Kna4/k2t6MAJUDctMKisNjCuYZBtERE=; b=mO2Ph1rY/Ib95gSuKng7dcX4ct
 nY17EMagzqFddZgrX314NqmFKURu1WWy/fVFqI7M9Ul+0NxKCyl+8p8vCvR6T7uQD/w8wYs7MwN2Z
 5LG2+eQoi/IpUMSn43VgqFlqq1mjmOVCPRZptIivKVu28NIfYAWXsoe8SDEai+Qs8+p0=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1moMvw-0001x0-Pl; Sat, 20 Nov 2021 10:45:23 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: miha@HIDDEN
Subject: Re: bug#51974: 29.0.50; [PATCH] Fix deactivation of
 outline-minor-mode-cycle-map bindings
References: <87lf1ke5iy.fsf@miha-pc>
X-Now-Playing: June Tabor's _Ashore_: "The Bleacher Lassie Of Kelvinhaugh"
Date: Sat, 20 Nov 2021 10:45:16 +0100
In-Reply-To: <87lf1ke5iy.fsf@miha-pc> (miha@HIDDEN's message of "Fri,
 19 Nov 2021 12:41:57 +0100")
Message-ID: <87h7c7qhxv.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: miha@HIDDEN writes: > - 'keymap
 outline-minor-mode-cycle-map)
 > + 'outline-cycle-keymap > + outline-minor-mode-cycle-map) I'm not very
 enthusiastic about messing with char-property-alias-alist for something like
 this, but perhaps this is the best solution here? I guess we don't have a
 mechanism to make a text property ke [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -0.3 (/)
X-Debbugs-Envelope-To: 51974
Cc: 51974 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.3 (-)

miha@HIDDEN writes:

> -                                       'keymap outline-minor-mode-cycle-map)
> +                                       'outline-cycle-keymap
> +                                       outline-minor-mode-cycle-map)

I'm not very enthusiastic about messing with char-property-alias-alist
for something like this, but perhaps this is the best solution here?  I
guess we don't have a mechanism to make a text property keymap "go away"
when a minor mode is deactivated?

Anybody got an opinion here?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51974; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 19 Nov 2021 11:37:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 19 06:37:29 2021
Received: from localhost ([127.0.0.1]:38237 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mo2Cv-0006Be-1W
	for submit <at> debbugs.gnu.org; Fri, 19 Nov 2021 06:37:29 -0500
Received: from lists.gnu.org ([209.51.188.17]:46784)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <miha@HIDDEN>) id 1mo2Ct-0006BW-Pq
 for submit <at> debbugs.gnu.org; Fri, 19 Nov 2021 06:37:28 -0500
Received: from eggs.gnu.org ([209.51.188.92]:51926)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <miha@HIDDEN>)
 id 1mo2Ct-0004sa-K2
 for bug-gnu-emacs@HIDDEN; Fri, 19 Nov 2021 06:37:27 -0500
Received: from kamnitnik.top ([209.250.245.214]:37700)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <miha@HIDDEN>)
 id 1mo2Cr-0006sI-Cf
 for bug-gnu-emacs@HIDDEN; Fri, 19 Nov 2021 06:37:26 -0500
Received: from localhost (BSN-77-156-43.static.siol.net [193.77.156.43])
 by kamnitnik.top (Postfix) with ESMTPSA id 6E35B9CFA8
 for <bug-gnu-emacs@HIDDEN>; Fri, 19 Nov 2021 11:37:20 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kamnitnik.top;
 s=mail; t=1637321840;
 bh=4xbxUTkef7VpEJegHygKn80JrpUHt2JaJ/iZmhNS8XE=;
 h=From:To:Subject:Date:From;
 b=DzhynT6TnPwn3Z0WfwyHzv2AUk8VrJWGyFL+iWhnTjHqzwPHQpu4jlDnDbHuqCBBI
 HKuRHHGf+k1hqdEBRUqAtmooSX25W165o0kJfQQYL/UytQ01ITY4N023dN9csjpd1t
 92+2ghUCwL6PRYSkPd9hhnZpDXYVvkwT6ZurhXCwsKLE8ybTz/XdVcF37zjlGQxsXW
 A5pCPYZF1txolG3nYDt9461RxpVPaJnxHiw6Ehd7P72Bq1NsXlvNXGDZfClR9UtdZM
 SOEypYkeQRc7jNtzcaYPlDcMpmK+qjERu1s4PKSwAS72naruQm7zmXlO0mRl/6rrmm
 ZaFPooeZaNwTw==
From: miha@HIDDEN
To: bug-gnu-emacs@HIDDEN
Subject: 29.0.50; [PATCH] Fix deactivation of outline-minor-mode-cycle-map
 bindings
Date: Fri, 19 Nov 2021 12:41:57 +0100
Message-ID: <87lf1ke5iy.fsf@miha-pc>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="==-=-=";
 micalg=pgp-sha256; protocol="application/pgp-signature"
Received-SPF: pass client-ip=209.250.245.214; envelope-from=miha@HIDDEN;
 helo=kamnitnik.top
X-Spam_score_int: 0
X-Spam_score: -0.1
X-Spam_bar: /
X-Spam_report: (-0.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,
 FROM_SUSPICIOUS_NTLD=0.001, FROM_SUSPICIOUS_NTLD_FP=1.997,
 PDS_OTHER_BAD_TLD=0.001, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.7 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: Customize 'outline-minor-mode-cycle' to t and enable
 outline-minor-mode.
 Put point on a heading and TAB cycles visibility as expected. However,
 disabling the minor mode, the keymap remains active and [...] 
 Content analysis details:   (1.7 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 2.0 PDS_OTHER_BAD_TLD      Untrustworthy TLDs
 [URI: kamnitnik.top (top)]
 0.9 SPF_FAIL               SPF: sender does not match SPF record (fail)
 [SPF failed: Please see http://www.openspf.org/Why?s=mfrom;
 id=miha%40kamnitnik.top; ip=209.51.188.17; r=debbugs.gnu.org]
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
 [209.51.188.17 listed in wl.mailspike.net]
 -2.3 RCVD_IN_DNSWL_MED      RBL: Sender listed at https://www.dnswl.org/,
 medium trust [209.51.188.17 listed in list.dnswl.org]
 0.5 FROM_SUSPICIOUS_NTLD_FP From abused NTLD
 0.5 FROM_SUSPICIOUS_NTLD   From abused NTLD
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.1 (/)

--==-=-=
Content-Type: multipart/mixed; boundary="=-=-="

--=-=-=
Content-Type: text/plain

Customize 'outline-minor-mode-cycle' to t and enable outline-minor-mode.
Put point on a heading and TAB cycles visibility as expected. However,
disabling the minor mode, the keymap remains active and TAB still cycles
on this heading. I propose this patch to fix this.

--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline;
 filename=0001-Fix-deactivation-of-outline-cycle-bindings.patch
Content-Transfer-Encoding: quoted-printable

From=20ab15d70f3d8d182a44ea8797732c239aa9f7a8ae Mon Sep 17 00:00:00 2001
From: =3D?UTF-8?q?Miha=3D20Rihtar=3DC5=3DA1i=3DC4=3D8D?=3D <miha@kamnitnik.=
top>
Date: Fri, 19 Nov 2021 11:38:34 +0100
Subject: [PATCH] Fix deactivation of outline cycle bindings

* lisp/outline.el (outline-minor-mode):
(outline-font-lock-keywords): Don't modify the 'keymap' text property
directly.  Modify 'outline-cycle-keymap' property and have the minor
mode set it up as an alias to the 'keymap' property, or reset it on
deactivation.
=2D--
 lisp/outline.el | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/lisp/outline.el b/lisp/outline.el
index a4d2a3b7d7..e41ec364f4 100644
=2D-- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -226,9 +226,11 @@ outline-font-lock-keywords
                          (if outline-minor-mode-cycle
                              (if outline-minor-mode-highlight
                                  (list 'face (outline-font-lock-face)
=2D                                       'keymap outline-minor-mode-cycle-=
map)
+                                       'outline-cycle-keymap
+                                       outline-minor-mode-cycle-map)
                                (list 'face nil
=2D                                     'keymap outline-minor-mode-cycle-ma=
p))
+                                     'outline-cycle-keymap
+                                     outline-minor-mode-cycle-map))
                            (if outline-minor-mode-highlight
                                (list 'face (outline-font-lock-face))))
                        (outline-font-lock-face))
@@ -428,6 +430,11 @@ outline-minor-mode
           (if (and global-font-lock-mode (font-lock-specified-p major-mode=
))
               (progn
                 (font-lock-add-keywords nil outline-font-lock-keywords t)
+                (setq-local char-property-alias-alist
+                            (copy-alist char-property-alias-alist))
+                (cl-pushnew
+                 'outline-cycle-keymap
+                 (alist-get 'keymap char-property-alias-alist))
                 (font-lock-flush))
             (outline-minor-mode-highlight-buffer)))
 	;; Turn off this mode if we change major modes.
@@ -438,8 +445,10 @@ outline-minor-mode
 	;; Cause use of ellipses for invisible text.
 	(add-to-invisibility-spec '(outline . t)))
     (when (or outline-minor-mode-cycle outline-minor-mode-highlight)
=2D      (if font-lock-fontified
=2D          (font-lock-remove-keywords nil outline-font-lock-keywords))
+      (when font-lock-fontified
+        (font-lock-remove-keywords nil outline-font-lock-keywords)
+        (when-let ((as (assq 'keymap char-property-alias-alist)))
+          (setcdr as (remq 'outline-cycle-keymap (cdr as)))))
       (remove-overlays nil nil 'outline-overlay t)
       (font-lock-flush))
     (setq line-move-ignore-invisible nil)
=2D-=20
2.34.0


--=-=-=--

--==-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQJHBAEBCAAxFiEEmxVnesoT5rQXvVXnswkaGpIVmT8FAmGXjYUTHG1paGFAa2Ft
bml0bmlrLnRvcAAKCRCzCRoakhWZP9QmEAC6fBiV1ywpt6UWWpnfduXg0Z96B+xz
8djwzcG7qXvjwGwn/DpQAq3S+93k92BZJ4bWNi5J/5pYUWtBEMf02rGKLe+aTvY7
ZSari+9nD/cSiGR+pJMJZ88MgORKSgrMPYR1uaVmsIf15LWglZwgecO3XXGnaUtD
a0lsLtP9JILb2I+OfTfxjNz8DagsT4zHwNZOmb21JfJ5Lz6GvCpKaPoU6M+B3vLc
gq0CvfstiP26QNUiQI7bR4OlyPs4dmEd7FyaMNvKn/C3AfnLuJWqTYxxdSan5kq1
BKMsvDb3qv/Hv4l3wX+TCK1YfU04UrRUJiU9T3/XMOkYGHJz5Y1nqVSB14pjRQSq
+bJUrvFxw9K+BMrov7AGT8MpHdj32uCK8JPkey6EbW2owPqbGlbeYmlS5zcQet8T
HB0qhXMh9IAYMyY3HNRod/NSzjZux79Z5km5K7JNRQC7rhvTOCVZHzJuT3VHAnvf
3+AtRTd3xfwxAtbcj93mxTbXRNgEO5TbRg63HoR0Gp7OAFC0fEquKMaCvrNHLglu
XbrLipOR8BdAOmX9EyX46LB2PA51Pz7AGoVezRRjGH67DNZDaVDD4sogdAzlG9sx
7PWVumPVQW6BxPj4jKfJ4iKSAv4Cd0MkfHAMWNyfRqbvLjqz9xYQVYwwiQ5Ayo2o
JXMc8Yi1iKbdQg==
=dyhp
-----END PGP SIGNATURE-----
--==-=-=--




Acknowledgement sent to miha@HIDDEN:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#51974; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 20 Nov 2021 10:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.