bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#60815: 28.2; Hard-coded M-sff key binding in dired-aux.el


From: Evgeni Pandurski
Subject: bug#60815: 28.2; Hard-coded M-sff key binding in dired-aux.el
Date: Tue, 17 Jan 2023 21:01:43 +0200

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 via email to

[Prev in Thread] Current Thread [Next in Thread]