unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Suggestion to have highlight related bindings consistent between search-map and hi-lock-map
@ 2015-07-10 19:02 Kaushal
  2015-07-11 18:50 ` Kaushal
  2015-07-15 15:44 ` David Koppelman
  0 siblings, 2 replies; 27+ messages in thread
From: Kaushal @ 2015-07-10 19:02 UTC (permalink / raw)
  To: Emacs developers

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

Hi,

I was trying to using the binding for highlight-regexp and I got confused
if the prefix was "C-x w r" or "M-s h r". I "grepping" (actually agging), I
found that below are the ONLY bindings that begin with "C-x w .." and "M-s
h .." (with the exact same number of bindings too).

Can we make the bindings consistent so that it doesn't matter is the user
is using "C-x w" or "M-s h"?

km²~/downloads/:git/emacs/lisp> ag 'define.*C\-xw'
hi-lock.el
277:    (define-key map "\C-xwi" 'hi-lock-find-patterns)
278:    (define-key map "\C-xwl" 'highlight-lines-matching-regexp)
279:    (define-key map "\C-xwp" 'highlight-phrase)
280:    (define-key map "\C-xwh" 'highlight-regexp)
281:    (define-key map "\C-xw." 'highlight-symbol-at-point)
282:    (define-key map "\C-xwr" 'unhighlight-regexp)
283:    (define-key map "\C-xwb" 'hi-lock-write-interactive-patterns)

km²~/downloads/:git/emacs/lisp> ag 'define.*search-map\s+"h'
bindings.el
935:(define-key search-map "hf"   'hi-lock-find-patterns)
932:(define-key search-map "hl"   'highlight-lines-matching-regexp)
931:(define-key search-map "hp"   'highlight-phrase)
930:(define-key search-map "hr"   'highlight-regexp)
933:(define-key search-map "h."   'highlight-symbol-at-point)
934:(define-key search-map "hu"   'unhighlight-regexp)
936:(define-key search-map "hw"   'hi-lock-write-interactive-patterns)

​Some bindings are consistent but some are not. Here are the inconsistent
ones:

hi-lock.el  277: (define-key map        "\C-xwi" 'hi-lock-find-patterns)
bindings.el 935: (define-key search-map     "hf" 'hi-lock-find-patterns)

hi-lock.el  282: (define-key map        "\C-xwr" 'unhighlight-regexp)
bindings.el 934: (define-key search-map     "hu" 'unhighlight-regexp)

hi-lock.el  280: (define-key map        "\C-xwh" 'highlight-regexp)
bindings.el 930: (define-key search-map     "hr" 'highlight-regexp)

hi-lock.el  283: (define-key map        "\C-xwb"
'hi-lock-write-interactive-patterns)
bindings.el 936: (define-key search-map     "hw"
'hi-lock-write-interactive-patterns)

*** Here are my suggested consistent bindings to fix the inconsistent ones:
***

- Currently "C-x w f" is undefined; "f" for find patterns
hi-lock.el  277: (define-key map        "\C-xwf" 'hi-lock-find-patterns) ;
changed
bindings.el 935: (define-key search-map     "hf" 'hi-lock-find-patterns) ;
no change

- Currently "C-x w u" is undefined; "u" for unhighlight
hi-lock.el  282: (define-key map        "\C-xwu" 'unhighlight-regexp) ;
changed
bindings.el 934: (define-key search-map     "hu" 'unhighlight-regexp) ; no
change

- "C-x w r" which was earlier bound to unhighlight-regexp should now be
bound to highlight-regexp; "r" for regexp
hi-lock.el  280: (define-key map        "\C-xwr" 'highlight-regexp) ;
changed
bindings.el 930: (define-key search-map     "hr" 'highlight-regexp) ; no
change

- Currently "C-x w w" is undefined; "w" for write interactive patterns
hi-lock.el  283: (define-key map        "\C-xww"
'hi-lock-write-interactive-patterns) ; changed
bindings.el 936: (define-key search-map     "hw"
'hi-lock-write-interactive-patterns) ; no change

Well.. turns out only 4 bindings need to change in hi-lock.el to make these
consistent.
​
|------------+-------------+---------------------+------------------------------------|
| search-map | hi-lock-map | last key in binding | function
          |
|------------+-------------+---------------------+------------------------------------|
| M-s h      | C-x w       | l                   |
highlight-lines-matching-regexp    |
| M-s h      | C-x w       | p                   | highlight-phrase
          |
| M-s h      | C-x w       | .                   |
highlight-symbol-at-point          |
|------------+-------------+---------------------+------------------------------------|
| M-s h      | C-x w       | f                   | hi-lock-find-patterns
           |
| M-s h      | C-x w       | u                   | unhighlight-regexp
          |
| M-s h      | C-x w       | r                   | highlight-regexp
          |
| M-s h      | C-x w       | w                   |
hi-lock-write-interactive-patterns |
|------------+-------------+---------------------+------------------------------------|

--
Kaushal Modi

[-- Attachment #2: Type: text/html, Size: 11430 bytes --]

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

end of thread, other threads:[~2016-02-07 19:23 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-10 19:02 Suggestion to have highlight related bindings consistent between search-map and hi-lock-map Kaushal
2015-07-11 18:50 ` Kaushal
2015-07-11 19:48   ` Juri Linkov
2015-07-11 19:51     ` Kaushal
2015-07-12  7:07     ` Vaidheeswaran C
2015-07-12 13:21       ` Kaushal
2015-07-12 14:48         ` Vaidheeswaran C
2015-07-12 14:48         ` Vaidheeswaran C
2015-07-12 15:15           ` Eli Zaretskii
2015-07-12 15:33             ` Vaidheeswaran C
2015-07-12 16:25               ` Eli Zaretskii
2015-07-12 16:41                 ` Kaushal
2015-07-19  7:59                 ` Vaidheeswaran C
2015-07-29  2:00                   ` Kaushal
2015-07-29 22:31                     ` Juri Linkov
2015-07-30 22:48                       ` Stefan Monnier
2015-07-31  1:32                         ` Kaushal
2015-08-18 16:22                           ` Kaushal
2015-08-19 22:23                             ` Juri Linkov
2015-08-20  1:09                               ` Kaushal
2016-02-02 20:45                                 ` Kaushal Modi
2016-02-05  0:54                                   ` Juri Linkov
2016-02-05  1:48                                     ` John Wiegley
2016-02-05 17:00                                       ` Kaushal Modi
2016-02-07 17:57                                         ` John Wiegley
2016-02-07 19:23                                           ` Alan Mackenzie
2015-07-15 15:44 ` David Koppelman

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