unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Evgeni Pandurski <epandurski@gmail.com>
To: Juri Linkov <juri@linkov.net>
Cc: 60815@debbugs.gnu.org
Subject: bug#60815: 28.2; Hard-coded M-sff key binding in dired-aux.el
Date: Tue, 17 Jan 2023 21:01:43 +0200	[thread overview]
Message-ID: <CA+MLsgN4R5WZDDzMvcT+GpmdctxA5hXpiy8wrD3nerWAQdkOnQ@mail.gmail.com> (raw)
In-Reply-To: <86tu0p0zi3.fsf@mail.linkov.net>

Thanks.

The problem that remains is that I should do the equivalent of:

(define-key isearch-mode-map [f6] isearch-mode-search-map)
(define-key isearch-mode-map (kbd "M-s") other-window)

for several other minor (and probably some minor modes). To name a
few: minibuffer-local-map, Buffer-menu-mode-map, and dired-mode-map
all shadow my M-s redefinition, and I can not go to other window in
these modes. It would be very nice if those major modes are more
clever, clever when overriding global bindings.

On Tue, Jan 17, 2023 at 8:49 PM Juri Linkov <juri@linkov.net> wrote:
>
> reopen 60815
> thanks
>
> >> Then I guess this report can be closed, done.
> >
> > I think so. Your patch would allow me to just change the value of
> > dired-isearch-filenames-toggle-key, instead of monkey-patching the
> > whole function in my .emacs.
> >
> > But it seems that some key-bindings are much harder to change than
> > another. "M-s", is such an example, because many modes decide to
> > override it in their keymaps. Just an idea: Wouldn't it be nice, if
> > there were an configuration that defines what is the key sequence for
> > "the M-s search" (M-s by default), and if major modes want to override
> > the "M-s search commands", they would respect what the configuration
> > says.
>
> Indeed, there is already such variable: `search-map'.  So you can do:
>
>   (define-key global-map [f6] search-map)
>
> > For example, If I rebind "M-s" to say "M-6", then the
> > dired-isearch-filenames-setup function would define the "M-6ff"
> > binding, instead of "M-sff". I am not sure if this is a good idea, but
> > this seems like a good approach to me.
> >
> > So basically, I propose, instead of the
> > "dired-isearch-filenames-toggle-key" configuration ("M-sfff by
> > default), to have, say "global-search-key-sequence" ("M-s" by
> > default), which all major modes can use when building their local
> > keymaps. This way, I would not need to fix this binding in every major
> > mode which overrides it, wrongly believing that M-s is my "search
> > prefix".
>
> The problem is that isearch doesn't use the global "M-s" keymap,
> but hard-codes "M-s" used in isearch-map.  The patch below adds
> a new variable for the isearch's keymap "M-s" that you can
> customize with e.g.:
>
>   (define-key isearch-mode-map [f6] isearch-mode-search-map)
>
> Needless to say this patch is for master.
>





  reply	other threads:[~2023-01-17 19:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-14 16:44 bug#60815: 28.2; Hard-coded M-sff key binding in dired-aux.el Evgeni Pandurski
2023-01-14 18:14 ` Eli Zaretskii
     [not found]   ` <CA+MLsgOSFS0h45qMpDv3p8WFVpo3oju19uS49RvxfTMAmZRJ5Q@mail.gmail.com>
     [not found]     ` <CA+MLsgOj1qyYT0xrM9kWfTHuo_qxQ6czhGtUtqoc=GYV9Hwf-g@mail.gmail.com>
2023-01-14 18:52       ` Eli Zaretskii
2023-01-17 17:24         ` Juri Linkov
2023-01-17 18:30           ` Evgeni Pandurski
2023-01-17 18:43             ` Eli Zaretskii
     [not found]           ` <CA+MLsgMSDroUBLYfkwcDxyf6=jMSZR0NxZExuWSvrg07+uDrHA@mail.gmail.com>
2023-01-17 18:47             ` Juri Linkov
2023-01-17 19:01               ` Evgeni Pandurski [this message]
2023-01-17 19:27                 ` Juri Linkov
2023-01-17 19:44                   ` Evgeni Pandurski
2023-01-14 18:19 ` Juri Linkov

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=CA+MLsgN4R5WZDDzMvcT+GpmdctxA5hXpiy8wrD3nerWAQdkOnQ@mail.gmail.com \
    --to=epandurski@gmail.com \
    --cc=60815@debbugs.gnu.org \
    --cc=juri@linkov.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).