From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: el-search usage (doc, strings, pcase, etc.) Date: Mon, 29 Oct 2018 00:39:48 +0100 Message-ID: <874ld5iqt7.fsf@web.de> References: <87tvl7jvir.fsf@portable.galex-713.eu> <875zxne6pc.fsf@web.de> <87zhuzibvw.fsf@portable.galex-713.eu> <87zhuzkuqf.fsf@web.de> <87muqzggz5.fsf@portable.galex-713.eu> <875zxnkkgw.fsf@web.de> <87o9beesxv.fsf@portable.galex-713.eu> <87in1liu79.fsf@web.de> <8736sp7k5a.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 1540769910 19875 195.159.176.226 (28 Oct 2018 23:38:30 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 28 Oct 2018 23:38:30 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: "Garreau\, Alexandre" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Oct 29 00:38:26 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 1gGudV-00054Y-Aw for geh-help-gnu-emacs@m.gmane.org; Mon, 29 Oct 2018 00:38:25 +0100 Original-Received: from localhost ([::1]:42608 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGufb-0005Pa-LY for geh-help-gnu-emacs@m.gmane.org; Sun, 28 Oct 2018 19:40:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56748) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGuf2-0005NT-QZ for help-gnu-emacs@gnu.org; Sun, 28 Oct 2018 19:40:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gGuey-00048C-I7 for help-gnu-emacs@gnu.org; Sun, 28 Oct 2018 19:40:00 -0400 Original-Received: from mout.web.de ([212.227.15.14]:57433) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gGuew-00045z-Bl for help-gnu-emacs@gnu.org; Sun, 28 Oct 2018 19:39:55 -0400 Original-Received: from drachen.dragon ([94.218.210.177]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MRD4x-1g8u2E3h3X-00UdTH; Mon, 29 Oct 2018 00:39:50 +0100 Original-Received: from drachen.dragon ([94.218.210.177]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MRD4x-1g8u2E3h3X-00UdTH; Mon, 29 Oct 2018 00:39:50 +0100 In-Reply-To: <8736sp7k5a.fsf@portable.galex-713.eu> (Alexandre Garreau's message of "Sun, 28 Oct 2018 23:59:13 +0100") X-Provags-ID: V03:K1:s8jQedYf0yvSo7KDotCUwNQtgIScad3HbfIoTVGP7PrVrOhN7aS Y/Wt/K214PQx8wTbX8r4acOtCTAyiSIUEXnNJdF5HqtdaHFl383AmhlL2dAm68zQI2hqliw JoD08Y4fDnkxlAAT43p1BiTB6v359uCEOEVksd/lddrfB7OHE/vubhpWSvjToplYap+jygj 4+XVNOlQlrYAGrCTpe+Wg== X-UI-Out-Filterresults: notjunk:1;V01:K0:gFuSqykQsh0=:y4Lf9Wu/W+TBIxJe6p2g6r gfN7pcV4+CLm3JnPWlqP7a6uvmHBofXxC7ck/UCpQU26Q57jZC+LN1mj9pD1gnEIVYEBw2jNd oW48LN+ePKYsw9xW11naOb33LjWTWs8FvkE1bhyP16aWRadjYcYKjd019N4B84C9Vb6AD0v9j YmMdWOzydJtH5AUihBZFOHjotIH/6xu+t1KVq1qXe6o5dEV5S9jyookaVCbOkagfrMzopYJRc /ccliRQxSie1AX2EQaqT7kQX63G/oTzXyAWMaUZiQ67bLzb6wy0rdFpAxyKpYFBtvV5E6XyaD t7aEkVP17PNAtWlZsceC4wn1NUY0L6jS/BG7DqglV4D2MA2Od5zGeArOe4lwFghDj4dNAvUxV Y2JZaCE1MdBgMygmPzzSGdHhDmAbAUJo8VedFhROg06ej2pzl8LsnVH/ZBhQ+Gcis6EqQ+WL9 AGKMGR0cFubevY86sDCyD5LzE8/9KucCdDy5A4EbXOy0lzHINoIGe5YrXXmzXbuMY9L18fNqf wDXoj/4lN5jXOTKxL+M7OPUsCQkjD9Sg9MLVgueIuihxhOrEBeQkehFFd3Rr+9sIN9aEf0Io6 f2v9RwFiGLxWtZVqK/THIv1xvwSh4LV8f7ZWKquOkhLO5Hlzi+/QpfSLycnJ4WAlvO8Yc4YKM tzDfX0raO0WXqDemz8cUOF48oQtJIiaPGxzFdwRwiUsh8DqROpyKK0JxzbP5/fRB8bv1n0TUq GgVv2E6mFwmP+yADdu+2I6pK9RprVWt14AVaD7ayTeIzukqPX9qVTAExsDFWmuuFYzKUjqxq X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.15.14 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:118474 Archived-At: "Garreau, Alexandre" writes: > If rx is available in pcase, then, it is already in el-search anyway, > right? Sure! > > A setq in the pattern is a side effect. Side effects in the patterns > > can behave unexpectedly AFAIR, due to optimizations pcase performs with > > the code. I hardly learned when composing el-search patterns that it is > > really not a good idea to try to make use of side effects. There was > > once a warning about this in the pcase docstring, but seems it has > > disappeared since the rewrite. > > Maybe a such feature should be integrated into pcase? In pcase' real life it is not really a restriction since you can export any information via variables. Therefore you gain cleaner code: no side effects by pattern matching, side effects (possibly) in the bodies. Wouldn't it be confusing if there was an (and P1 P2 P3 P4), and P1, P2, P3 would cause side effects, and matching P4 finally fails (and so the whole pattern)? > Not if you want to condition that according contextual sexp patterns. > And it will still be easier and cleaner to replace only in strings > using el-search than a complex half-lisp-parsing regexp in isearch. My current solution is that el-search will allow you to hit a key (it will be "e") to edit a match manually in a separate buffer. el-search is not really good at "text processing" since it currently completely ignores comments. > If it was well written enough, it should be easy to take extra features > apart, and modularily change the base while still keeping the basic > thing working, then progressively adapt the (hopefully modular) > features. But that=E2=80=99s the ideal state and I guess it=E2=80=99s on= ly in a better > shape than other similarily complex features of emacs. I don't know, really. But you would have to expect to introduce a lot of bugs. I'm not against what you propose, it's just my time is...limited. > Yes, as a map, without prefix, as you invoked it anyway. And to quit > you hit . Do you think that would bother other more > use-once usages? The problem here is that if a user doesn't like the default bindings, he needs to remove them explicitly. Since there are already two very different suggested binding schemes (AFAIR they also slightly interfere), I decided against that. I'll think about what could be a good solution. Michael.