unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#25318: 24.5; Put `M-s' on a prefix keymap in Isearch
@ 2017-01-01  4:56 Drew Adams
  2019-09-29 17:37 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Drew Adams @ 2017-01-01  4:56 UTC (permalink / raw)
  To: 25318

Currently, `isearch-mode-map' has a number of key sequences bound in it
that begin with prefix-key `M-s':

M-s C-e		isearch-yank-line
M-s SPC		isearch-toggle-lax-whitespace
M-s '		isearch-toggle-char-fold
M-s _		isearch-toggle-symbol
M-s c		isearch-toggle-case-fold
M-s e		isearch-edit-string
M-s i		isearch-toggle-invisible
M-s o		isearch-occur
M-s r		isearch-toggle-regexp
M-s w		isearch-toggle-word
M-s h r		isearch-highlight-regexp

And 3rd-party libraries have added more such `M-s ...' keys.

But there is no keymap for prefix-key `M-s'.  There should be.

Please put all of the `M-s' prefixed keys on a separate, prefix-key
keymap, which itself is on `isearch-mode-map'.

Since these keys do not form any _specific_ grouping, I'd propose a
name for the keymap such as `isearch-misc-map' (better than nothing).

This will let users and other libraries move the prefix keymap to a
different prefix key if they want, or define `M-s C-h' to show only the
bindings on prefix `M-s', and so on.

As it stands now, a 3rd-party library cannot do what this bug report
requests, because there are likely other libraries, which may be loaded
before it, and which bind `M-s <whatever' directly in
`isearch-mode-map'.  Those bindings would be wiped out by a later
binding of `M-s' to a prefix map.

