all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Alexandrov <dag@gnui.org>
To: Tomas Nordin <tomasn@posteo.net>
Cc: help-gnu-emacs@gnu.org
Subject: Re: diff-goto-source hi-jacks my M-o
Date: Tue, 07 Jul 2020 00:46:49 +0300	[thread overview]
Message-ID: <o8osxqnq.dag@gnui.org> (raw)
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")

[-- Attachment #1: Type: text/plain, Size: 1527 bytes --]

Tomas Nordin <tomasn@posteo.net> wrote:
> Dmitry Alexandrov <dag@gnui.org> writes:
>> I am not sure, what ‘dummy’ is supposed to mean here?  Minor 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 just to keep a key binding available in all situations.

No, itʼs not required there, you are free to enable ‘my-precious-keys-map’ 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 — 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 didn'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 BODY)
|
| ‹…›
|
| Optional INIT-VALUE is the initial value of the mode’s variable.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

  reply	other threads:[~2020-07-06 21:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-05 15:55 diff-goto-source hi-jacks my M-o Tomas Nordin
2020-07-05 20:39 ` Tomas Nordin
2020-07-06  2:20 ` Dmitry Alexandrov
2020-07-06 10:27   ` Tomas Nordin
2020-07-06 19:37     ` Dmitry Alexandrov
2020-07-06 20:07       ` Tomas Nordin
2020-07-06 21:46         ` Dmitry Alexandrov [this message]
2020-12-27 15:09           ` Tomas Nordin
2020-12-27 17:29             ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-12-28 16:41               ` Tomas Nordin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=o8osxqnq.dag@gnui.org \
    --to=dag@gnui.org \
    --cc=help-gnu-emacs@gnu.org \
    --cc=tomasn@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.