From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Wilhelm Kirschbaum Newsgroups: gmane.emacs.bugs Subject: bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python Date: Tue, 04 Apr 2023 19:54:45 +0200 Message-ID: <87zg7nfrex.fsf@gmail.com> References: <83sfdm6bet.fsf@gnu.org> <87edp6oim6.fsf@gmail.com> <87lejay8n3.fsf@gmail.com> <06DAF2C4-C224-4C30-AAAE-96D1A84ED145@outlook.com> <87bkk642k0.fsf@gmail.com> <87edp2vzvg.fsf@gmail.com> <87h6tx74i4.fsf@gmail.com> <83y1n9ukqb.fsf@gnu.org> <83o7o5uj2c.fsf@gnu.org> <871ql06w59.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="427"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.9.3; emacs 30.0.50 Cc: Eli Zaretskii , 62536@debbugs.gnu.org, mou.tong@outlook.com To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 04 20:13:17 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pjl9h-000AWt-Gd for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 04 Apr 2023 20:13:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pjl9U-0001nh-Qe; Tue, 04 Apr 2023 14:13:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pjl9S-0001nD-Sf for bug-gnu-emacs@gnu.org; Tue, 04 Apr 2023 14:13:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pjl9S-0001Rm-Fh for bug-gnu-emacs@gnu.org; Tue, 04 Apr 2023 14:13:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pjl9R-0000tB-Ra for bug-gnu-emacs@gnu.org; Tue, 04 Apr 2023 14:13:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Wilhelm Kirschbaum Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 04 Apr 2023 18:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62536 X-GNU-PR-Package: emacs Original-Received: via spool by 62536-submit@debbugs.gnu.org id=B62536.16806319373362 (code B ref 62536); Tue, 04 Apr 2023 18:13:01 +0000 Original-Received: (at 62536) by debbugs.gnu.org; 4 Apr 2023 18:12:17 +0000 Original-Received: from localhost ([127.0.0.1]:50173 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjl8j-0000sA-Ae for submit@debbugs.gnu.org; Tue, 04 Apr 2023 14:12:17 -0400 Original-Received: from mail-wm1-f46.google.com ([209.85.128.46]:39610) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjl8i-0000rx-9w for 62536@debbugs.gnu.org; Tue, 04 Apr 2023 14:12:16 -0400 Original-Received: by mail-wm1-f46.google.com with SMTP id i5-20020a05600c354500b003edd24054e0so22347023wmq.4 for <62536@debbugs.gnu.org>; Tue, 04 Apr 2023 11:12:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680631930; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:cc:to:from:user-agent:references:from:to:cc:subject:date :message-id:reply-to; bh=LEbHCeu62i4eTv7Zxrq+0gd/BkqMW9P5QiAWW4PGnL4=; b=Po8r43pbP/1HBKtUR94T1WA4Si4obP0sKpy2xIKzOL5psq6ZSkrnlg/TrX1zPRbVc7 OEwO5+I805LxLchp2LVIiNz51rBhgiRpKlDPNQaWNJapW/I3t6gEXxEX5z9B5HtniaUq RDYjd7YSuCCeqClTbC1iS8Gfe+p2GHCQ05fXEFqc739K16xkz/6lPcfrPuvNKzvcTtYt jcv29QsYTYBqWYHCJdu+EcSXQftj7Jeat7BYDMtdk9dLgtbDoMrtxQp9eLJdK1hKJWK/ X2KDsSWeLyfN3x2SERY8g1+td4fOlN0SMTcuWhQtfhXcEPV3FDMiahi/FaWU1j8piPnv n5yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680631930; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:cc:to:from:user-agent:references:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=LEbHCeu62i4eTv7Zxrq+0gd/BkqMW9P5QiAWW4PGnL4=; b=ddvWUHneqi+tI0M92kO9o6Lj4whzUw/BKZ/aHvxSe29ZJOSVH2/jrAu6Sg2h8pJluD hzGaF0/e9FTyuqs5o3mahzbjFQSo9WLgbibMN4e/nleYmSN1J+MOwpWEIVqjdVKF4eXb DK0slB2Az22b9+C1no5SyTTi4VpufugmYkf7/0cxlaD+N5JUa8S/TC4t3bOu4Qd8EWo1 B8lOZkXvAX0KXz4CvGxpDh7KDSybZUUuRAdsxQjhXfdb3vSEe1l2FS23FdxO6oq62Gog p97Ta8OhvQJO4gLBIzMGNiYhKqefNBBHhLcM3dO6EC//h5sFyWZSV6Yw2BtinIYF7WR1 V3Vg== X-Gm-Message-State: AAQBX9cijYJ/Q43pTw6ppShq/S6x79zk/S5PF+p4w0428kClDJh4orha SV/qvhhK0FPW0mpEbiKwDUg= X-Google-Smtp-Source: AKy350bCInLGhtw21ee9Piwnd7kyZYzUf53KMpY1or2mq7aqEC1I8KoP2Yy3r580h19gvDac1EQBew== X-Received: by 2002:a1c:cc1a:0:b0:3ed:33a1:ba8e with SMTP id h26-20020a1ccc1a000000b003ed33a1ba8emr2814926wmb.1.1680631930138; Tue, 04 Apr 2023 11:12:10 -0700 (PDT) Original-Received: from melissa.local (ec2-13-245-80-249.af-south-1.compute.amazonaws.com. [13.245.80.249]) by smtp.gmail.com with ESMTPSA id iz5-20020a05600c554500b003ef67ac3846sm23052180wmb.24.2023.04.04.11.12.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Apr 2023 11:12:09 -0700 (PDT) In-reply-to: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:259236 Archived-At: Hi Jo=C3=A3o, >> >> I had a look and don't see how without changing elec-pair.el=20 >> that >> there >> is a more elegant way to do this. I am happy with the current >> patches >> to be installed and then perhaps if there is a better way we=20 >> can >> apply >> it to both python-mode and elixir-ts-mode later. > > It seems what you are trying to do is actually a functionality > of electric-layout-mode, right? It's creating newlines between > two sets of '"""' so that if the user types one newline between > them, then one extra newline is inserted after and the line is > indented one level deeper than the '"""'. > > If so, it would seem like 'electric-layout-rules' would be a=20 > good > match. The behaviour would happen _only_ if the user has > electric-layout-mode, which is the standard Emacs mode for > controlling this kind of electricity. The last paragraph > of the docstring of 'electric-layout-rules' seems to describe > a powerful enough mechanism to do achieve what the custom > psif does. > > Jo=C3=A3o The custom psif is not for the newline, but for pairing up the=20 triple quotes `"""` with another set of tripe quotes when=20 electric-pair-mode is enabled. The newline is for keeping the syntax valid in elixir, otherwise the font and navigation breaks because `""""""` is not=20 valid Elixir syntax and the tree-sitter grammar really does not like it. Unless electric-indent-chars can identify the triple quotes, we=20 need a custom psif regardless of other functionality, but I don't see=20 this option. Maybe I am wrong and you can point me to this feature? If it does not make sense to add the newline as this might not be expected behaviour when electric-layout-mode is not enabled, we=20 can add a check before inserting the newline? I don't know if many people=20 using elixir-ts-mode will know about the electric layout mode and might=20 get annoyed with electric-pair-mode for heredocs ( tripple quote pairs ).=20