From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: miha--- via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#51974: 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> Reply-To: miha@kamnitnik.top Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26717"; mail-complaints-to="usenet@ciao.gmane.io" To: 51974@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 19 12:40:31 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mo2Fq-0006pl-CC for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 19 Nov 2021 12:40:30 +0100 Original-Received: from localhost ([::1]:48376 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mo2Fp-0007B1-48 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 19 Nov 2021 06:40:29 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:52168) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mo2DY-00057C-0N for bug-gnu-emacs@gnu.org; Fri, 19 Nov 2021 06:38:08 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54924) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mo2DT-0006vf-0N for bug-gnu-emacs@gnu.org; Fri, 19 Nov 2021 06:38:07 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mo2DS-0006Ch-M7 for bug-gnu-emacs@gnu.org; Fri, 19 Nov 2021 06:38:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: miha@kamnitnik.top Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 19 Nov 2021 11:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 51974 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.163732184923790 (code B ref -1); Fri, 19 Nov 2021 11:38:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Nov 2021 11:37:29 +0000 Original-Received: from localhost ([127.0.0.1]:38237 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mo2Cv-0006Be-1W for submit@debbugs.gnu.org; Fri, 19 Nov 2021 06:37:29 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:46784) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mo2Ct-0006BW-Pq for submit@debbugs.gnu.org; Fri, 19 Nov 2021 06:37:28 -0500 Original-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 ) id 1mo2Ct-0004sa-K2 for bug-gnu-emacs@gnu.org; Fri, 19 Nov 2021 06:37:27 -0500 Original-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 ) id 1mo2Cr-0006sI-Cf for bug-gnu-emacs@gnu.org; Fri, 19 Nov 2021 06:37:26 -0500 Original-Received: from localhost (BSN-77-156-43.static.siol.net [193.77.156.43]) by kamnitnik.top (Postfix) with ESMTPSA id 6E35B9CFA8 for ; 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== Received-SPF: pass client-ip=209.250.245.214; envelope-from=miha@kamnitnik.top; 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:220407 Archived-At: --==-=-= 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 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----- --==-=-=--