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: Sat, 20 Nov 2021 11:45:40 +0100 Message-ID: <87ilwnds17.fsf@miha-pc> References: <87lf1ke5iy.fsf@miha-pc> <87h7c7qhxv.fsf@gnus.org> Reply-To: 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="27357"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 51974@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 20 11:42:11 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 1moNow-0006vz-Ox for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 20 Nov 2021 11:42:11 +0100 Original-Received: from localhost ([::1]:46096 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1moNou-00028p-LR for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 20 Nov 2021 05:42:08 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:35796) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1moNoo-00028S-PQ for bug-gnu-emacs@gnu.org; Sat, 20 Nov 2021 05:42:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58519) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1moNoo-0000s6-HI for bug-gnu-emacs@gnu.org; Sat, 20 Nov 2021 05:42:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1moNoo-0006lP-Fa for bug-gnu-emacs@gnu.org; Sat, 20 Nov 2021 05:42:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 Nov 2021 10:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51974 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 51974-submit@debbugs.gnu.org id=B51974.163740487025920 (code B ref 51974); Sat, 20 Nov 2021 10:42:02 +0000 Original-Received: (at 51974) by debbugs.gnu.org; 20 Nov 2021 10:41:10 +0000 Original-Received: from localhost ([127.0.0.1]:41830 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1moNnv-0006jr-Ui for submit@debbugs.gnu.org; Sat, 20 Nov 2021 05:41:09 -0500 Original-Received: from kamnitnik.top ([209.250.245.214]:44686) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1moNnq-0006jW-P5 for 51974@debbugs.gnu.org; Sat, 20 Nov 2021 05:41:06 -0500 Original-Received: from localhost (BSN-77-156-43.static.siol.net [193.77.156.43]) by kamnitnik.top (Postfix) with ESMTPSA id 9500C9CFA8; Sat, 20 Nov 2021 10:41:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kamnitnik.top; s=mail; t=1637404861; bh=U0nCBOVM3GRt1cFUTShJtbsv1eQZVfNAN5Mjak92w1E=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=fsbizl2WoQPcT8XuQqBae0R0EecRO5hTwx2sMYgImtcAoYNJW/QYTnE15+Moeez2L FO8uBZeXK93UfKE672Lw42Pp7gfs/kCa/EKF0i+S0xkErNaCtXG2JB9YTY2kwgdQ4g Evx55MnxAn1HDA9Cg311YmiOcv1ea3goJknJ0p1YE7LfDqrPo8mciQwV7Z1ZedGW2u X6GfgT+yyk0HPe/431cxrz9MPHlMaxcxvYDhr+q8ES+6w0yXtTiq8vIu/7wUHH5XOg xn+1VUAeDsteCsW38wXwwxcVZInmXY2oq2XW/uqjU/Y6JlLCqTWH4QHSTwLTa1WiTG YwbBpAsBbEFaw== In-Reply-To: <87h7c7qhxv.fsf@gnus.org> 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:220490 Archived-At: --=-=-= Content-Type: text/plain Lars Ingebrigtsen writes: > miha@kamnitnik.top 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? We have, it's called 'font-lock-extra-managed-props'. Using it, we can do this in a simpler way: diff --git a/lisp/outline.el b/lisp/outline.el index a4d2a3b7d7..7f78c04866 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -427,6 +427,9 @@ outline-minor-mode (when (or outline-minor-mode-cycle outline-minor-mode-highlight) (if (and global-font-lock-mode (font-lock-specified-p major-mode)) (progn + (when outline-minor-mode-cycle + (add-to-list 'font-lock-extra-managed-props 'keymap + nil #'eq)) (font-lock-add-keywords nil outline-font-lock-keywords t) (font-lock-flush)) (outline-minor-mode-highlight-buffer))) This has a small disadvantage: deactivating outline-minor-mode will remove all 'keymap' text properties from the whole buffer, even if they are added by other minor or major modes or whatever. With 'char-property-alias-alist', we can create a sort of namespacing to ensure that outline-minor-mode messes only with its own text properties. 'font-lock-mode' minor mode modifies 'char-property-alias-alist' in a similar way for a similar reason. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJHBAEBCAAxFiEEmxVnesoT5rQXvVXnswkaGpIVmT8FAmGY0dQTHG1paGFAa2Ft bml0bmlrLnRvcAAKCRCzCRoakhWZPzuUEAC6MBUT/N650ksoxL8F//Azv5Cffj00 bNZLXWA3eeInvbErhIiLBtehgmw/W09u9TVXnyyfkTCov4cG46Kz/U4t8c+uquHh QuMM/x5cKn2SfyVEqPXbvwtnuoVw89NuepvrB4hiIfgOI1+f1MVIbRQE4e9IRyUG +FmWWTTW53qWNQ2it5gbmfROCKz24tLvZHf1qWqUZp/7lFNvaS54zjyXrzvZJ9P1 ofgy5T+z783jAuusOo2qWg4VK7sj0tIiSEaTtX9pcJ2RJLX+N+069nc40avG7LSQ kwd80aMo/vWnKxnGg22kr3EcYVzPpUglOCShqLiV4wqkc5RWObk4P6503sCacPaw XMLGih0trn1YvRVhJmsKqgEwrH5ERFNNs7c+8v66wOEDwmrZzMdWf9CHVOCE1JO4 oFoKE9w1nqPMcwwqoQBbN3lZrybUHACjzNSxkLyMN+NbLNyehkjLRPk/x8De0FZj 7DqoAcCh95ySH7rcqdu6dhPrfbmyIBHxNTLexXIoPAj1J8SJDaU3IX4QZAoy97d/ zxZmXgQhkwB28v+B/ctubETzckPdbUZI9dmC+GKj6TFiBuaqH3yMF6r5Qlw5WvZ3 WcS4SCvVym3nz1xcr4DF3cBIvoVXk2U7y/5W2e2wkgchP2r488bTBLLGBfSuDh0u XSOFpkPbeAozaw== =HmMI -----END PGP SIGNATURE----- --=-=-=--