From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Alexandrov Newsgroups: gmane.emacs.help Subject: Re: diff-goto-source hi-jacks my M-o Date: Tue, 07 Jul 2020 00:46:49 +0300 Message-ID: References: <87imf2gdnp.fsf@fliptop.i-did-not-set--mail-host-address--so-tickle-me> <87y2nx5472.fsf@fliptop.i-did-not-set--mail-host-address--so-tickle-me> <87pn985rwz.fsf@fliptop.i-did-not-set--mail-host-address--so-tickle-me> 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="40287"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Tomas Nordin Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jul 06 23:48:51 2020 Return-path: Envelope-to: geh-help-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 1jsYyo-000ANO-Ka for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 06 Jul 2020 23:48:50 +0200 Original-Received: from localhost ([::1]:43056 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jsYyn-0001A6-CS for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 06 Jul 2020 17:48:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37460) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jsYwz-00019k-Tk for help-gnu-emacs@gnu.org; Mon, 06 Jul 2020 17:46:57 -0400 Original-Received: from relay-1.mailobj.net ([213.182.54.6]:46512) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jsYwx-0005Ne-PM for help-gnu-emacs@gnu.org; Mon, 06 Jul 2020 17:46:57 -0400 Original-Received: from v-1c.localdomain (unknown [192.168.90.161]) by relay-1.mailobj.net (Postfix) with SMTP id DE2161245; Mon, 6 Jul 2020 23:46:52 +0200 (CEST) Original-Received: by mail-1.net-c.com [213.182.54.15] with ESMTP Mon, 6 Jul 2020 23:46:52 +0200 (CEST) X-EA-Auth: f4u6L93hfQsADD2n58GY4VqnFfbUu3Ld0gn90OZ5n/Wo65QXSzm7ohgtiC62U/CS+BlPzZcfHzUOU3DgcIRdaL+0qJ+4dKdC In-Reply-To: <87pn985rwz.fsf@fliptop.i-did-not-set--mail-host-address--so-tickle-me> (Tomas Nordin's message of "Mon, 06 Jul 2020 22:07:08 +0200") OpenPGP: id=525F7E60AD812C2361752BB4C8B0F8548EE7F3E7; url=https://openpgpkey.gnui.org/.well-known/openpgpkey/gnui.org/hu/hr4k5tkxm6shwdc18su4bkm34w3dctjd Mail-Copies-To: always Received-SPF: pass client-ip=213.182.54.6; envelope-from=dag@gnui.org; helo=relay-1.mailobj.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/06 17:46:53 X-ACL-Warn: Detected OS = Linux 3.1-3.10 X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:123521 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Tomas Nordin wrote: > Dmitry Alexandrov writes: >> I am not sure, what =E2=80=98dummy=E2=80=99 is supposed to mean here? M= inor mode is fully functional, that is you are free to disable and reenable= it at will: > > I think I sort of tried to be funny, based on that the mode was made up j= ust to keep a key binding available in all situations. No, it=CA=BCs not required there, you are free to enable =E2=80=98my-precio= us-keys-map=E2=80=99 unconditionally as well: (add-to-list 'emulation-mode-map-alists (list (cons t my-precious-keys-map))) if you feel that you will never need to suspend it. > And that the trickery with the key-maps is hard to follow for me. There is no any trickery, just a hardcoded priority order in Emacs itself: = global map is overridden by major mode map, which in turn is overridden by = minor mode maps, which can be overridden by emulation mode maps. That is, using a minor mode map would suffice in your specific case =E2=80= =94 about M-o in diff-mode. But so would a mere: (with-eval-after-load 'diff-mode (define-key diff-mode-map (kbd "M-o") nil)) ; also on RET, o, C-c C-c, which is more than enough > I got the impression that it sufficed to evaluate the forms, I mean, I di= dn't say, M-x my-precious-keys-mode . >>>> (define-minor-mode my-precious-keys-mode "" t) | (define-minor-mode MODE DOC &optional INIT-VALUE LIGHTER KEYMAP &rest BOD= Y) | | =E2=80=B9=E2=80=A6=E2=80=BA | | Optional INIT-VALUE is the initial value of the mode=E2=80=99s variable. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIMEARYIACsWIQRSX35grYEsI2F1K7TIsPhUjufz5wUCXwObyQ0cZGFnQGdudWku b3JnAAoJEMiw+FSO5/Pnyn0A/Rn6s3nEcwePbJwp3Kg+JCdYJXmu+VaknpGTluUN 0fWwAP4gf3nAhEdXrltuWg508D2CDwuyPlsWIPGfViL6usk/DA== =dQUG -----END PGP SIGNATURE----- --=-=-=--