From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mou Tong Newsgroups: gmane.emacs.bugs Subject: bug#62536: =?UTF-8?Q?=E5=9B=9E=E5=A4=8D:?= bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python Date: Thu, 30 Mar 2023 08:25:34 +0000 Message-ID: References: <83sfdm6bet.fsf@gnu.org> <87edp6oim6.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_000_SJ0P220MB067507D9876B3118B1F50AD7978E9SJ0P220MB0675NAMP_" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15321"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "62536@debbugs.gnu.org" <62536@debbugs.gnu.org> To: Wilhelm Kirschbaum Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Mar 30 10:26:19 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 1phnbu-0003o1-6g for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 30 Mar 2023 10:26:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1phnbl-00046N-V4; Thu, 30 Mar 2023 04:26:09 -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 1phnbg-00045j-1N for bug-gnu-emacs@gnu.org; Thu, 30 Mar 2023 04:26:04 -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 1phnbe-00051m-Q9 for bug-gnu-emacs@gnu.org; Thu, 30 Mar 2023 04:26:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1phnbe-00084a-Lx for bug-gnu-emacs@gnu.org; Thu, 30 Mar 2023 04:26:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mou Tong Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 30 Mar 2023 08:26:02 +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.168016474430983 (code B ref 62536); Thu, 30 Mar 2023 08:26:02 +0000 Original-Received: (at 62536) by debbugs.gnu.org; 30 Mar 2023 08:25:44 +0000 Original-Received: from localhost ([127.0.0.1]:55709 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1phnbM-00083f-7V for submit@debbugs.gnu.org; Thu, 30 Mar 2023 04:25:44 -0400 Original-Received: from mail-dm6nam12olkn2097.outbound.protection.outlook.com ([40.92.22.97]:4242 helo=NAM12-DM6-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1phnbJ-00083Q-MN for 62536@debbugs.gnu.org; Thu, 30 Mar 2023 04:25:42 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ax032E+J5TDncRsLKFstD4nXP0mxPgEwtk2ZZiuNPut56QB6fWv8M7cnbi/Eug3CcQU+VExu0ZXj6IH9g2IKqg/5X26RNlLg7Bj7Aofc6JS5d1J2yvZymPGlXxBsiDxyhNzuRjZ++yIO/qXdSBIkmyRIeznAOpL3DgmRKq9gSXsmqqciS8vhK+eFBgn6u/F3a+QN+RRDJxrzAfPllAMiEMSzzQl8gH+TERQEMaYDNb6rnrjtEUMfjuuPabidX0SWKyexWHz36B0Ebdi9k6thPpFOqvk3pF5QGurNAdgU25u0zUFvaiq8t0F+wGHJp8zWGfUvTrQz/JXapyidBT5J3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6Np2jRwtS+bZwLNX9bdjExb63PdLN0jQoCna3ibistI=; b=V/y+bLOBpJQToSNLpu/k7kXFNiK44pFiW0ybWy99CVQVa98U1PiB6Cf5N0VcHU6OcfFHnlwWT63KgHhvWkgeBV54c3TSzFl+kmVtD+cCwasElINMTTPCwH/RWX0YTKcoTD9Cgd8qU6kjdrJ6ykfoqdYDBi++TETI7c16hmlaFKbWhXqygCi8WUq//H35CXlZj47R20+l4Xd0LQI3EzoPNmpHAw2x0A1U6T3yp9Wz97jtnM3tNJ+vyHGKfykcSEh14Ux4zOghaNmQig/cwiswuBH84ZrSzYFgqKHWt+TWrvLztsDsXP/aE/FgSUWS8Aj/xUgu0GoJH44ihNekC9TA7w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6Np2jRwtS+bZwLNX9bdjExb63PdLN0jQoCna3ibistI=; b=cni4Dqg60vjT8ZuFePmDOC68ngqK2hSZWLSof0G+Q2Vcfo7/PeUTWid+UH6BFVq2MoTNfH8usMsAtbR7e+VVKjVGZa7xTJ6xYge5++if08vAUNtx4Vjfl84ffuyuRUGHa/rYeEBeZaSaVA7ECl93eB+Xqeor/CQQdYuA31QL6C2oA9RLMzN9AnNen7SLeyXrCI86bzjJOR97SpUYqzz6OxmY1CbHv7MBRppWNxUCamAAUqafB8+QhgYfqLQp6Sm0/q3qLFoAf6EQUU6t7BSaBEkSiEjB0ol7bxdRpTolTYRyTQQchPqo3rSnk6Df/keUFNvgdbFg59QgxewehqZGMw== Original-Received: from SJ0P220MB0675.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:3ad::6) by MN0P220MB0840.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:383::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.22; Thu, 30 Mar 2023 08:25:34 +0000 Original-Received: from SJ0P220MB0675.NAMP220.PROD.OUTLOOK.COM ([fe80::c67c:bdab:898b:fe7]) by SJ0P220MB0675.NAMP220.PROD.OUTLOOK.COM ([fe80::c67c:bdab:898b:fe7%9]) with mapi id 15.20.6222.035; Thu, 30 Mar 2023 08:25:34 +0000 Thread-Topic: bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python Thread-Index: AQHZYsqs/+/sPlzwQ0e4xl/M7HdCCq8S2XmAgAAeD18= In-Reply-To: <87edp6oim6.fsf@gmail.com> Accept-Language: zh-CN, en-US Content-Language: zh-CN x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [k2GmUKKP2didlzjBO/xj03GFAw2Wu5RH] x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0P220MB0675:EE_|MN0P220MB0840:EE_ x-ms-office365-filtering-correlation-id: db6dd0e2-b141-41e5-deee-08db30f8558c x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: XE3GEG49ME4a5IhubUAURKw7O3v4T/409F9LQJo3J4CY9O8KtWEXo9NBPIFINleLXU6Aw+oUWQxgKvXXxopRp8r5ivBXdmAj6dd1sonXXhSl3IvLNIIVvopAsHSsvhZijoe7pMZ0WWfOOZcZ9/yaNWBgt14xF1hgHfP43dhFm+QxSDDj6XajUXIJ80umU7GzhyJSQtxVChCWRddGY7B/ADaRE4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U6K3L1HtCiPUcGAN/qyFgv7EXrj2rJCF4V/MSItzG3JB1LjCjzYlfXPIuHa3IuRoDhcZwxUuAvverbOXVcpF1QpGlMW3lt5tQAm1u5CBJLr/WspxQ0EcyYZv8yPv6Cp+cVCT6K4M9Mke/jZIJawG5V+UwvXzeaHMJaPao5YvEyyN/1IRo0i793 8NYTAfXUSxuBAwyubHCZccjXMmRdWqdzs3jbrp241BsQv+jTGwAFG0R1Pr4e9AlvYJnnt9bBQGu7IKKKKUnxZwboFhSbG2a/jT X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0P220MB0675.NAMP220.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: db6dd0e2-b141-41e5-deee-08db30f8558c X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Mar 2023 08:25:34.7847 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0P220MB0840 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:258904 Archived-At: --_000_SJ0P220MB067507D9876B3118B1F50AD7978E9SJ0P220MB0675NAMP_ Content-Type: text/plain; charset="gb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dHBzOi8vZ2l0aHViLmNvbS9lbWFjcy1taXJyb3IvZW1hY3MvYmxv Yi9iZmEzNTAwYzNjNmU0ZGY1ODk3OGU4NDc1MzcxOGNkNTM1OGMwNmZiL2xpc3AvcHJvZ21vZGVz L3B5dGhvbi5lbCNMNjYzNy1MNjYzOQ0KPj4NCj4+DQo+PiBUaGlzIGJlaGF2aW9yIGlzIGFsc28g dmVyeSBjb21tb24gaW4gZWxpeGlyLCBzbyBjYW4gd2UgYWRkIHRoaXMNCj4+IHRvDQo+PiBlbGl4 aXItdHMtbW9kZT8gdGh4DQo+DQo+IFdpbGhlbG0sIFdEWVQ/DQoNClllcywgSSB0aGluayB3ZSBz aG91bGQgYWRkIHNvbWUgdmVyc2lvbiBvZiB0aGlzLiAgSSBhbSBjdXJyZW50bHkNCnRlc3Rpbmcg YQ0Kc3ludGF4LXByb3BlcnRpemUtZnVuY3Rpb24gYWRkaXRpb24gdG8gc29sdmUgYW4gaXNzdWUg cmVsYXRlZCB0bw0KZWxlY3RyaWMtcGFpci1tb2RlIGFuZCB3aWxsIGhhdmUgYSBsb29rIGF0IHRo aXMgc3RyYWlnaHQgYWZ0ZXIuDQoNClRoZXJlIHdhcyBhbm90aGVyIHJlcXVlc3QgdG8gYXV0b21h dGljYWxseSBpbnNlcnQgYGVuZGAgd2hlbiBgZG9gDQppcw0KZW50ZXJlZCwgd2hpY2ggbWlnaHQg YmUgYSBnb29kIGFkZGl0aW9uIGFzIHdlbGwuDQo= --_000_SJ0P220MB067507D9876B3118B1F50AD7978E9SJ0P220MB0675NAMP_ Content-Type: text/html; charset="gb2312" Content-Transfer-Encoding: quoted-printable
> automatically insert `end` when `do` is entered, which might be a good
> addition as well.

