From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: Exposing Isearch toggleable options Date: Wed, 28 Oct 2015 18:19:31 -0700 (PDT) Message-ID: <6d1f58d5-ccf1-46e7-b7fc-3466c0f3f3d5@default> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="__1446081573003199591abhmp0008.oracle.com" X-Trace: ger.gmane.org 1446081610 1980 80.91.229.3 (29 Oct 2015 01:20:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 29 Oct 2015 01:20:10 +0000 (UTC) To: bruce.connor.am@gmail.com, emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 29 02:19:58 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 1Zrbsi-0002dE-KJ for ged-emacs-devel@m.gmane.org; Thu, 29 Oct 2015 02:19:56 +0100 Original-Received: from localhost ([::1]:41414 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zrbsi-0006b2-4e for ged-emacs-devel@m.gmane.org; Wed, 28 Oct 2015 21:19:56 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrbsT-0006a5-1G for emacs-devel@gnu.org; Wed, 28 Oct 2015 21:19:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZrbsO-0000ui-1S for emacs-devel@gnu.org; Wed, 28 Oct 2015 21:19:41 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:32807) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrbsN-0000ue-PG for emacs-devel@gnu.org; Wed, 28 Oct 2015 21:19:35 -0400 Original-Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t9T1JYu8007856 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 29 Oct 2015 01:19:34 GMT Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id t9T1JX5u032631 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 29 Oct 2015 01:19:34 GMT Original-Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id t9T1JXYe000538; Thu, 29 Oct 2015 01:19:33 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6691.5000 (x86)] X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 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:192848 Archived-At: --__1446081573003199591abhmp0008.oracle.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable > I'm not yet sure if this is worth merging to master, so I'd > very much appreciate opinions. FWIW, I amnot in favor of it. I'd prefer that users consult the Isearch help for such info. I have many more togglable options, and Emacs might in the future also. And there are many aspects regarding the current Isearch state that it would be worthwhile indicating to users (either on an ongoing basis or on demand, depending on the aspect of state). The current value of a togglable variable, as well as the key to toggle it, is info that falls in that category: it is part of the current state. I'd sooner see this info handled along with other state info. We've discussed this in other threads, I believe. ---- FWIW, in my code I bind `C-h' to a modified version of `isearch-mode-help' that not only shows the help but also=20 exits Isearch. I find that more useful than (a) requiring `C-h m' and (b) keeping Isearch active. Users need to be able to explore the *Help* buffer. Especially if there is a lot of info there, and in my version it lists all of the Isearch bindings, in addition to showing the doc string of `isearch-forward' (which in my case is longer). I think it makes little sense to keep Isearch open during this time. It is trivial to restart Isearch. FWIW, this is the definition I use, and bind to `C-h' in `isearch-mode-map': (defun isearch-mode-help () "Display information on interactive search in buffer *Help*." (interactive) (describe-function 'isearch-forward) (isearch-done) (isearch-clean-overlays) (with-current-buffer "*Help*" (goto-char (point-max)) (let ((buffer-read-only nil)) (insert (substitute-command-keys " Bindings in Isearch minor mode: ------------------------------ \\{isearch-mode-map}"))))) Attached is what *Help* shows for Isearch in my context. --__1446081573003199591abhmp0008.oracle.com Content-Type: text/plain; charset=Windows-1252; name="throw-isearch-help3.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="throw-isearch-help3.txt" isearch-forward is an interactive Lisp function in `isearch+.el'. It is bound to C-s, . (isearch-forward &optional ARG NO-RECURSIVE-EDIT) Search forward incrementally - Isearch+ version. With a non-negative prefix arg, do an incremental regular expression search instead. With a negative prefix arg, do a (plain, not regexp) incremental search across multiple buffers: * If the prefix arg is `-' (from `M--') then you are prompted for the list of buffers.=20 * Otherwise, (e.g. `M-- 2'), you are prompted for a regexp that matches the names of the buffers to be searched. If you try to exit with the search string empty then nonincremental search is used. As you type characters, they add to the search string and are found. The following non-printing keys are bound in `isearch-mode-map'. Options ------- `isearchp-case-fold'=09=09=09- search is case sensitive? `isearchp-dim-outside-search-area-flag' [*] - dim non-search zones? `isearchp-dimming-color' [*]=09=09- color for non-search zones `isearchp-set-region-flag'=09=09- select last search target? `isearchp-restrict-to-region-flag'=09- restrict search to region? `isearchp-deactivate-region-flag'=09- search deactivates region? `isearchp-ignore-comments-flag' [*]=09- ignore THINGs in comments? `isearchp-hide-whitespace-before-comment-flag' [*] - precomment space? `isearchp-mouse-2-flag'=09=09- `mouse-2' anywhere yanks selection? `isearchp-regexp-quote-yank-flag'=09- regexp-quote yanked text? `isearchp-toggle-option-flag'=09=09- toggle options too? `isearchp-drop-mismatch'=09- handling input after search mismatch `isearchp-drop-mismatch-regexp-flag'=09- regexp search drop mismatch? `isearchp-initiate-edit-commands'=09- keys that edit, not exit [*] Requires library `isearch-prop.el'. Commands -------- DEL=09- cancel last input item from end of search string RET=09- exit, leaving point at location found C-s=09- search again forward, C-r backward C-y C-w=09- yank a word or char from buffer onto search string C-z=09- yank a char from buffer onto search string C-M-w=09- delete char from end of search string C-y C-e=09- yank text up to end of line onto search string C-y C-y=09- yank the last string of killed or copied text M-y=09- replace string just yanked with string killed/copied before it M-w=09- copy current search string to kill ring C-_=09- yank a symbol or char from buffer onto search string C-(=09- yank sexp, symbol, or char from buffer onto search string C-q=09- quote a control character, to search for it C-x 8 RET=09- add a Unicode char to search string by Unicode name C-M-l=09- remove failed part of search string, if any C-g=09- remove failed part of search string, or cancel if none C-x o=09- invoke Emacs command loop recursively, during Isearch M-g=09- insert successful search string from when you hit `C-g' M-s e=09- edit the search string in the minibuffer M-n, M-p=09- search for next/previous item in search ring C-M-i=09- complete the search string using the search ring M-%=09- run `query-replace' to replace search-string matches C-M-%=09- run `query-replace-regexp' M-s o=09- run `occur' for search-string matches M-s h r=09- run `highlight-regexp' to highlight search-string matches M-x isearchp-fontify-buffer-now=09- fontify whole buffer M-x isearchp-set-region-around-search-target=09- select last search b=09- list all Isearch key bindings k=09- show documentation of an Isearch key m=09- show documentation for Isearch mode M-k=09- cycle option `isearchp-drop-mismatch' M-s c=09- toggle case-sensitivity (for current search or more: `C-u') M-s h l=09- option `lazy-highlight-cleanup' (removal of highlighting) C-+=09- toggle searching invisible text M-s i=09- toggle searching invisible text, for current search or more M-s v=09- toggle option `isearchp-toggle-option-flag' C-x n=09- toggle restricting search to active region C-SPC=09- toggle setting region around search target C-`=09- toggle quoting (escaping) of regexp special characters M-s w=09- toggle word-searching M-s _=09- toggle symbol-searching M-s SPC=09- toggle whitespace matching A `SPC' char normally matches all whitespace defined by variable `search-whitespace-regexp'. See also variables `isearch-lax-whitespace' and `isearch-regexp-lax-whitespace'. Commands that Require Library `isearch-prop.el' -----------------------------------------------=20 C-t=09- search for a character (overlay or text) property C-M-t=09- regexp-search for a character (overlay or text) property C-M-~=09- toggle searching complements of normal search contexts C-M-S-d=09- toggle dimming non-search zones C-M-;=09- toggle ignoring comments for `isearchp-thing' M-;=09- hide or (`C-u') show comments M-x isearchp-put-prop-on-region=09- add a text property to region M-x isearchp-add-regexp-as-property=09- add prop to regexp matches M-x isearchp-regexp-context-search=09- search regexp contexts M-x isearchp-regexp-define-contexts=09- define regexp contexts M-x isearchp-imenu =09- search Emacs-Lisp definitions M-x isearchp-imenu-command =09- search Emacs command definitions M-x isearchp-imenu-non-interactive-function =09- search non-commands M-x isearchp-imenu-macro =09- search Emacs-Lisp macro definitions M-x isearchp-thing=09- search THING search contexts M-x isearchp-thing-define-contexts=09- define THING contexts M-x isearchp-previous-visible-thing=09- go to previous visible THING M-x isearchp-next-visible-thing=09- go to next visible THING Input Methods ------------- If an input method is turned on in the current buffer, that input method is also active while you are typing characters to search. To toggle the input method, type C-\. It also toggles the input method in the current buffer. To use a different input method for searching, type C-^, and specify an input method you want to use. --- The above keys, bound in `isearch-mode-map', are often controlled by user options - do M-x apropos on search-.* to find them. If either option `isearch-allow-prefix' or option `isearch-allow-scroll' is non-nil then you can use a prefix arg with an Isearch key. If option `isearch-allow-scroll' is non-nil then you can use scrolling keys without exiting Isearch. If these options are both nil then other control and meta chars terminate the search and are then used normally (depending on `search-exit-option'). Likewise for function keys and mouse button events. If this function is called non-interactively with nil argument NO-RECURSIVE-EDIT then it does not return to the calling function until the search is done. See function `isearch-mode'. Bindings in Isearch minor mode: ------------------------------ key binding --- ------- TAB .. C-j=09isearch-printing-char SPC .. ~=09isearch-printing-char =C2=80 .. =F8=8F=BF=BD=BF=09isearch-printing-char =80 .. =FF=09isearch-printing-char C-g=09=09isearch-abort C-h=09=09isearch-mode-help RET=09=09isearch-exit C-q=09=09isearch-quote-char C-r=09=09isearch-repeat-backward C-s=09=09isearch-repeat-forward C-t=09=09isearchp-property-forward C-w=09=09isearch-yank-word-or-char C-x=09=09Prefix Command C-y=09=09Prefix Command C-z=09=09isearchp-yank-char ESC=09=09Prefix Command C-\=09=09isearch-toggle-input-method C-^=09=09isearch-toggle-specified-input-method C-_=09=09isearchp-yank-symbol-or-char DEL=09=09isearch-delete-char S-SPC=09=09isearch-printing-char C-SPC=09=09isearchp-toggle-set-region C-(=09=09isearchp-yank-sexp-symbol-or-char C-+=09=09isearchp-toggle-search-invisible C-`=09=09isearchp-toggle-regexp-quote-yank C-S-SPC=09=09isearchp-narrow-to-lazy-highlights =09isearchp-act-on-demand =09isearchp-complete =09isearchp-cleanup =09isearch-delete-char =09ignore =09=09Prefix Command =09=09Prefix Command =09isearch-mouse-2 =09=09isearch-repeat-forward =09=09isearch-repeat-backward =09=09Prefix Command =09isearch-exit =09ignore C-x 8=09=09Prefix Command C-x n=09=09isearchp-toggle-region-restriction C-x o=09=09isearchp-open-recursive-edit C-x r=09=09Prefix Command C-y C-c=09=09isearchp-yank-char C-y C-e=09=09isearchp-yank-line C-y C-w=09=09isearchp-yank-word-or-char C-y C-y=09=09isearch-yank-kill C-y ESC=09=09Prefix Command C-y C-_=09=09isearchp-yank-symbol-or-char C-y C-(=09=09isearchp-yank-sexp-symbol-or-char C-M-i=09=09isearch-complete C-M-l=09=09isearchp-remove-failed-part C-M-r=09=09isearch-repeat-backward C-M-s=09=09isearch-repeat-forward C-M-t=09=09isearchp-property-forward-regexp C-M-w=09=09isearch-del-char C-M-y=09=09isearch-yank-char ESC ESC=09=09Prefix Command M-%=09=09isearch-query-replace M-:=09=09isearchp-eval-sexp-and-insert M-;=09=09isearchp-toggle-hiding-comments M-c=09=09isearch-toggle-case-fold M-e=09=09isearch-edit-string M-g=09=09isearchp-retrieve-last-quit-search M-k=09=09isearchp-cycle-mismatch-removal M-n=09=09isearch-ring-advance M-p=09=09isearch-ring-retreat M-r=09=09isearch-toggle-regexp M-s=09=09Prefix Command M-w=09=09isearchp-kill-ring-save M-y=09=09isearch-yank-pop C-M-S-d=09=09isearchp-toggle-dimming-outside-search-area C-M-%=09=09isearch-query-replace-regexp C-M-;=09=09isearchp-toggle-ignoring-comments C-M-`=09=09isearchp-toggle-literal-replacement C-M-~=09=09isearchp-toggle-complementing-domain M-ESC ESC=09isearch-cancel M-s C-e=09=09isearch-yank-line M-s SPC=09=09isearch-toggle-lax-whitespace M-s _=09=09isearch-toggle-symbol M-s c=09=09isearch-toggle-case-fold M-s e=09=09isearch-edit-string M-s h=09=09Prefix Command M-s i=09=09isearch-toggle-invisible M-s o=09=09isearch-occur M-s r=09=09isearch-toggle-regexp M-s v=09=09isearchp-toggle-option-toggle M-s w=09=09isearch-toggle-word =09isearchp-complete C-h=09isearch-help-for-help ?=09=09isearch-help-for-help b=09=09isearch-describe-bindings k=09=09isearch-describe-key m=09=09isearch-describe-mode q=09=09help-quit =09isearch-help-for-help =09isearch-help-for-help C-h=09isearch-help-for-help ?=09isearch-help-for-help b=09isearch-describe-bindings k=09isearch-describe-key m=09isearch-describe-mode q=09help-quit =09isearch-help-for-help =09isearch-help-for-help C-x r g=09=09isearchp-append-register C-x 8 RET=09isearch-char-by-name C-y M-g=09=09isearchp-retrieve-last-quit-search C-y M-y=09=09isearch-yank-pop M-s h l=09=09isearchp-toggle-lazy-highlight-cleanup M-s h r=09=09isearch-highlight-regexp --__1446081573003199591abhmp0008.oracle.com--