But if this is done in core Emacs then there will be no such problem
(there is no problem if a library binds `M-s <whatever>' directly in
`isearch-mode-map' AFTER the prefix map has been placed on
`isearch-mode-map).


In GNU Emacs 24.5.1 (i686-pc-mingw32)
 of 2015-04-11 on LEG570
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --prefix=/c/usr --host=i686-pc-mingw32'





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#25318: 24.5; Put `M-s' on a prefix keymap in Isearch
  2017-01-01  4:56 bug#25318: 24.5; Put `M-s' on a prefix keymap in Isearch Drew Adams
@ 2019-09-29 17:37 ` Lars Ingebrigtsen
  2019-09-29 18:45   ` Drew Adams
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Ingebrigtsen @ 2019-09-29 17:37 UTC (permalink / raw)
  To: Drew Adams; +Cc: 25318

Drew Adams <drew.adams@oracle.com> writes:

> Currently, `isearch-mode-map' has a number of key sequences bound in it
> that begin with prefix-key `M-s':
>
> M-s C-e		isearch-yank-line
> M-s SPC		isearch-toggle-lax-whitespace
> M-s '		isearch-toggle-char-fold
> M-s _		isearch-toggle-symbol
> M-s c		isearch-toggle-case-fold
> M-s e		isearch-edit-string
> M-s i		isearch-toggle-invisible
> M-s o		isearch-occur
> M-s r		isearch-toggle-regexp
> M-s w		isearch-toggle-word
> M-s h r		isearch-highlight-regexp

[...]

> Since these keys do not form any _specific_ grouping, I'd propose a
> name for the keymap such as `isearch-misc-map' (better than nothing).

As you point out, these commands aren't functional grouping of any kind,
so I don't think it makes sense to put them on a separate map.  It's not
like anybody would want to put all those functions somewhere else, which
is the primary reason to have sub-keymaps.

> This will let users and other libraries move the prefix keymap to a
> different prefix key if they want, or define `M-s C-h' to show only the
> bindings on prefix `M-s', and so on.
>
> As it stands now, a 3rd-party library cannot do what this bug report
> requests, because there are likely other libraries, which may be loaded
> before it, and which bind `M-s <whatever' directly in
> `isearch-mode-map'.  Those bindings would be wiped out by a later
> binding of `M-s' to a prefix map.
>
> But if this is done in core Emacs then there will be no such problem
> (there is no problem if a library binds `M-s <whatever>' directly in
> `isearch-mode-map' AFTER the prefix map has been placed on
> `isearch-mode-map).

So your use case is that you want to bind `M-s' to a prefix map
out-of-tree?  

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#25318: 24.5; Put `M-s' on a prefix keymap in Isearch
  2019-09-29 17:37 ` Lars Ingebrigtsen
@ 2019-09-29 18:45   ` Drew Adams
  2019-09-30  5:31     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Drew Adams @ 2019-09-29 18:45 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 25318

> > Currently, `isearch-mode-map' has a number of key sequences bound in it
> > that begin with prefix-key `M-s':...
> > Since these keys do not form any _specific_ grouping, I'd propose a
> > name for the keymap such as `isearch-misc-map' (better than nothing).
> 
> As you point out, these commands aren't functional grouping of any kind,
> so I don't think it makes sense to put them on a separate map.  It's not
> like anybody would want to put all those functions somewhere else, which
> is the primary reason to have sub-keymaps.

They are all on the same prefix key.  So yes, there is a good reason why someone might "want to put all those functions somewhere else": to put them on another prefix key.

That's the raison d'etre for a prefix-map variable: to be able to easily reuse or move all of its bindings at once, e.g. to another prefix key.

If there's a reason why each of the commands is on prefix key `M-s' then the same reason applies for putting them on another prefix key - move/reuse them all, together.

Whether one or more of those commands shouldn't really be on the same prefix key is a separate question, for the maintainers of isearch.el to consider.  It's unrelated to the need/desire to grab put all of the `M-s' commands on another (additional or replacement) prefix key.

> > This will let users and other libraries move the prefix keymap to a
> > different prefix key if they want, or define `M-s C-h' to show only the
> > bindings on prefix `M-s', and so on.

Clear, no?  Both the 1st part and the 2nd, regarding `M-s C-h'.  The desire to offer `M-s C-h' is an additional reason to add a prefix-key variable for prefix key `M-s'.

> > As it stands now, a 3rd-party library cannot do what this bug report
> > requests, because there are likely other libraries, which may be loaded
> > before it, and which bind `M-s <whatever' directly in
> > `isearch-mode-map'.  Those bindings would be wiped out by a later
> > binding of `M-s' to a prefix map.

Also clear, no?

> > But if this is done in core Emacs then there will be no such problem
> > (there is no problem if a library binds `M-s <whatever>' directly in
> > `isearch-mode-map' AFTER the prefix map has been placed on
> > `isearch-mode-map).
> 
> So your use case is that you want to bind `M-s' to a prefix map
> out-of-tree?

Sorry, I don't know what "out-of-tree" means.

See above for the reasons for this request.  It's not about wanting to bind `M-s'.  It's about wanting to bind another prefix key.  And it's about providing `M-s C-h'.  The prefix key should have a keymap, usable by users and libraries.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#25318: 24.5; Put `M-s' on a prefix keymap in Isearch
  2019-09-29 18:45   ` Drew Adams
@ 2019-09-30  5:31     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2019-09-30  5:31 UTC (permalink / raw)
  To: Drew Adams; +Cc: 25318

Drew Adams <drew.adams@oracle.com> writes:

> See above for the reasons for this request.  It's not about wanting to
> bind `M-s'.  It's about wanting to bind another prefix key.  And it's
> about providing `M-s C-h'.  The prefix key should have a keymap,
> usable by users and libraries.

Sorry; I don't see the use case since these commands have very little to
do with each other.  Closing.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-09-30  5:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-01  4:56 bug#25318: 24.5; Put `M-s' on a prefix keymap in Isearch Drew Adams
2019-09-29 17:37 ` Lars Ingebrigtsen
2019-09-29 18:45   ` Drew Adams
2019-09-30  5:31     ` Lars Ingebrigtsen

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).