Eglot can handle this and it works pretty good for now:

Open a ex file, enable `eglot`, insert `do` and press `tab`, eglot wil= l
help you insert `end` automatically.

I think it's better to let user trigger `do`'s completion.  Becau= se when
someone want to write a one line function, the `end` is not needed:

```elixir-ts
def foo(a), do: a
```

Anyway, hope to see the new feature ;)

=B7=A2=BC=FE=C8=CB: Wilhelm= Kirschbaum <wkirschbaum@gmail.com>
=B7=A2=CB=CD=CA=B1=BC=E4: 2023=C4=EA3=D4=C230=C8=D5 14:19
=CA=D5=BC=FE=C8=CB: Eli Zaretskii <eliz@gnu.org>
=B3=AD=CB=CD: =C4=B2 =CD=A9 <mou.tong@outlook.com>; 62536@debb= ugs.gnu.org <62536@debbugs.gnu.org>
=D6=F7=CC=E2: Re: bug#62536: 30.0.50; Can we add """ = ... """ electric pair in elixir, just like python
 
>> From: =C4=B2 =CD=A9 <mou.tong@outlook.= com>
>> Date: Thu, 30 Mar 2023 04:25:07 +0000
>>
>> In elixir, the docs in src are like this:
>>
>> ``` elixir-ts-mode
>> defmodule Foo do
>>   @moduledoc """
>>   Foo-related functions.
>>
>>   ## Examples
>>
>>       iex> Foo.sum(1, 2)
>>       3
>>   """
>>
>>   @doc """
>>   Calculate the sum of two numbers.
>>   """
>>   def sum(a, b), do: a + b
>> end
>> ```
>>
>> In python-mode, input the continious triple quotes, it will
>> insert the
>> left quotes when electric-pair-mode is on.
>>
>> python-mode did it here:
>>
>> https://github.com/emacs-mirror/emacs/blob/bfa3500c3c6e4df58978e84753718cd5= 358c06fb/lisp/progmodes/python.el#L6599-L6607
>>
>>
>> https://github.com/emacs-mirror/emacs/blob/bfa3500c3c6e4df58978e84753718cd5= 358c06fb/lisp/progmodes/python.el#L6637-L6639
>>
>>
>> This behavior is also very common in elixir, so can we add this >> to
>> elixir-ts-mode? thx
>
> Wilhelm, WDYT?

Yes, I think we should add some version of this.  I am currently
testing a
syntax-propertize-function addition to solve an issue related to
electric-pair-mode and will have a look at this straight after.

There was another request to automatically insert `end` when `do`
is
entered, which might be a good addition as well.
--_000_SJ0P220MB067507D9876B3118B1F50AD7978E9SJ0P220MB0675NAMP_--