From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Koppelman Newsgroups: gmane.emacs.devel Subject: Re: Suggestion to have highlight related bindings consistent between search-map and hi-lock-map Date: Wed, 15 Jul 2015 10:44:14 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1436975094 23851 80.91.229.3 (15 Jul 2015 15:44:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 15 Jul 2015 15:44:54 +0000 (UTC) Cc: Emacs developers To: Kaushal Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 15 17:44: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 1ZFOrN-0006Z6-5v for ged-emacs-devel@m.gmane.org; Wed, 15 Jul 2015 17:44:37 +0200 Original-Received: from localhost ([::1]:36440 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFOrM-0002lE-LD for ged-emacs-devel@m.gmane.org; Wed, 15 Jul 2015 11:44:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56988) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFOr8-0002iD-BA for emacs-devel@gnu.org; Wed, 15 Jul 2015 11:44:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZFOr4-0007qO-5y for emacs-devel@gnu.org; Wed, 15 Jul 2015 11:44:22 -0400 Original-Received: from email.ece.lsu.edu ([130.39.16.7]:44747) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFOr3-0007pW-Vy for emacs-devel@gnu.org; Wed, 15 Jul 2015 11:44:18 -0400 Original-Received: from sky.ece.lsu.edu (unknown [130.39.148.12]) (using TLSv1.1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by email.ece.lsu.edu (Postfix) with ESMTPS id 199ACC8003F; Wed, 15 Jul 2015 10:44:15 -0500 (CDT) In-Reply-To: (Kaushal's message of "Fri, 10 Jul 2015 15:02:43 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 130.39.16.7 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:187884 Archived-At: The change is fine with me, the consistency makes sense. (I don't use the default hi-lock bindings anyway.) David Kaushal writes: > 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"? > kmA^2~/downloads/:git/emacs/lisp> ag 'define.*C\-xw' > hi-lock.el > 277: A A (define-key map "\C-xwi" 'hi-lock-find-patterns) > 278: A A (define-key map "\C-xwl" 'highlight-lines-matching-regexp) > 279: A A (define-key map "\C-xwp" 'highlight-phrase) > 280: A A (define-key map "\C-xwh" 'highlight-regexp) > 281: A A (define-key map "\C-xw." 'highlight-symbol-at-point) > 282: A A (define-key map "\C-xwr" 'unhighlight-regexp) > 283: A A (define-key map "\C-xwb" 'hi-lock-write-interactive-patterns) > kmA^2~/downloads/:git/emacs/lisp> ag 'define.*search-map\s+"h' > bindings.el > 935:(define-key search-map "hf" A 'hi-lock-find-patterns) > 932:(define-key search-map "hl" A 'highlight-lines-matching-regexp) > 931:(define-key search-map "hp" A 'highlight-phrase) > 930:(define-key search-map "hr" A 'highlight-regexp) > 933:(define-key search-map "h." A 'highlight-symbol-at-point) > 934:(define-key search-map "hu" A 'unhighlight-regexp) > 936:(define-key search-map "hw" A 'hi-lock-write-interactive-patterns) > a**Some bindings are consistent but some are not. Here are the > inconsistent ones: > hi-lock.el A 277: (define-key map A A A A "\C-xwi" > 'hi-lock-find-patterns) > bindings.el 935: (define-key search-map A A "hf" 'hi-lock-find-patterns) > hi-lock.el A 282: (define-key map A A A A "\C-xwr" 'unhighlight-regexp) > bindings.el 934: (define-key search-map A A "hu" 'unhighlight-regexp) > hi-lock.el A 280: (define-key map A A A A "\C-xwh" 'highlight-regexp) > bindings.el 930: (define-key search-map A A "hr" 'highlight-regexp) > hi-lock.el A 283: (define-key map A A A A "\C-xwb" > 'hi-lock-write-interactive-patterns) > bindings.el 936: (define-key search-map A A "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 A 277: (define-key map A A A A "\C-xwf" > 'hi-lock-find-patterns) ; changed > bindings.el 935: (define-key search-map A A "hf" 'hi-lock-find-patterns) > ; no change > - Currently "C-x w u" is undefined; "u" for unhighlight > hi-lock.el A 282: (define-key map A A A A "\C-xwu" 'unhighlight-regexp) > ; changed > bindings.el 934: (define-key search-map A A "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 A 280: (define-key map A A A A "\C-xwr" 'highlight-regexp) ; > changed > bindings.el 930: (define-key search-map A A "hr" 'highlight-regexp) ; no > change > - Currently "C-x w w" is undefined; "w" for write interactive patterns > hi-lock.el A 283: (define-key map A A A A "\C-xww" > 'hi-lock-write-interactive-patterns) ; changed > bindings.el 936: (define-key search-map A A "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. > a** > |------------+-------------+---------------------+------------------------------------| > | search-map | hi-lock-map | last key in binding | function A A A A A > A A A A A A A A | > |------------+-------------+---------------------+------------------------------------| > | M-s h A A A | C-x w A A A | l A A A A A A A A A | > highlight-lines-matching-regexp A A | > | M-s h A A A | C-x w A A A | p A A A A A A A A A | > highlight-phrase A A A A A A A A A | > | M-s h A A A | C-x w A A A | . A A A A A A A A A | > highlight-symbol-at-point A A A A A | > |------------+-------------+---------------------+------------------------------------| > | M-s h A A A | C-x w A A A | f A A A A A A A A A | > hi-lock-find-patterns A A A A A A A | > | M-s h A A A | C-x w A A A | u A A A A A A A A A | > unhighlight-regexp A A A A A A A A | > | M-s h A A A | C-x w A A A | r A A A A A A A A A | > highlight-regexp A A A A A A A A A | > | M-s h A A A | C-x w A A A | w A A A A A A A A A | > hi-lock-write-interactive-patterns | > |------------+-------------+---------------------+------------------------------------| > -- > Kaushal Modi