From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kaushal Newsgroups: gmane.emacs.devel Subject: Re: Suggestion to have highlight related bindings consistent between search-map and hi-lock-map Date: Sat, 11 Jul 2015 18:50:17 +0000 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a114914ae4665d8051a9df6db X-Trace: ger.gmane.org 1436640639 25042 80.91.229.3 (11 Jul 2015 18:50:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 11 Jul 2015 18:50:39 +0000 (UTC) To: Emacs developers , juri@jurta.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 11 20:50:38 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZDzrB-0006EN-E6 for ged-emacs-devel@m.gmane.org; Sat, 11 Jul 2015 20:50:37 +0200 Original-Received: from localhost ([::1]:48811 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDzrA-0002H0-Ia for ged-emacs-devel@m.gmane.org; Sat, 11 Jul 2015 14:50:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39647) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDzr4-0002Gr-1y for emacs-devel@gnu.org; Sat, 11 Jul 2015 14:50:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZDzr2-0001fR-B1 for emacs-devel@gnu.org; Sat, 11 Jul 2015 14:50:29 -0400 Original-Received: from mail-yk0-x231.google.com ([2607:f8b0:4002:c07::231]:36573) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDzr2-0001fN-4F for emacs-devel@gnu.org; Sat, 11 Jul 2015 14:50:28 -0400 Original-Received: by ykay190 with SMTP id y190so10838941yka.3 for ; Sat, 11 Jul 2015 11:50:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-type; bh=kRDNBE1lMvV54d4p49/6g3kj32+wJ8IpufQ4/2XLOaY=; b=Q9T6TGFUpBj2S705gwXumSQWSKvkOVyAfJUohnuRhwhWqI8eCF7FuT5FC5lvZ4UOKD s/PNRSsw78HPWGA8osP9ldB/kkbHRYlf6C0QGh5EOvXyOLGyZuLK7E4w/VZa7UPdDS4Q NaqldurFk1UqkRuDLkvuK54fBNFH0aWm7NSFwVCEjNBpyZtRJLaV+FDSGGmx3mbC2wQo 5+hi2HJ53hZfVpwEUpfg+OcILmsKklUzam8CyPyLi6/n0cH66a3wQfqDxMdwh5kJLyXn KrWB8xzWy1tuQIbdhwNKMZLmbZ7dbhf4f6Lwt5NDwCh/rr/dwWoMpfo5qpTIb2K0wyeQ aBKA== X-Received: by 10.129.94.7 with SMTP id s7mr30565697ywb.111.1436640627547; Sat, 11 Jul 2015 11:50:27 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4002:c07::231 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:187806 Archived-At: --001a114914ae4665d8051a9df6db Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Adding Juri to the To: list (based on this commit: http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=3De5e4a94293d5a9a1575= 57e53b4fea4e5d280673e ) On Fri, Jul 10, 2015 at 3:02 PM Kaushal wrote: > 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=C2=B2~/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=C2=B2~/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) > > =E2=80=8BSome bindings are consistent but some are not. Here are the inco= nsistent > 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) ; n= o > 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. > =E2=80=8B > > |------------+-------------+---------------------+-----------------------= -------------| > | 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 > --001a114914ae4665d8051a9df6db Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Adding Juri to the To: list (based on this commit:=C2=A0http://git.savannah.gnu.org/cgit/emacs.git/= commit/?id=3De5e4a94293d5a9a157557e53b4fea4e5d280673e)

On Fri, Jul 10, 2015 at 3:02 PM Kaushal = <kaushal.modi@gmail.com>= ; wrote:
Hi,

I was trying to using t= he binding for highlight-regexp and I got confused if the prefix was "= C-x w r" or "M-s h r". I "grepping" (actually aggi= ng), 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 to= o).

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

k= m=C2=B2~/downloads/:git/emacs/lisp> ag 'define.*C\-xw'
hi-lock= .el
277: =C2=A0 =C2=A0(define-key map "\C-xwi" 'hi-lock-fin= d-patterns)
278: =C2=A0 =C2=A0(define-key map "\C-xwl" 'hig= hlight-lines-matching-regexp)
279: =C2=A0 =C2=A0(define-key map "\C-= xwp" 'highlight-phrase)
<= font face=3D"monospace, monospace">280: =C2=A0 =C2=A0(define-key map "= \C-xwh" 'highlight-regexp)
281: =C2=A0 =C2=A0(define-key map &qu= ot;\C-xw." 'highlight-symbol-at-point)
282: =C2=A0 =C2=A0(define= -key map "\C-xwr" 'unhighlight-regexp)
283: =C2=A0 =C2=A0(d= efine-key map "\C-xwb" 'hi-lock-write-interactive-patterns)

km=C2=B2~/downloads/:git/emacs/lisp> ag 'define.*search-map\= s+"h'
bindings.el
935:(define-key search-map "hf" = =C2=A0 'hi-lock-find-patterns)
932:(define-key search-map "hl&qu= ot; =C2=A0 'highlight-lines-matching-regexp)
931:(define-key search-m= ap "hp" =C2=A0 'highlight-phrase)
930:(define-key search-ma= p "hr" =C2=A0 'highlight-regexp)
933:(define-key search-map= "h." =C2=A0 'highlight-symbol-at-point)
934:(define-key se= arch-map "hu" =C2=A0 'unhighlight-regexp)
936:(define-key s= earch-map "hw" =C2=A0 'hi-lock-write-interactive-patterns)
=
=E2=80=8BSome bindings are consistent but some are not. Here are the= inconsistent ones:

hi-lock.el =C2=A0277: (define-key map =C2=A0 = =C2=A0 =C2=A0 =C2=A0"\C-xwi" 'hi-lock-find-patterns)
bindin= gs.el 935: (define-key search-map =C2=A0 =C2=A0 "hf" 'hi-lock= -find-patterns)

hi-lock.el =C2=A0282: (define-key map =C2=A0 =C2= =A0 =C2=A0 =C2=A0"\C-xwr" 'unhighlight-regexp)
bindings.el = 934: (define-key search-map =C2=A0 =C2=A0 "hu" 'unhighlight-r= egexp)

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

hi-lock.el =C2=A0283: (define-key map =C2=A0 =C2=A0 =C2=A0 =C2=A0"\C-= xwb" 'hi-lock-write-interactive-patterns)
bindings.el 936: (de= fine-key search-map =C2=A0 =C2=A0 "hw" 'hi-lock-write-interac= tive-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 =C2=A0277: (define-= key map =C2=A0 =C2=A0 =C2=A0 =C2=A0"\C-xwf" 'hi-lock-find-pat= terns) ; changed
bindings.el 935: (define-key search-map =C2=A0 =C2=A0 &q= uot;hf" 'hi-lock-find-patterns) ; no change

- Currently &= quot;C-x w u" is undefined; "u" for unhighlight
=
hi-lock.el= =C2=A0282: (define-key map =C2=A0 =C2=A0 =C2=A0 =C2=A0"\C-xwu" &= #39;unhighlight-regexp) ; changed
= bindings.el 934: (define-key search-map= =C2=A0 =C2=A0 "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 = =C2=A0280: (define-key map =C2=A0 =C2=A0 =C2=A0 =C2=A0"\C-xwr" &#= 39;highlight-regexp) ; changed
bindings.el 930: (define-key search-map = =C2=A0 =C2=A0 "hr" 'highlight-regexp) ; no change

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

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

--
Kaushal Modi
--001a114914ae4665d8051a9df6db--