From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.help Subject: Re: on adding a function call to a s-exp Date: Tue, 12 Jun 2018 17:24:12 +0100 Message-ID: References: <864libzkem.fsf@gmail.com> <86zi026stt.fsf@gmail.com> <86wov55r33.fsf@gmail.com> <87o9ggdolh.fsf@telefonica.net> 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 1528820601 15755 195.159.176.226 (12 Jun 2018 16:23:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 12 Jun 2018 16:23:21 +0000 (UTC) Cc: "help-gnu-emacs@gnu.org List" To: =?UTF-8?Q?=C3=93scar_Fuentes?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jun 12 18:23:17 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 1fSm4i-000401-EI for geh-help-gnu-emacs@m.gmane.org; Tue, 12 Jun 2018 18:23:16 +0200 Original-Received: from localhost ([::1]:57273 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSm6p-0005rX-5e for geh-help-gnu-emacs@m.gmane.org; Tue, 12 Jun 2018 12:25:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSm60-0005q9-5R for help-gnu-emacs@gnu.org; Tue, 12 Jun 2018 12:24:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSm5y-0001kq-Jc for help-gnu-emacs@gnu.org; Tue, 12 Jun 2018 12:24:36 -0400 Original-Received: from mail-it0-x22d.google.com ([2607:f8b0:4001:c0b::22d]:38938) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fSm5y-0001kX-Cp for help-gnu-emacs@gnu.org; Tue, 12 Jun 2018 12:24:34 -0400 Original-Received: by mail-it0-x22d.google.com with SMTP id p185-v6so67350itp.4 for ; Tue, 12 Jun 2018 09:24:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=uO4evW5dycX3E2PtLuCEcEgNc6HJAJkz+jWfLfFojaY=; b=l0bqpAj/Ba8uRpVA2KYQYwa9nggZvmz8NIa0CAIPEdLRhu1cFc46odAof+U8ck0ARb 1MmG26XFeiuGnnYTGCRBOHug/vD32jIsODQsnEVFHreixhpCleyyIAfz7fveRTVpvAB0 ZmTNkxdQJ49iVs3zF7GjfC4mfGlXuns6IU48q18C/SidB9mop0PU9k6RfOAtAvw7jZYe J7YR/3QfUCkNBOXOaXZKXNu3JXo5xURCQBIlg7tIJyfVysMj31q4ZiuUGRHA0vWr1wi4 /ZYuW/540kjp9RBlFWYtXRwxtluToc2gSpsmI/Sn8j2Nvo4MvzF+NLIpD4sKmM03hyvX Ez7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=uO4evW5dycX3E2PtLuCEcEgNc6HJAJkz+jWfLfFojaY=; b=fFCapZNzN4HLR6OGCNaPcLTqsCjhYz8AC29cRnMCoS4Ee9wBhuLZIIRk8ng4V4Xqhz fLvfzfqqThJYP8YmgDD3tSNBR23rKDz331ylBiKMA6/eXWT/kOqrbzDpJa7ujrfB5r30 3SvbgaK4Dj7P2LNLIXb4YWvJE/Qv7kpkS54hg9tmM2A2va1EyIQ0zF1mcVxU/UFBRv6Z 0LCUg2lCMDkujbk7kSLivNRUFNT42hwGeZ3Rs5xMqAIuSGSMlC4HC/SGBNqiE6xknZ6s AcDdUFGxjc1kaiX2qBMmJKnp5t1u2nsgKsHr/pPOTLYCYHdHZ4t5KwGP0WKWAtL9v4MI BgNA== X-Gm-Message-State: APt69E2l9GKV00qD2wH2jPxg9L0rB32AHEAbOQ+u0SI4YQg8ELTo44ZF Hv0polY37IrGfvrJp9XYgIFl0c5pHHALUNhq+Rc= X-Google-Smtp-Source: ADUXVKIkeBKIcQLhUDhie96Sypbb6pd3sZQmjDo08BcOrH2ZdQijLUBVD+D1DElFhmnYffWWNR9SIX4glT3nXNUMQ8k= X-Received: by 2002:a24:fd85:: with SMTP id m127-v6mr1161402ith.104.1528820673637; Tue, 12 Jun 2018 09:24:33 -0700 (PDT) Original-Received: by 2002:a4f:2246:0:0:0:0:0 with HTTP; Tue, 12 Jun 2018 09:24:12 -0700 (PDT) In-Reply-To: <87o9ggdolh.fsf@telefonica.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4001:c0b::22d X-Content-Filtered-By: Mailman/MimeDel 2.1.21 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:117114 Archived-At: On Tue, Jun 12, 2018 at 4:14 PM, =C3=93scar Fuentes wrote: > Jo=C3=A3o T=C3=A1vora writes: > > >> I'll choose to use paredit and learn how to use it properly. (There'l= l > >> likely be other good things there that I don't currently know or use.) > >> > > > > I suggest you also give (the newer, 24.4+) eletric-pair-mode a try. It > > should work consistently in all emacs major modes, not just lisp > > modes, and is maintained together with Emacs. By default, in > > emacs-lisp-mode you won't notice a difference to paredit for the most > > common operations (you *will* notice that it lets you unbalance the > > buffer temporarily though, but I consider that a feature). > > electric-pair-mode offers a tiny fraction of the features of paredit. > The later takes some time to learn, but in my experience the effort pays > off if you work with lispy languages. > OK let's bikeshed a bit here :-) What you say is of course true for some definition of tiny, and for some definition of the disadvantages of being tiny, which, when compared to being bloated, are very few. Indeed, as you say, learning-curve-wise there are exactly 0 new commands to learn in electric-pair-mode, versus 72 in paredit, a net gain of infinity :-). I would add that e-p-m also doesn't surprise newcomers regardless if you're coming from another major mode, or from Window notepad. My main gripe with paredit is not that it forces structural integrity, it's that it doesn't force it completely: there are many situations where it becomes confused. Here's an example: " some string " " another string " In paredit, I must admit to liking that C-k in the first line blows away the whole string: it's nice because doing so would unbalance the buffer. But annoingly, I can't C-k the middle line to join the two strings, which would equally result in a balanced buffer. And neither does it kill both strings, which would be slightly more annoying but still reasonable in paredit-land. Instead it does nothing. So I select the line and kill the region. Emacs now complies, unconsistently and surpsingly. And yep, as you've guessed it, I can delete one of the quotes in middle line. And now comes the worse part, because trying to rebalance is impossible (bar C-q antics and M-x paredit-mode to turn it off): (1) typing a quote in the middle line gives you two quotes, leaving the buffer unbalanced. (2) typing a quote in the last line gives you a "scan error" about unbalanced parentheses. (3) As does trying to delete the last quote, that also signals an error. And deleting the first line now errors, too. grrr :-) In (1) and (2), electric-pair-mode would notice the temporary and only insert one quote, after which it would of course resume autopairing and autoskipping. The example is only short for illustrative purposes: it can happen when applying diff hunks or editing some merge-conflicted lisp file. Or just if you happen to use the region. Jo=C3=A3o PS: writing this in message-mode where smileys have special syntax so electric-pair-mode keeps working :-)