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: Sun, 12 Jul 2015 09:21:11 -0400 Message-ID: References: <874mlaearx.fsf@mail.linkov.net> <55A21229.6080903@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a114e6f069c17f5051aad7a46 X-Trace: ger.gmane.org 1436707290 12713 80.91.229.3 (12 Jul 2015 13:21:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 12 Jul 2015 13:21:30 +0000 (UTC) Cc: Emacs developers To: vaidheeswaran.chinnaraju@gmail.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 12 15:21:29 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 1ZEHCD-0005xF-0y for ged-emacs-devel@m.gmane.org; Sun, 12 Jul 2015 15:21:29 +0200 Original-Received: from localhost ([::1]:50812 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEHCC-0006UO-9V for ged-emacs-devel@m.gmane.org; Sun, 12 Jul 2015 09:21:28 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36912) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEHBy-0006Te-He for emacs-devel@gnu.org; Sun, 12 Jul 2015 09:21:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZEHBx-0005sd-0m for emacs-devel@gnu.org; Sun, 12 Jul 2015 09:21:14 -0400 Original-Received: from mail-yk0-x234.google.com ([2607:f8b0:4002:c07::234]:33625) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEHBw-0005sZ-R9 for emacs-devel@gnu.org; Sun, 12 Jul 2015 09:21:12 -0400 Original-Received: by ykeo3 with SMTP id o3so175749032yke.0 for ; Sun, 12 Jul 2015 06:21:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=YQWcNh0FJnkY0OBtz+lXk3jac9Gjb2zatwPmpy8igwU=; b=kbCMTq3PkDMCUUF1hyMfEz1mlvdEI+WpopNZXpkcK6/3Nd1gfYr0N+En5v4sfMoxyr 4cl0UhbkCTD1Xsn/9eO8pBImog6D80CyoFlFIcd7MmSxOSzxV76v6G09FKr2Qy9KRlWv Grzz5UCfIhzvfaFZeRwnoW/9FAbjU3BKvjHxALskpnTmtbMZr5h911fSu6F6JjZ4Gz3Y o7hALe/MxH94xbWpkldtzdZNkY3JmevLydjPY1uuNLbiwJVYDxKdaYc++8/ftl/7gr67 B8F8q1HQCcQ6IJLVgQMIl+k9ExoipgWAwEDmSgycpkrTjjVBcFnxz0Zz8xcPa49EcjLP 2N7g== X-Received: by 10.13.203.143 with SMTP id n137mr13064683ywd.109.1436707272265; Sun, 12 Jul 2015 06:21:12 -0700 (PDT) Original-Received: by 10.13.253.5 with HTTP; Sun, 12 Jul 2015 06:21:11 -0700 (PDT) Original-Received: by 10.13.253.5 with HTTP; Sun, 12 Jul 2015 06:21:11 -0700 (PDT) In-Reply-To: <55A21229.6080903@gmail.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4002:c07::234 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:187817 Archived-At: --001a114e6f069c17f5051aad7a46 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable @Vaidheeswaran I am more interested in having the bindings be consistent. If people are used to the C-x w prefix and the consensus is to keep it, I'll respect the democracy. Here is the reasoning for the proposed changes especially for `highlight-regexp` and `unhighlight-regexp`. I understood that currently `highlight-regexp` is bound to "C-x w h" where `h` stands for Highlight. But then the same was bound to `M-s h r` in the other prefix map. I could confuse which prefix had the `r` binding to highlight Regexp and could end up doing "C-x w r"! (in which case `r` stands for Removing highlights). Why should we have a key do polar opposite stuff in two keymaps? So I surveyed the existing bindings in C-x w keymap: h -> [h]ighlight-regexp r -> unhighlight-regexp ([r]remove) . -> highlight-symbol-at-[point] On the other hand, in M-s h map: h -> nil r -> highlight-[r]egexp u -> [u]nhighlight-regexp . -> highlight-symbol-at-[point] To me, the M-s h map seemed to have more harmony as the h binding wasn't used up to bind anything because we have a couple of highlighting function (regexp, symbol at point). Also, even if r for remove makes sense in C-x w map, remove isn't part of the function name (whereas u for unhighlight is). And lastly, the h in M-s h also makes sense.. every binding in M-s h has to do with Highlighting. M-s h r will Highlight Regexp M-s h . will Highlight symbol at . M-s h u will Un-Highlight regexp .. and so on I realize that these bindings changes I suggest are trivial. One can argue that why not just rebind them in your init. But why not make them consistent so that they are easy to adopt without confusion for anyone them for the first time? Why should there be an extra effort to remember that r in C-x w r removes highlight whereas r in M-s h r highlights regexp? If and when this consistency change is made, existing users can simply relearn them if they are used to the other way or choose them rebind to the bindings they are already used to. -- Kaushal Modi On Jul 12, 2015 3:07 AM, "Vaidheeswaran C" < vaidheeswaran.chinnaraju@gmail.com> wrote: > On Sunday 12 July 2015 01:18 AM, Juri Linkov wrote: > > > And maybe we could just remove the duplicate keymap =E2=80=98C-x w=E2= =80=99 > > altogether > > When this happens please make the prefix configurable, much like what > outline minor mode does. > > Hide Outline Minor Mode Prefix: @ > State : STANDARD. > Prefix key to use for Outline commands in Outline minor mode. Hide > The value of this variable is checked as part of loading Outline mode. > After that, changing the prefix key requires manipulating keymaps. > > C-x w is what I am used to and there is NOT an emacs session where I > DO NOT use this binding. M-s interface and bindings still confuse me. > > ps: `r' stands for REMOVING highlights. > > --001a114e6f069c17f5051aad7a46 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

@Vaidheeswaran

I am more interested in having the bindings be consistent. I= f people are used to the C-x w prefix and the consensus is to keep it, I= 9;ll respect the democracy.

Here is the reasoning for the proposed changes especially fo= r `highlight-regexp` and `unhighlight-regexp`.

I understood that currently `highlight-regexp` is bound to &= quot;C-x w h" where `h` stands for Highlight. But then the same was bo= und to `M-s h r` in the other prefix map.

I could confuse which prefix had the `r` binding to highligh= t Regexp and could end up doing "C-x w r"! (in which case `r` sta= nds for Removing highlights). Why should we have a key do polar opposite st= uff in two keymaps?

So I surveyed the existing bindings in C-x w keymap:

h -> [h]ighlight-regexp
r -> unhighlight-regexp ([r]remove)
. -> highlight-symbol-at-[point]

On the other hand, in M-s h map:

h -> nil
r -> highlight-[r]egexp
u -> [u]nhighlight-regexp
. -> highlight-symbol-at-[point]

To me, the M-s h map seemed to have more harmony as the h bi= nding wasn't used up to bind anything because we have a couple of highl= ighting function (regexp, symbol at point). Also, even if r for remove make= s sense in C-x w map, remove isn't part of the function name (whereas u= for unhighlight is).

And lastly, the h in M-s h also makes sense.. every binding = in M-s h has to do with Highlighting.

M-s h r will Highlight Regexp
M-s h . will Highlight symbol at .
M-s h u will Un-Highlight regexp
.. and so on

I realize that these bindings changes I suggest are trivial.= One can argue that why not just rebind them in your init. But why not make= them consistent so that they are easy to adopt without confusion for anyon= e them for the first time? Why should there be an extra effort to remember = that r in C-x w r removes highlight whereas r in M-s h r highlights regexp?=

If and when this consistency change is made, existing users = can simply relearn them if they are used to the other way or choose them re= bind to the bindings they are already used to.

--
Kaushal Modi

On Jul 12, 2015 3:07 AM, "Vaidheeswaran C&q= uot; <vaidheeswara= n.chinnaraju@gmail.com> wrote:
On Sunday 12 July 2015 01:18 AM, Juri Linkov wrote:

> And maybe we could just remove the duplicate keymap =E2=80=98C-x w=E2= =80=99
> altogether

When this happens please make the prefix configurable, much like what
outline minor mode does.

Hide Outline Minor Mode Prefix:=C2=A0 @
=C2=A0 =C2=A0 State : STANDARD.
=C2=A0 =C2=A0Prefix key to use for Outline commands in Outline minor mode. = Hide
=C2=A0 =C2=A0The value of this variable is checked as part of loading Outli= ne mode.
=C2=A0 =C2=A0After that, changing the prefix key requires manipulating keym= aps.

C-x w is what I am used to and there is NOT an emacs session where I
DO NOT use this binding.=C2=A0 M-s interface and bindings still confuse me.=

ps: `r' stands for REMOVING highlights.

--001a114e6f069c17f5051aad7a46--