From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "Garreau\, Alexandre" Newsgroups: gmane.emacs.help Subject: el-search usage (doc, strings, pcase, etc.) Date: Sat, 27 Oct 2018 16:48:12 +0200 Message-ID: <87tvl7jvir.fsf@portable.galex-713.eu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1540651617 12482 195.159.176.226 (27 Oct 2018 14:46:57 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 27 Oct 2018 14:46:57 +0000 (UTC) User-Agent: Gnus (5.13), GNU Emacs 25.1.1 (i686-pc-linux-gnu, GTK+ Version 3.22.11) of 2017-09-15, modified by Debian Cc: help-gnu-emacs@gnu.org To: Michael Heerdegen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Oct 27 16:46:53 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGPrY-0003Ac-Im for geh-help-gnu-emacs@m.gmane.org; Sat, 27 Oct 2018 16:46:52 +0200 Original-Received: from localhost ([::1]:36765 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGPte-0000i9-U1 for geh-help-gnu-emacs@m.gmane.org; Sat, 27 Oct 2018 10:49:02 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48468) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGPt7-0000go-So for help-gnu-emacs@gnu.org; Sat, 27 Oct 2018 10:48:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gGPt5-0005U6-VP for help-gnu-emacs@gnu.org; Sat, 27 Oct 2018 10:48:29 -0400 Original-Received: from portable.galex-713.eu ([2a00:5884:8305::1]:53082) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gGPt5-0005TL-BP for help-gnu-emacs@gnu.org; Sat, 27 Oct 2018 10:48:27 -0400 Original-Received: from localhost ([::1] helo=portable.galex-713.eu) by portable.galex-713.eu with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gGPt3-0002nT-65; Sat, 27 Oct 2018 16:48:25 +0200 PGP-FINGERPRINT: E109 9988 4197 D7CB B0BC 5C23 8DEB 24BA 867D 3F7F Accept-Language: fr, en, eo, it, br X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:5884:8305::1 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:118439 Archived-At: On 2018/10/17 at 17:42, Michael Heerdegen wrote: > "Garreau, Alexandre" writes: >>> Also, package `el-search.el' has similar possibilities (and many other >>> good things). >> >> Wow it seems cool, I=E2=80=99ll try it out when I=E2=80=99ve got time if= I remember to. >> I=E2=80=99ve dreamt of it I think. > > If you happen to try it, I'm curious for your feedback, especially if > you find bugs, something doesn't work as expected, the documentation > isn't helpful enough, etc. Other packages have an info file: maybe writing the doc in texinfo and then exporting to org-mode (or the other way around: writing in org-mode and exporting to texinfo), could be useful so to get an info documentation accessible with C-h i. I have the general habit of searching with C-h i and docstrings only, but when a package is not reified around an unique =E2=80=9Cmain=E2=80=9D command, usually its packag= e name, so its docstring can serves both as a mini reference and tutorial for introducing the package (maybe it would be the case of el-search for `el-search-pattern'? but then it would better be rather named `el-search', and its docstring should be more detailed, otherwise it requires guessing `el-search-pattern' is the main interface, or rather using the manual for discovering so, which may cause great confusion to the lazy user). When a package doesn=E2=80=99t have this, for instance an addition to a mode, or several modes, or a language feature (=E2=80=9Cgnorb= =E2=80=9D, emms, eieio, etc.). Btw I really liked what I did read at some point about if you search for 27, it will not match for text or comments (yet I barely need to search for numbers usually): that makes it look pretty semantic (does it uses `read', `eval' or something?). In my memories it was confused, so I was going to try doing the opposite: searching a string being or containing =E2=80=9Cwas=E2=80=9D (or = =E2=80=9Cwas:=E2=80=9D) in gnus=E2=80=99 source (/usr/share/emacs/25.1/lisp/gnus/), avoiding comments = and symbols, so to find the function removing exagerated =E2=80=9C(was: old subject)=E2=80=9D in subject lines when replying. But I found nothing rele= vant being it, and many docstring contain it :/ I tried =E2=80=9C(and (pred stringp) s (guard (string-match "\:" s)))= =E2=80=9D, however that is long to type, so I found very very unfortunate el-search doesn=E2=80=99t seem to maintain a prompt history (why so? it is easy, just= a symbol, so to put a list there). However it probably call for a pcase macro such as =E2=80=9C(pcase-defmacro contain (match-string) `(and (pred stringp) string (guard (string-match ,match-string string))))=E2=80=9D, but= the problem is then it highlights the whole string, instead of the matched part (while this should be easily usable since this macro actually returns position of match (and match-end its end)), and el-search-defpattern doesn=E2=80=99t seem to offer a way to do so (match fo= r a subpattern according its context, or maybe I=E2=80=99m not enough educated = of pcase complex mecanics). As the search usage (keystrokes, etc.) seem to be quite different than from isearch (it seems to highlight it specially but doesn=E2=80=99t rebind special keystrokes (moving exit it (and scrolling commands such as SPC or do exit it too) and I don=E2=80=99t know how to go to next occurence (maybe I should learn how to use occur so to know how to use it?))), I=E2=80=99m a bit lost. I=E2=80=99m used to be able not to bind ke= ystrokes for command I=E2=80=99m not yet a regular user of (otherwise I just bind the ke= y and forget it, so I end loosing keybindings for thing I=E2=80=99d actually need= ), but it seems el-search enforces the opposite of that, since to continue a search I *need* to repetedly run the command (which gives a lot of =E2=80=9CM-x =E2=80=9D).