From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 30 00:30:20 2023 Received: (at submit) by debbugs.gnu.org; 30 Mar 2023 04:30:20 +0000 Received: from localhost ([127.0.0.1]:55380 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1phjvY-0001cu-2A for submit@debbugs.gnu.org; Thu, 30 Mar 2023 00:30:20 -0400 Received: from lists.gnu.org ([209.51.188.17]:38222) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1phjvU-0001cj-LR for submit@debbugs.gnu.org; Thu, 30 Mar 2023 00:30:17 -0400 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 1phjvU-0004HT-Dj for bug-gnu-emacs@gnu.org; Thu, 30 Mar 2023 00:30:16 -0400 Received: from mail-bn8nam11olkn20800.outbound.protection.outlook.com ([2a01:111:f400:7eae::800] helo=NAM11-BN8-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1phjvR-0005TM-MD for bug-gnu-emacs@gnu.org; Thu, 30 Mar 2023 00:30:16 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QtrERyNE86zEGcxF4z1SLiOkcgUaSAL7hP6dxXNUXB+xjEJ2QoVkj8ptGXWKs10hHs1ZeaR4KKa4kQqLnRw6Igv+oPXfW2D17n/559o2CQuKH62wrdoZuV3Jx0W9Tz9zhrgdEahMD5XtgEfIbENc5Ffb/I3LPElPqXEbuW/9srU3Rl6oSEh+kE6DhVZcD7EvKsa30JD423x1p2W11tNc2JJJyYVl8b1eotq/osMTGOyjABWzPXGZmSAbBuklv4ooJ+up369m4JaNZyVpvsCwkSUvQE+mN8f/o4slhJkhXEhrQAgTsv0lxIZrAWwDCQUOFIg5zNA5N81vU5W6RyaqZg== 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=B08A4lAJ3qefR5Jg1wc8eRejTH61m3s/aeb2iQC14Us=; b=PceS1/k14FARyKcBVl97Bzm8CPkXEW8McmhMBZEGtSw4u5Hbe59Bn1gQAtKiYm9GSdiRrRDm54fZjmfSXfjN1be4k3jI7lDww12uVarB8p897b/plGj4yFaXol3NUHZMwCM+pPjrqHazncfTjXPHuTTBSJLj1OC7bo3OQUX9wbc0VH9jBexd5TdGYDYvhgwouudEBRjQZiaJFuv7dUep/sGfpDrABcC2oZU3PCwvxh83XbQBaD3p3s+JO6NnzFuOVC4xqFKaOIDR1qLisKdojEtv+5zT0fg6+/y9Wa6Xiy6Q7IiAruPtQQ/NjbZNt3n79dmR2veqA21lbtvLJfUlMg== 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=B08A4lAJ3qefR5Jg1wc8eRejTH61m3s/aeb2iQC14Us=; b=tSKiF+D0nMeYZYVqJU7mYOJ7uoxNmRQFFJvsZ1NI6oLFWfXCKjXFIcP/BG6FuIkMcklS3s3iMomrgQQl1FTxc+K9BFqbZujWmcKtlh2Anq6zOCda1e9O+9HTWqkEZtznF2/fO/uji/hlECHNYiRYdX+OUp4P1zgbbrPW+nT+A9CrACVk7N6CN0Og2AA8CiiB9AhmBtcll3yZqFrza9QkOlf2ZkD60NvtqOwqwFVUWe0oFkL5swZma0OVxQku2IWNbuTYNQoy061SMXg15FovgLgyM1IfoHsqR30GEkr1rTx5nPQUhkMV/tF3gh+Wzw4rJ2zorwLxqAToMAMCPdOieA== Received: from SJ0P220MB0675.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:3ad::6) by PH0P220MB0393.NAMP220.PROD.OUTLOOK.COM (2603:10b6:510:e0::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6222.35; Thu, 30 Mar 2023 04:25:08 +0000 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 04:25:07 +0000 From: =?gb2312?B?xLIgzak=?= To: "bug-gnu-emacs@gnu.org" Subject: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python Thread-Topic: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python Thread-Index: AQHZYr8GMTWpRfug3E6wTrhnmnjzpw== Date: Thu, 30 Mar 2023 04:25:07 +0000 Message-ID: Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-tmn: [fAx+zUQJ4AIJUeGt5F7wSue1WuBsUIqz] x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0P220MB0675:EE_|PH0P220MB0393:EE_ x-ms-office365-filtering-correlation-id: f5afb470-4bd2-48b5-6a92-08db30d6be74 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: iQ57ZC117JvUsYvyD6WI/gNu4x/J01mXYJM+4AdQqwHx6XlmB85y5Vexq/mGBLbGc63WeFyLDVsAbLe1cjfdsw5Fsz1H4HGA2QDQtyFGx1/msC4vmn+l8ZKKMe6uASffHzm3lCg3nPQCk07XuyDrhzuYgLsO4P0B8wM/LeVrXGL/NLcxm0LKLv+piP5zFZ3zgF66kivpaaOQ5Mn4ui2OsXIwfnQWkKXAOEkrTLagRwZlnw6F3ouxDk6YzRE4RlIdGhdwgkJw06ldD/Um+DUko+xL/7qrnqlVzIVHHU2Qwjoc1EbGZVCqOsVSJaQQRBqNnvZt9pWl/1kY/qLWpE7onfjX1au5qRH/0o32kUXF6ZJFQieJdqqfH3LAmUdoDoC8EwdU+QsZQcX0gC5n0x94JMQfpMMUxA27Uj6Q2DE8IBLT52dQ2S3lDRP+HakWoeZ41EafHk7Wwqly2q7CSqtfEmglt/GcKnklLKo8i3PPrn/iSx/vg26eP/UDlTrr/UWukIGPIIENXEvnyBPs6zMUt7kGKUVl5CzeADOizjCXTOY58Qj8xWsnUAFZqFW6n5vaWpHUf4WJoU3lTB7QxCDuIw== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?gb2312?B?djRDbTczOGxHd05ZOXVWT1hkSEZWT0Q2VDhrZzZHRExjb3RMYk5pR2lhNzhN?= =?gb2312?B?Y1k4MW5kaVFWZ2lNdjl0ZmRhcW4rVEdSdllzbGFuWnhpWlBrUFJKa1NkZ2Q1?= =?gb2312?B?T1VSd3Y4K2h5dHhlUER3TFpTUzlwM3FsZWxqcUpzYngwRmRsc1FXVzVlckIv?= =?gb2312?B?eWx6SGV5REFvL1lYTlpWNVlseXgxNlFOcGdVU3JKUVl0M0thTS9BVGFvd1FM?= =?gb2312?B?TDdtN1VXd0prSWlaZHBsbHdTRWRJUHZKazVNVDNhUzRnTnF3cVRIU3hnWEk4?= =?gb2312?B?VHVXY0ZtZmhQNzlIOEM3MHVDM1V4b2gxL0ZEY0lIUVBqeXo2YkhzT3lHUWdu?= =?gb2312?B?Y3VJSyt2eFpibUFWSUxJcHNjU2lsSVhEUGxmbzVTMktjMEo3alJ4elVWblBH?= =?gb2312?B?Wm5CT1Q1bERBWmxlM004cVlSQi9WZnowZlV5YWdzSDVYNE9Jelp2b1VuNzFa?= =?gb2312?B?R0Y4cDlQZjVrcTYyOHEyVi9PSDZmeGkrQU5mdEQ1Z0VMY3pkc2M5bW9Fbytw?= =?gb2312?B?Z29Kc1ZjcVJmS1V6NVZFVUY5YTQ4cHFjZ282Tko1ZTRQWWl4S056MFBSU295?= =?gb2312?B?RytBV1NuUnVFRWtDSWMxSVBpNnZ5amE5QkNOOFpRNkRpSUVLY3p4bWw4R3c1?= =?gb2312?B?QW1PYlVYT2UwME5WWWwyZEZrR0lsMC9na2Irb1gxNnl4M3BFZTdqZXpQTlhC?= =?gb2312?B?NDh5bTJKemV1OUJUcG9HL2hEcm84cDd4R0pHNkk1bHZvRFdSL2JtMlBkRmdF?= =?gb2312?B?dndmbkpVZ2I3ZlZPMEhPdnlWbjRDaHVuK1hTb1lIU3YwWGRtUU9Zbk8vck1r?= =?gb2312?B?NUZBc2FJMkNvS2dhb2Uvdk9YcnEyZ3JPMUY5YXpId1djcUpyek9ZQnRKa3k3?= =?gb2312?B?Nk9PV3ltNGZEVzhQVC9rSCtpVkNCMkZrR1BiN0Q1TXpiR0NKREM1Qyt0eWY5?= =?gb2312?B?empoTFU2OFRpOTRmMEtHbHZZckxXTnc2Wk1TcUgvU3UzVUNpekRPcGZLUFZG?= =?gb2312?B?UTdqaUs0TGJNVFFBUGF2eXU5NVlSNEkyZnFDcWtzUDdJSmljQ2hGZEtPU2Y1?= =?gb2312?B?OG1Za0V5TkhxZStiazlJdVVGKzgvSVdGN0k5Wk1UUk14OXBlU0tiRnBCN21k?= =?gb2312?B?UTFkTlgwaXFzdzR4UTNKUkNaVW5LZXRHdWpmWUJ2Z0twTS81OVR0MmN5NjJG?= =?gb2312?B?SGlaRTBYYlZEMmRFVVlrWGozV28zZjkvSUd0OVIxNFpoYnFBWGdjQzNlWlkz?= =?gb2312?B?ampaMVdZbXBCZVJldm02QW4vMkpkTHZIem8vU05OVjVWVXIzblVUaU1QampB?= =?gb2312?B?NjYzdXo0WGVXVy8yaFF0YlAwc0ZoWjdwQ0U0SnMzVzlCTCtyZ1Rob3o0MTl3?= =?gb2312?B?eUIxeHZQeXg4TUttTkpJS3p2dzRDbUwzSVZTckUrVDBWRUJpUk80MHA5bGVw?= =?gb2312?B?ZUgwaXpkcDJTQ0tNQ0VpSVErTC82RDB5YmkyMEoxbkxOeE9Dbzd6aUoxYkw1?= =?gb2312?B?Rm5BSngzODZvVzEzMURaTWhUVXZEUStDM2NYc3BKRFB6azEvTU85WjRkeSt0?= =?gb2312?B?M0kzOVp2TExFU1BvQVZOY3cyTU44SjJVa0hFY0llME1mMktJTG1CMFZ4VVJ4?= =?gb2312?B?S0RnNmhrUGk4NHl5VU5mdnlKdVF6K3c9PQ==?= Content-Type: multipart/alternative; boundary="_000_SJ0P220MB0675895F30898806808C8FA5978E9SJ0P220MB0675NAMP_" MIME-Version: 1.0 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: f5afb470-4bd2-48b5-6a92-08db30d6be74 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Mar 2023 04:25:07.9159 (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: PH0P220MB0393 Received-SPF: pass client-ip=2a01:111:f400:7eae::800; envelope-from=mou.tong@outlook.com; helo=NAM11-BN8-obe.outbound.protection.outlook.com X-Spam_score_int: 11 X-Spam_score: 1.1 X-Spam_bar: + X-Spam_report: (1.1 / 5.0 requ) BAYES_00=-1.9, CHARSET_FARAWAY_HEADER=3.2, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --_000_SJ0P220MB0675895F30898806808C8FA5978E9SJ0P220MB0675NAMP_ Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: base64 SGkhDQoNCkluIGVsaXhpciwgdGhlIGRvY3MgaW4gc3JjIGFyZSBsaWtlIHRoaXM6DQoNCmBgYCBl bGl4aXItdHMtbW9kZQ0KZGVmbW9kdWxlIEZvbyBkbw0KICBAbW9kdWxlZG9jICIiIg0KICBGb28t cmVsYXRlZCBmdW5jdGlvbnMuDQoNCiAgIyMgRXhhbXBsZXMNCg0KICAgICAgaWV4PiBGb28uc3Vt KDEsIDIpDQogICAgICAzDQogICIiIg0KDQogIEBkb2MgIiIiDQogIENhbGN1bGF0ZSB0aGUgc3Vt IG9mIHR3byBudW1iZXJzLg0KICAiIiINCiAgZGVmIHN1bShhLCBiKSwgZG86IGEgKyBiDQplbmQN CmBgYA0KDQpJbiBweXRob24tbW9kZSwgaW5wdXQgdGhlIGNvbnRpbmlvdXMgdHJpcGxlIHF1b3Rl cywgaXQgd2lsbCBpbnNlcnQgdGhlDQpsZWZ0IHF1b3RlcyB3aGVuIGVsZWN0cmljLXBhaXItbW9k ZSBpcyBvbi4NCg0KcHl0aG9uLW1vZGUgZGlkIGl0IGhlcmU6DQoNCmh0dHBzOi8vZ2l0aHViLmNv bS9lbWFjcy1taXJyb3IvZW1hY3MvYmxvYi9iZmEzNTAwYzNjNmU0ZGY1ODk3OGU4NDc1MzcxOGNk NTM1OGMwNmZiL2xpc3AvcHJvZ21vZGVzL3B5dGhvbi5lbCNMNjU5OS1MNjYwNw0KDQpodHRwczov L2dpdGh1Yi5jb20vZW1hY3MtbWlycm9yL2VtYWNzL2Jsb2IvYmZhMzUwMGMzYzZlNGRmNTg5Nzhl ODQ3NTM3MThjZDUzNThjMDZmYi9saXNwL3Byb2dtb2Rlcy9weXRob24uZWwjTDY2MzctTDY2MzkN Cg0KVGhpcyBiZWhhdmlvciBpcyBhbHNvIHZlcnkgY29tbW9uIGluIGVsaXhpciwgc28gY2FuIHdl IGFkZCB0aGlzIHRvDQplbGl4aXItdHMtbW9kZT8gdGh4DQo= --_000_SJ0P220MB0675895F30898806808C8FA5978E9SJ0P220MB0675NAMP_ Content-Type: text/html; charset="gb2312" Content-Transfer-Encoding: quoted-printable
Hi!

In elixir, the docs in src are like this:

``` elixir-ts-mode
defmodule Foo do
  @moduledoc """
  Foo-related functions.

  ## Examples

      iex> F= oo.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 q= uotes, it will insert the
left quotes when electric-pair= -mode is on.

python-mode did it here:

https://github.com/emacs-mirror/emacs/blob/bf= a3500c3c6e4df58978e84753718cd5358c06fb/lisp/progmodes/python.el#L6599-L6607=

https://github.com/emacs-mirror/emacs/blob/bf= a3500c3c6e4df58978e84753718cd5358c06fb/lisp/progmodes/python.el#L6637-L6639=

This behavior is also very common in elixir, = so can we add this to
elixir-ts-mode? thx
--_000_SJ0P220MB0675895F30898806808C8FA5978E9SJ0P220MB0675NAMP_-- From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 30 01:44:25 2023 Received: (at 62536) by debbugs.gnu.org; 30 Mar 2023 05:44:25 +0000 Received: from localhost ([127.0.0.1]:55455 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1phl5E-0003oo-Ug for submit@debbugs.gnu.org; Thu, 30 Mar 2023 01:44:25 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49184) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1phl5D-0003oV-Bc for 62536@debbugs.gnu.org; Thu, 30 Mar 2023 01:44:23 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1phl57-00034P-5J; Thu, 30 Mar 2023 01:44:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=XBsKSJwNCnwMBrVzBG/u4AH3zOqzDJ7xmDAnPu58uS8=; b=LpjdAQBtrpFcfV9l6FG9 Q4Z7fCcjcM32KsOHrn2ZvclEVePmkEJ+h9+zoARWB/nm/rUogeEaaKQoRAx9RbPok/BJXtAomxrQl 7hY8eQ6Wkrvr0b3L2Qix/5Jcko++JxRnyb66WJ5XyYH4JR5fdMBIqVpFb0DDRSZwnQtfEa14/vsE+ gHh1HtVmFhTTSk47AY3A5uhubvXnZU2KAmOjEW+9oyytNJyRwBSE6U+G3a7ETuclC/U5opxoCIKAg SeJ1smLjCV3ll/PPR4AVK998vENhvmcn6Iddl59eZa4kHoAfvZnAKXe5e0W/++oQwM5d2XfbYzUsE N66qvN0Af/Aq7Q==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1phl56-00073M-GY; Thu, 30 Mar 2023 01:44:16 -0400 Date: Thu, 30 Mar 2023 08:44:26 +0300 Message-Id: <83sfdm6bet.fsf@gnu.org> From: Eli Zaretskii To: =?gb2312?B?xLIgzak=?= , Wilhelm H Kirschbaum In-Reply-To: (message from =?gb2312?B?xLIgzak=?= on Thu, 30 Mar 2023 04:25:07 +0000) Subject: Re: bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python References: MIME-version: 1.0 Content-type: text/plain; charset=gb2312 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62536 Cc: 62536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: IJ ͩ > 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/bfa3500c3c6e4df58978e84753718cd5358c06fb/lisp/progmodes/python.el#L6599-L6607 > > > https://github.com/emacs-mirror/emacs/blob/bfa3500c3c6e4df58978e84753718cd5358c06fb/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? From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 30 02:31:42 2023 Received: (at 62536) by debbugs.gnu.org; 30 Mar 2023 06:31:42 +0000 Received: from localhost ([127.0.0.1]:55542 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1phlp0-00058C-F8 for submit@debbugs.gnu.org; Thu, 30 Mar 2023 02:31:42 -0400 Received: from mail-wm1-f54.google.com ([209.85.128.54]:42588) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1phloy-00057y-00 for 62536@debbugs.gnu.org; Thu, 30 Mar 2023 02:31:40 -0400 Received: by mail-wm1-f54.google.com with SMTP id m6-20020a05600c3b0600b003ee6e324b19so11039599wms.1 for <62536@debbugs.gnu.org>; Wed, 29 Mar 2023 23:31:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680157894; 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=T7lPJA2xsIkmrW/QV34XstqW63YFUMytl5X9LqqtQ/Q=; b=BnUbpgUhPvhC+8jMYLJwC3S8WAuNXUQMS/E62xzIrgN0kTQXHsqVCOQgFOwuqst0rN TkfiFiM6gfDCVAJD4c9yPIZqOk1CQSazwzguAuGH3EylWdgWRA7RKA3r8E449fCcIM4G /gO4XvH/6wey3kRPVKVQvw5D2LWoE4kLNZojTtkXfs/fU6kOYb+NWGy025a3eXKbolxu JYmnT/MFUWcolJ5TeMxpk3V+++n8Hx1c4k2nRD+xoJXWpIcQQM5U/jKhD0rZKw9hr7QV LNwWTF4LXVMCY1t4oofg6Xyl5Wf8/6H+6G3RoQUC2tJcjQBH/QBRx3w6DzfW+ZJkbXg2 mkPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680157894; 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=T7lPJA2xsIkmrW/QV34XstqW63YFUMytl5X9LqqtQ/Q=; b=W223ZpHIjP1rR8ZqnLZk2QAFDwczi61N6mDS61j+XnvZAl624BP10L0qOQiunDX6eZ +zo++N4XdUsDg+J8YnDlqAvWxxOcepD3kXlkkxZ92VAbkz6GHQXp3ZxTftgid/sMFJPH WWs2nArysLwLG5Hi0Slqcm3gh5zkv4RLbqG6b98bqgVL1cWT0oZcMw6f4RZC/jcib3fl QwIHyr/Le1WwmBtNstEZaIly4buUyrRpSD6diyVblf4ZkCNFUtNvHFhH5QkJT4vPDpOH 2OLuWwZHZyCVsXZYDA3ssxFf5I5vNdRzk0f7EGsbflF6EtgDCOqEyGI2wyFVy2TcswVL Dd7Q== X-Gm-Message-State: AO0yUKV0TReO4PXg/IrxReiLOI+RbYZpaTMVOtWd1EKO4dLETkREo2XG zNs7xDT9+OP7LNoYSViPNyhvTnBUTCQ= X-Google-Smtp-Source: AK7set8wp1KO1qMQoTe8fjC/rDS7E8L2uZIC9gNCnbjnGBw3//NesAV9gDPU+hsHuqnDx9Xt4fn8mQ== X-Received: by 2002:a1c:f217:0:b0:3ee:5c4c:bdb0 with SMTP id s23-20020a1cf217000000b003ee5c4cbdb0mr16739037wmc.39.1680157893735; Wed, 29 Mar 2023 23:31:33 -0700 (PDT) Received: from melissa.local ([2c0f:ef18:1431:0:b09:9616:db04:c248]) by smtp.gmail.com with ESMTPSA id z15-20020a05600c220f00b003ef5f77901dsm4534054wml.45.2023.03.29.23.31.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Mar 2023 23:31:33 -0700 (PDT) References: <83sfdm6bet.fsf@gnu.org> User-agent: mu4e 1.9.3; emacs 30.0.50 From: Wilhelm Kirschbaum To: Eli Zaretskii Subject: Re: bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python Date: Thu, 30 Mar 2023 08:19:05 +0200 In-reply-to: <83sfdm6bet.fsf@gnu.org> Message-ID: <87edp6oim6.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62536 Cc: 62536@debbugs.gnu.org, =?utf-8?B?54mfIOahkA==?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> From: =E7=89=9F =E6=A1=90 >> Date: Thu, 30 Mar 2023 04:25:07 +0000 >>=20 >> In elixir, the docs in src are like this: >>=20 >> ``` elixir-ts-mode >> defmodule Foo do >> @moduledoc """ >> Foo-related functions. >>=20 >> ## Examples >>=20 >> iex> Foo.sum(1, 2) >> 3 >> """ >>=20 >> @doc """ >> Calculate the sum of two numbers. >> """ >> def sum(a, b), do: a + b >> end >> ``` >>=20 >> In python-mode, input the continious triple quotes, it will=20 >> insert the >> left quotes when electric-pair-mode is on. >>=20 >> python-mode did it here: >>=20 >> https://github.com/emacs-mirror/emacs/blob/bfa3500c3c6e4df58978e84753718= cd5358c06fb/lisp/progmodes/python.el#L6599-L6607 >>=20 >>=20 >> https://github.com/emacs-mirror/emacs/blob/bfa3500c3c6e4df58978e84753718= cd5358c06fb/lisp/progmodes/python.el#L6637-L6639 >>=20 >>=20 >> This behavior is also very common in elixir, so can we add this=20 >> to >> elixir-ts-mode? thx > > Wilhelm, WDYT? Yes, I think we should add some version of this. I am currently=20 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`=20 is entered, which might be a good addition as well.=20 From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 30 04:25:44 2023 Received: (at 62536) by debbugs.gnu.org; 30 Mar 2023 08:25:44 +0000 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 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== 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 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 From: Mou Tong To: Wilhelm Kirschbaum Subject: =?gb2312?B?u9i4tDogYnVnIzYyNTM2OiAzMC4wLjUwOyBDYW4gd2UgYWRkICIiIiAuLi4g?= =?gb2312?Q?"""_electric_pair_in_elixir,_just_like_python?= Thread-Topic: bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python Thread-Index: AQHZYsqs/+/sPlzwQ0e4xl/M7HdCCq8S2XmAgAAeD18= Date: Thu, 30 Mar 2023 08:25:34 +0000 Message-ID: References: <83sfdm6bet.fsf@gnu.org> <87edp6oim6.fsf@gmail.com> In-Reply-To: <87edp6oim6.fsf@gmail.com> Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: 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/ADaRE4LMJ9z6UyS2S1dGVPVxt1TOdorAm4/Ps//4+bvk3MCyjXuvIqEI7PYtY2fB+IJeLZa21a6iY3czwUV5JirWXK117uifuoIeCIC+lmo9GGl3Yd91xOJ7toNy3s/6AY71UZpwjVtvWvV/TM7GFZcZxvR/vNw30qxl/4jswjkLUstE3PDIPbcqoJWHTNN8PUWu4oVGFYMrml/3JQYZWflgM43veZCNDKtlMiHn4Y0OyMkmiIRB3il1jHnJDyF0gB/KxhdT6hs7nOZSogBv0ONcGk7UC0YzCXSdaAhz7CKnse6/FGT6k7N8GhZjtwFWP7PZbrrIhsmqM2olGJSa4nSCkueBmvOhagfC4/9NW+w6+WPPz5bxAwOznkdko2wYfnDiuRPR7G9zT0M9+XxEq77uU4PBt2F1Vh4ZiPGbjT3EMTZWSndDayFGtKEjoyUJUQ== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?gb2312?B?UzFlVkJuTFlQdmdSNWd0clcvNGswNVZHTWZCSTM4YTJBMmFZaEkveFFwL0xw?= =?gb2312?B?dVdIVnlsSXJZR1VzZlhzUXI5QUx5dzVZcVJ4U1kvdFlDMjN2QTYzS1FTTGVM?= =?gb2312?B?Z1NlSFljaXo0SWhXeE5YamxoTnBlcjl5Y3FPVUVGcE9SUTF2YXBONDVnNkZ4?= =?gb2312?B?cG9GZTI3WHRLWlJTOXNwNi9EVEpTYjhjQkNhOUFPenhXdktRZHh1bXh5Mi9V?= =?gb2312?B?WjE1M3dHNXplRUZIVlQxanhQY25qdEJLZHFzMVVEV0puc21LdFA1eEJKS3p1?= =?gb2312?B?V1JYRHhHNlc3QWdqOGdNWWVjZmpoUXZLVE9QMnRtNzR0S3RVdVNXcUJIYUMw?= =?gb2312?B?ZDVmL3k2Zk1jSWRjeEtQRlNJKzluY2JzNGtvWkxGZHM2c0F2R2RGUjQ4QkR1?= =?gb2312?B?R2FXam5xcDYzQzVwZzMrNXdCK2Y1allQcW5YT2dWUWFvaWFBS0o2M2w4SWNz?= =?gb2312?B?NWZTdzhnRDBGL2RqcUlYZjlTS3dUQW4zUGpEcTNRdGFaVCtqdS9pdUVLVzFQ?= =?gb2312?B?WUdOUXc2VjM1b3RHSmUrTGVpdjFxZWFWclovM3hDSnRBdHAyV0pMNXVETFh5?= =?gb2312?B?bnV6OU9BQ0JiM0JmRG5sbUFUNUFYZWs3VVgxdVBldzdxNkMvY0hoazJZcFpy?= =?gb2312?B?aWZaV0xUVGxRaXNKMy9QbGlzcyt6QjVCRHh2VW5HRzRpWHF4ZFNRQWxEVEFP?= =?gb2312?B?Y0p4bFlIUWxtM2dXUFBsOHdPTXh6MEt6S1dCZlZrZDZqQWp6MlA5ZFU2SzNM?= =?gb2312?B?MUh0Q2lQVWNHQU4vcXlGZ3Y3RVhyajJySkNGNFYvTVNJdHpHM0pCMUxqQ2p6?= =?gb2312?B?WWxmWFBJdUhhM0l1Um9EaGNad3hVdUF2dmVyYk9YVmNwRjFRcEdsTVczbHQ1?= =?gb2312?B?dFFBbTF1NUNCSkxyL1dzcHhRMEVjeVladjh5UHY2Q3ArY1ZDVDZLNE05TWtl?= =?gb2312?B?L2paSUphd0c1VitVd3ZYemVhSE1KYVBhbzVZdkV5eU4vMUlSbzBpNzkzOE5Z?= =?gb2312?B?VEFmWFVTeHVCQXd5dWJIQ1pjY2pYTW1SZFdxZHpzM2picnAyNDFCc1F2K2pU?= =?gb2312?B?R3dBRkcwUjFQcjRlOUFsdllKbm50OWJCUUd1N0lLS0tLVW54Wndib0ZoU2JH?= =?gb2312?B?MmEvalRLTy81alpwY1QwLzFWZjlNblR4aE9VOW9VOU4weVUzZ3JGaTVwUzdP?= =?gb2312?B?Z20vSEdoY3V0T3JVZmtIOGY5TTl5aGZFZThBWlFBSkVlL2MzQldyNVZJSkRV?= =?gb2312?B?cFlFRkNJNDN2QzU2MWpmVWtXOUR6TXFMeER6VE53Mlg5a0ZRYTk4dDVyREVv?= =?gb2312?B?WmNNYk5UNFcza1hDWnpwMFVJcVBTUXFnYmFBbFRLVjN0OE12SFA4bWFVSlBy?= =?gb2312?B?K2kzNldZaXJWWmVuMlBGSU5LY05zMlhMVS9EbWxaa2hFRmhuMHpmYnhDYmxE?= =?gb2312?B?a1FyN21iRmNVRFBXUlZXVG80UkszMkFLOHhveUk2ODNVd3RZeEZkcEZlZ2Zy?= =?gb2312?B?WDhTTE1hbnJxU29GSFdqdC9GUkhGVnZKNHZVVFlSZUJhTHE1eERWSnl1aVla?= =?gb2312?B?RmdDM1VQZmk5VEtJZWhOSkxFamluK0RjdkZvUjAzZU9JZGdrY3I0OEJNYjBy?= =?gb2312?B?Tng3emk4cVgyc0EzVFhRK242V21PT2c9PQ==?= Content-Type: multipart/alternative; boundary="_000_SJ0P220MB067507D9876B3118B1F50AD7978E9SJ0P220MB0675NAMP_" MIME-Version: 1.0 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-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 62536 Cc: "62536@debbugs.gnu.org" <62536@debbugs.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --_000_SJ0P220MB067507D9876B3118B1F50AD7978E9SJ0P220MB0675NAMP_ Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: base64 PiBhdXRvbWF0aWNhbGx5IGluc2VydCBgZW5kYCB3aGVuIGBkb2AgaXMgZW50ZXJlZCwgd2hpY2gg bWlnaHQgYmUgYSBnb29kDQo+IGFkZGl0aW9uIGFzIHdlbGwuDQoNCkVnbG90IGNhbiBoYW5kbGUg dGhpcyBhbmQgaXQgd29ya3MgcHJldHR5IGdvb2QgZm9yIG5vdzoNCg0KT3BlbiBhIGV4IGZpbGUs IGVuYWJsZSBgZWdsb3RgLCBpbnNlcnQgYGRvYCBhbmQgcHJlc3MgYHRhYmAsIGVnbG90IHdpbGwN CmhlbHAgeW91IGluc2VydCBgZW5kYCBhdXRvbWF0aWNhbGx5Lg0KDQpJIHRoaW5rIGl0J3MgYmV0 dGVyIHRvIGxldCB1c2VyIHRyaWdnZXIgYGRvYCdzIGNvbXBsZXRpb24uICBCZWNhdXNlIHdoZW4N CnNvbWVvbmUgd2FudCB0byB3cml0ZSBhIG9uZSBsaW5lIGZ1bmN0aW9uLCB0aGUgYGVuZGAgaXMg bm90IG5lZWRlZDoNCg0KYGBgZWxpeGlyLXRzDQpkZWYgZm9vKGEpLCBkbzogYQ0KYGBgDQoNCkFu eXdheSwgaG9wZSB0byBzZWUgdGhlIG5ldyBmZWF0dXJlIDspDQpfX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fXw0Kt6K8/sjLOiBXaWxoZWxtIEtpcnNjaGJhdW0gPHdraXJzY2hiYXVtQGdt YWlsLmNvbT4NCreiy83KsbzkOiAyMDIzxOoz1MIzMMjVIDE0OjE5DQrK1bz+yMs6IEVsaSBaYXJl dHNraWkgPGVsaXpAZ251Lm9yZz4NCrOty806IMSyIM2pIDxtb3UudG9uZ0BvdXRsb29rLmNvbT47 IDYyNTM2QGRlYmJ1Z3MuZ251Lm9yZyA8NjI1MzZAZGViYnVncy5nbnUub3JnPg0K1vfM4jogUmU6 IGJ1ZyM2MjUzNjogMzAuMC41MDsgQ2FuIHdlIGFkZCAiIiIgLi4uICIiIiBlbGVjdHJpYyBwYWly IGluIGVsaXhpciwganVzdCBsaWtlIHB5dGhvbg0KDQo+PiBGcm9tOiDEsiDNqSA8bW91LnRvbmdA b3V0bG9vay5jb20+DQo+PiBEYXRlOiBUaHUsIDMwIE1hciAyMDIzIDA0OjI1OjA3ICswMDAwDQo+ Pg0KPj4gSW4gZWxpeGlyLCB0aGUgZG9jcyBpbiBzcmMgYXJlIGxpa2UgdGhpczoNCj4+DQo+PiBg YGAgZWxpeGlyLXRzLW1vZGUNCj4+IGRlZm1vZHVsZSBGb28gZG8NCj4+ICAgQG1vZHVsZWRvYyAi IiINCj4+ICAgRm9vLXJlbGF0ZWQgZnVuY3Rpb25zLg0KPj4NCj4+ICAgIyMgRXhhbXBsZXMNCj4+ DQo+PiAgICAgICBpZXg+IEZvby5zdW0oMSwgMikNCj4+ICAgICAgIDMNCj4+ICAgIiIiDQo+Pg0K Pj4gICBAZG9jICIiIg0KPj4gICBDYWxjdWxhdGUgdGhlIHN1bSBvZiB0d28gbnVtYmVycy4NCj4+ ICAgIiIiDQo+PiAgIGRlZiBzdW0oYSwgYiksIGRvOiBhICsgYg0KPj4gZW5kDQo+PiBgYGANCj4+ DQo+PiBJbiBweXRob24tbW9kZSwgaW5wdXQgdGhlIGNvbnRpbmlvdXMgdHJpcGxlIHF1b3Rlcywg aXQgd2lsbA0KPj4gaW5zZXJ0IHRoZQ0KPj4gbGVmdCBxdW90ZXMgd2hlbiBlbGVjdHJpYy1wYWly LW1vZGUgaXMgb24uDQo+Pg0KPj4gcHl0aG9uLW1vZGUgZGlkIGl0IGhlcmU6DQo+Pg0KPj4gaHR0 cHM6Ly9naXRodWIuY29tL2VtYWNzLW1pcnJvci9lbWFjcy9ibG9iL2JmYTM1MDBjM2M2ZTRkZjU4 OTc4ZTg0NzUzNzE4Y2Q1MzU4YzA2ZmIvbGlzcC9wcm9nbW9kZXMvcHl0aG9uLmVsI0w2NTk5LUw2 NjA3DQo+Pg0KPj4NCj4+IGh0dHBzOi8vZ2l0aHViLmNvbS9lbWFjcy1taXJyb3IvZW1hY3MvYmxv 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_-- From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 02 04:46:06 2023 Received: (at 62536) by debbugs.gnu.org; 2 Apr 2023 08:46:06 +0000 Received: from localhost ([127.0.0.1]:39195 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pitLh-0006bx-FG for submit@debbugs.gnu.org; Sun, 02 Apr 2023 04:46:06 -0400 Received: from mail-wr1-f52.google.com ([209.85.221.52]:33732) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pitLe-0006bJ-Mw for 62536@debbugs.gnu.org; Sun, 02 Apr 2023 04:46:03 -0400 Received: by mail-wr1-f52.google.com with SMTP id j24so26414475wrd.0 for <62536@debbugs.gnu.org>; Sun, 02 Apr 2023 01:46:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680425156; h=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=KjVg7RMr64SAggH/ZKBYlWDwrtSMF1TxRjcrB8XHzl4=; b=LSLdCqCXnOETs+TK/2GiTUFYHoRQ8I9yN3rcreH0q69oyLQUA7qzHf3aUeoUt2wbDk Jzss/m6Lp32XQ42b7VkQKSxfcXyam663m0ZdhgepfIWbfvbgvxoKScQGndO45TI8MS14 4t8bzsG4Qh/wGmf8swnztLS6uA8ASfcdDRJ8VYJjXefnLvgP4lhJia9VW/PmfHLiSvPP 3BX+uJDHwd8fKWyg43HvoRN5Qgv+EvckcmNwXCn5O8rQOmRyCgdrZzoZX9iVi0KGInY7 2hvJzA4pws6Id63wEwwv/r3UpfLhP5HO/m+lAXTtz9fdsFHY/SnDpj/TIflm84k5ANvC bZDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680425156; h=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=KjVg7RMr64SAggH/ZKBYlWDwrtSMF1TxRjcrB8XHzl4=; b=C0oXnoF5cCoB4Lb3FFGQVN9Z2dkYjFjdG3j5xJC+DgO8c0qATzqTv4uFKJA3HC5HG9 lnSwbmK4oAQ0qD8QTIrCsgP1MwweDdeKRBusA8USoHug2x0HrTTruzIaFPKtERhDA57e ZMvX11W7gEe8HttX6e98BPPhykgCJshnHFK8T7l1TTUd9U36nvXAjID2NoMpcSGVhohx 9fFb0O+aZZurdKb2FaxqERHMGylqsH/Rh4DpU4mkNHQC80YIEHwQ+dADEPSvxH5JsHgm piB1JlddmCRHEgb9sZIEvX7tsdCVJm78LLJRucuZ1kdyx5UtPoA0V/Yd3+PJdC0t3GKn n6bQ== X-Gm-Message-State: AAQBX9eNxSTEIl/sdzoNwg8gwu48uCxT17En8CcA4sgL71Tfpjsm5vc5 hq/7yiHhUdWMy3hsxB3251TuSRqoVpQ= X-Google-Smtp-Source: AKy350aYPHgiitFU4MdOGXeJWPwC3C4GJFCWRiiHSAGqb0XKZ5Meb4ne2EZlqJPjX7jRYQ7x9jjMUA== X-Received: by 2002:adf:f40e:0:b0:2cf:3399:998d with SMTP id g14-20020adff40e000000b002cf3399998dmr24901672wro.57.1680425156151; Sun, 02 Apr 2023 01:45:56 -0700 (PDT) Received: from melissa.local ([2c0f:ef18:1431:0:b09:9616:db04:c248]) by smtp.gmail.com with ESMTPSA id g7-20020a5d5407000000b002e6423cb207sm5738221wrv.112.2023.04.02.01.45.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Apr 2023 01:45:55 -0700 (PDT) References: <83sfdm6bet.fsf@gnu.org> <87edp6oim6.fsf@gmail.com> User-agent: mu4e 1.9.3; emacs 30.0.50 From: Wilhelm Kirschbaum To: Eli Zaretskii Subject: Re: bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python Date: Sun, 02 Apr 2023 09:49:20 +0200 In-reply-to: <87edp6oim6.fsf@gmail.com> Message-ID: <87lejay8n3.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62536 Cc: 62536@debbugs.gnu.org, =?utf-8?B?54mfIOahkA==?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Wilhelm Kirschbaum writes: >>> From: =E7=89=9F =E6=A1=90 >>> 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=20 >>> insert >>> the >>> left quotes when electric-pair-mode is on. >>> python-mode did it here: >>> https://github.com/emacs-mirror/emacs/blob/bfa3500c3c6e4df58978e8475371= 8cd5358c06fb/lisp/progmodes/python.el#L6599-L6607 >>> https://github.com/emacs-mirror/emacs/blob/bfa3500c3c6e4df58978e8475371= 8cd5358c06fb/lisp/progmodes/python.el#L6637-L6639 >>> This behavior is also very common in elixir, so can we add=20 >>> this to >>> elixir-ts-mode? thx Will it make sense to also add a newline when closing a multiline comment/heredoc? It feels smoother to me rather than having to=20 press enter and then C-o ( open-line ) to position the cursor correctly? Instead of this: (save-excursion (insert (make-string 2 last-command-event))) perhaps this: (save-excursion (newline) (insert (make-string 2 last-command-event))) (newline) Then the when you type @moduledoc """ it will jump to @moduledoc """ | """ instead of @moduledoc """|"""=20=20=20=20=20=20 I am adding two patches, one for the electric pair and another to=20 fix the issue where the point jumps to the end of a multi-line comment=20 when type `"` within the multi-line comment. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Propertize-heredocs-in-elixir-ts-mode.patch Content-Description: Propertize heredocs >From 5005439e007aa3f766b323f9a07cb9e5039820e8 Mon Sep 17 00:00:00 2001 From: Wilhelm H Kirschbaum Date: Tue, 21 Mar 2023 16:34:48 +0200 Subject: [PATCH 2/5] Propertize heredocs in elixir-ts-mode * lisp/progmodes/elixir-ts-mode.el (elixir-ts--syntax-propertize-query): New variable. (elixir-ts--syntax-propertize): New helper. (elixir-ts-mode): Set syntax-propertize-function. --- lisp/progmodes/elixir-ts-mode.el | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/elixir-ts-mode.el b/lisp/progmodes/elixir-ts-mode.el index 628d2000bd7..1985289d386 100644 --- a/lisp/progmodes/elixir-ts-mode.el +++ b/lisp/progmodes/elixir-ts-mode.el @@ -55,7 +55,9 @@ (declare-function treesit-parser-list "treesit.c") (declare-function treesit-node-parent "treesit.c") (declare-function treesit-node-start "treesit.c") +(declare-function treesit-node-end "treesit.c") (declare-function treesit-query-compile "treesit.c") +(declare-function treesit-query-capture "treesit.c") (declare-function treesit-node-eq "treesit.c") (declare-function treesit-node-prev-sibling "treesit.c") @@ -544,6 +546,22 @@ elixir-ts--defun-name (_ nil)))) (_ nil))) +(defvar elixir-ts--syntax-propertize-query + (when (treesit-available-p) + (treesit-query-compile + 'elixir + '(((["\"\"\""] @quoted-text)))))) + +(defun elixir-ts--syntax-propertize (start end) + "Apply syntax text properties between START and END for `elixir-ts-mode'." + (let ((captures + (treesit-query-capture 'elixir elixir-ts--syntax-propertize-query start end))) + (pcase-dolist (`(,name . ,node) captures) + (pcase-exhaustive name + ('quoted-text + (put-text-property (1- (treesit-node-end node)) (treesit-node-end node) + 'syntax-table (string-to-syntax "$"))))))) + ;;;###autoload (define-derived-mode elixir-ts-mode prog-mode "Elixir" "Major mode for editing Elixir, powered by tree-sitter." @@ -624,7 +642,8 @@ elixir-ts-mode ( elixir-sigil elixir-string-escape elixir-string-interpolation )))) - (treesit-major-mode-setup))) + (treesit-major-mode-setup) + (setq-local syntax-propertize-function #'elixir-ts--syntax-propertize))) (if (treesit-ready-p 'elixir) (progn -- 2.40.0 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0002-Handle-electric-heredocs-pairs-in-elixir-ts-mode.patch Content-Description: Handle electric heredocs >From 19704012ac83530e1a06531905411d0972e88a44 Mon Sep 17 00:00:00 2001 From: Wilhelm H Kirschbaum Date: Sun, 2 Apr 2023 09:43:20 +0200 Subject: [PATCH 5/5] Handle electric heredocs pairs in elixir-ts-mode * lisp/progmodes/elixir-ts-mode.el (elixir-ts--electric-pair-string-delimiter): New helper. (elixir-ts-mode): Add post-self-insert-hook. --- lisp/progmodes/elixir-ts-mode.el | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/lisp/progmodes/elixir-ts-mode.el b/lisp/progmodes/elixir-ts-mode.el index e2d9515c10f..576afd8104f 100644 --- a/lisp/progmodes/elixir-ts-mode.el +++ b/lisp/progmodes/elixir-ts-mode.el @@ -568,13 +568,25 @@ elixir-ts--syntax-propertize (put-text-property (1- (treesit-node-end node)) (treesit-node-end node) 'syntax-table (string-to-syntax "$"))))))) +(defun elixir-ts--electric-pair-string-delimiter () + "Insert corresponding multi-line string for `electric-pair-mode'." + (when (and electric-pair-mode + (eq last-command-event ?\") + (let ((count 0)) + (while (eq (char-before (- (point) count)) last-command-event) + (cl-incf count)) + (= count 3)) + (eq (char-after) last-command-event)) + (save-excursion + (insert (make-string 2 last-command-event))))) + ;;;###autoload (define-derived-mode elixir-ts-mode prog-mode "Elixir" "Major mode for editing Elixir, powered by tree-sitter." :group 'elixir-ts :syntax-table elixir-ts--syntax-table - ;; Comments + ;; Comments. (setq-local comment-start "# ") (setq-local comment-start-skip (rx "#" (* (syntax whitespace)))) @@ -584,9 +596,13 @@ elixir-ts-mode (rx (* (syntax whitespace)) (group (or (syntax comment-end) "\n")))) - ;; Compile + ;; Compile. (setq-local compile-command "mix") + ;; Electric pair. + (add-hook 'post-self-insert-hook + #'elixir-ts--electric-pair-string-delimiter 'append t) + (when (treesit-ready-p 'elixir) ;; The HEEx parser has to be created first for elixir to ensure elixir ;; is the first language when looking for treesit ranges. @@ -617,14 +633,14 @@ elixir-ts-mode ;; Indent. (setq-local treesit-simple-indent-rules elixir-ts--indent-rules) - ;; Navigation + ;; Navigation. (setq-local forward-sexp-function #'elixir-ts--forward-sexp) (setq-local treesit-defun-type-regexp '("call" . elixir-ts--defun-p)) (setq-local treesit-defun-name-function #'elixir-ts--defun-name) - ;; Embedded Heex + ;; Embedded Heex. (when (treesit-ready-p 'heex) (setq-local treesit-range-settings elixir-ts--treesit-range-rules) -- 2.40.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 02 12:38:50 2023 Received: (at 62536) by debbugs.gnu.org; 2 Apr 2023 16:38:50 +0000 Received: from localhost ([127.0.0.1]:42483 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pj0jC-0000qG-1i for submit@debbugs.gnu.org; Sun, 02 Apr 2023 12:38:50 -0400 Received: from mail-mw2nam10olkn2108.outbound.protection.outlook.com ([40.92.42.108]:38728 helo=NAM10-MW2-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pj0j9-0000q2-22 for 62536@debbugs.gnu.org; Sun, 02 Apr 2023 12:38:49 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F6+ovVpoIsUW8D72wrZrOBrvNTqAB1EAhHL9PcHah8mQC+fcUzDoFnfEoJQHbHfKJeufp8cG49LQhrxtr8/x3ymyxcSm8uD7uLfaFt74F26Ubad4e4BAtZ1k4/5ILdR/GwNCga0URwzfKSE1tpl7J/Uit8LGjWwIMLtWGUQ117uM1+5W9G+WFEZeeKMmxrwQ2fUSR4oGtGQFqzNyz1q/hIKGDBVBh1Icqci7b/JiRw2JDev7o5a8eqOfxNHycjbKzOqgLPk7GzCluz9GRBcYBpY8pUTArm5fs+aeUo5id15YPxvb1KsSPto1qv4LsJyuZhQDQ0WySz3PQcdm2yGJOw== 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=oVXHjHJ84OkGYuSJc2+7TDgsXjFYqpqZesZxkzSkfec=; b=OacxbFkq+Yjo6ct+pgHjYRX8Kt/Ob8mGR3RHIfxdLyLQEjDJTREfX9ES09H91IfrLjGPQTu21ydz6etTe+ARzP3iznY3XAMIvuHuwduJ1XSeOBsKX+kVVOuHSuyTmPUcokgcqiGMvlODgsGsh94JEiC5GPL5Xu4l+PG3ELIC9eEbSDakZpFTyL+mIuggkM1B9DOtMs/TL2nnJquqqr2TcxSP9mwQ3Q9tZ3XxWiemmJaCqq7ZNIXyhgXqN+JWXMYc/LVJVDm2v9rjt7p/bGnAtJvJxlLrI/T6gQEKKGWkTVQoR/kkOCAIcbjXJl6YCdHymHjBdBYV2mW+1pgRCO6omQ== 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=oVXHjHJ84OkGYuSJc2+7TDgsXjFYqpqZesZxkzSkfec=; b=CcZObJjcH4ObTKphKLnwbZWW7VY3vtizZZDjvQe9kDbsTIpI+/LarJ5qYJ426ixC2r3ipnZfo/onmkvhQej4gBArwGLpivb6/4qhMFqJsrVA7WAosWOT+MyR2YffCdordcu3o1tE8reCUVWg0WTOWcQsd2MrSYprW8BkY0VzuxoLw7bn7z2oewFyfcU13QfGccpdQ34wxr78vVWfu5oGpWcckloYvIl0l6gmpbEpAaTvkAFTgxRBFbNBN/C22l6TRwF/TGYVDcaGbdJ73EwBqxoJ4uYsz+gT8A4DSia30D1jL7nTS+VCtO4UYs0tVtabNOSVdF1ieP5oHvcfjjrBcw== Received: from DM8P220MB0686.NAMP220.PROD.OUTLOOK.COM (2603:10b6:8:3b::13) by DM8P220MB0407.NAMP220.PROD.OUTLOOK.COM (2603:10b6:8:24::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.29; Sun, 2 Apr 2023 16:38:40 +0000 Received: from DM8P220MB0686.NAMP220.PROD.OUTLOOK.COM ([fe80::e903:994:afea:4681]) by DM8P220MB0686.NAMP220.PROD.OUTLOOK.COM ([fe80::e903:994:afea:4681%7]) with mapi id 15.20.6254.030; Sun, 2 Apr 2023 16:38:39 +0000 From: Mou Tong To: Wilhelm Kirschbaum Subject: Re: bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python Thread-Topic: bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python Thread-Index: AQHZYsqs/+/sPlzwQ0e4xl/M7HdCCq8S2XmAgATQNQCAAJPeAA== Date: Sun, 2 Apr 2023 16:38:39 +0000 Message-ID: <06DAF2C4-C224-4C30-AAAE-96D1A84ED145@outlook.com> References: <83sfdm6bet.fsf@gnu.org> <87edp6oim6.fsf@gmail.com> <87lejay8n3.fsf@gmail.com> In-Reply-To: <87lejay8n3.fsf@gmail.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [iQ6voULHnDXI7/pQ+1p+Y/Kicly1XzW1] x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM8P220MB0686:EE_|DM8P220MB0407:EE_ x-ms-office365-filtering-correlation-id: 4338272c-dd2f-4e59-2ffd-08db3398b6e1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: GrAvSuJgjPH7qCadq2UeUZTbvDqy5R6vGaf22DQZA75qbiDuIF38IWxYlrqRRFsXHEbMZP42Nrz7fJs+cqeTFLrmFCmhR9WP9qxWzLZOh5UXZtJsGs22jOSjeLa3sZwWmPyaf8OG3MbaIxX33UE64rY5PGx0tI0tZXy4JXGb4XWTAbKn3WuVT/t0i5Z3/fgn3iXmXyzHRZMhvwGpwqthmhStnp6B+MtevVas/8HnvNcV+y/yvQhUUOOgGAt2P0kMxhKKk6d09wtZyuIxrZYadD77Ekp6cDhYwrzD+MAoWCMcMy1tmlJ6bUqsDvJKc8yTy4zr+EykgDf3PL4XqNwwg3zYEb9QsOQKce4kROb0oKlEeSn23v+3DUcCZWifbFyI7Boad3FYJv2zFDjXiZ/80MaVjqNVnFuSpio9LM4skqLbh72qqFJyKZiTIBgiqC5gwr/zvqw5tdhxeKYX6wMyBQ0IR4z50y5VY2uOBTPEbpyglYH8Tyu/jFk/b3p6c9uNOsUs/Xz4DcpwZ0D+Ljb1Xxr23lvATH5vXtMMN0d7MLmIuzCXEAdp8QEOhaBOI+gCyFiO5/QFnQjoOsS0r7zw2BZLhEDuYZF5Z6VOXq5mhMX78lGI8VLjycYIw/FKzMSg x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?UuS7VXnA3oHO8mIH4IrMimQ0gOV4D1nVDNJ/cwexhYdemKlsBt21Q+q+kydh?= =?us-ascii?Q?DOOxePuNZc5o51swiohC1QxhGaphduR4c8LNVY4zRLo1Ldo3BjrONWQd/l3E?= =?us-ascii?Q?3IZNWWQ9PpUbEtdoAKeBlw0kQ9GmXHkUPlp7+f6O6lVTcIWMXWJxuPYrucg8?= =?us-ascii?Q?IZb+fMMQKXMP77rT/tJ5t6IvqJTW/jlf3vf1SazRd0TuVhClcGARG+p0Hpdr?= =?us-ascii?Q?XBWGGUFNxRi7kEWAdZyel2UeStEkmvp4P+GHIqROoqkTA3ruiX2ctDXDikAo?= =?us-ascii?Q?klGV1yDyVifBJdZS9yKptsLqqNOAuJjiYKYnGNyPDS09o7NuBW/7Q71YHPPc?= =?us-ascii?Q?pBq+wfSh5y8VnClJlj08hfLs5o6ufx65D1cLgqer4OBibEy9WHFHxpvA21DR?= =?us-ascii?Q?FDUtInO3x1l9/pFefnABpboWFwoPrzmehLk80dV7AIlL8CPaciZ4RCP3jwL7?= =?us-ascii?Q?MAHuMUY2oOJG6ESB58h+Krg43NeTUxx3nhSnfTRzlL/kgo0GvsmF6fe3vVJ2?= =?us-ascii?Q?TqF5/VnO+NYTJa+SXztSsO8RlXOocdQn99Io/p4ASAdT0dFsaFxkWJbl7jLE?= =?us-ascii?Q?c3uYptfEWH5qfhFmtdXi3JTexQ+6BeLcYBjUZBXnkUCX/J9guZKWSmVM9cbg?= =?us-ascii?Q?My1Q7e1CRWpAkkVxPJPMCqUVSSVScagXUwSkS6Ohz1/AjV7RtK33ZrmhP4xC?= =?us-ascii?Q?12dn+NXqE3BLJ13TsSSsxpb7gYl2/pN/H4kWkV0jE2UMrtglS6KzHt4pxIIv?= =?us-ascii?Q?NLDVDYR21dPjkkcTjVl1OEHU6YhNJCElGdDYwnAGWiD5Qj4mDoE2eVVh4FWx?= =?us-ascii?Q?KSdlMitD9LtnD27w6xacjmv/KTwPmEtcZ8KRzo8V/JBvkRv/1Cl1l8Lb/RK2?= =?us-ascii?Q?xvE20v0js2LJhNUVD64zDxLzwi/gHlfq00XgAXDjdvTeRynf/aULEVrUwXvN?= =?us-ascii?Q?Ksz2xcJ1ii+gjX8gp28Bm0PwZHvkTeiW6IYd4SrI6G6kyudfzKD+Lvo14mgi?= =?us-ascii?Q?IV+0M9t+3rOW3Wl/dLONuEOTN7OezgD0KMi5CjNiTNYYLz8nq0mglUo3he71?= =?us-ascii?Q?W2PNUTYW+igDtcqZ3W55QisQsyT5t/SP53vjNTB6tRCX4EJ45EMjUvZB4Y7/?= =?us-ascii?Q?eGM3szRqCLg+zU+SjCGnLkHedhIHa0kOkoxjrhR7fvgvfHsSsDr9Ouu1s2n+?= =?us-ascii?Q?s6ddb7Q8WrX4KOcyfnED1JeuXUQ+6eOYJM18wyyuWRbCmItBijmcTcr1gwY?= =?us-ascii?Q?=3D?= Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM8P220MB0686.NAMP220.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 4338272c-dd2f-4e59-2ffd-08db3398b6e1 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Apr 2023 16:38:39.9273 (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: DM8P220MB0407 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 62536 Cc: "62536@debbugs.gnu.org" <62536@debbugs.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Will it make sense to also add a newline when closing a multiline > comment/heredoc? It feels smoother to me rather than having to press > enter and then C-o ( open-line ) to position the cursor correctly? I agree with you, but I think it might be better to imitate what `c-mode` did: ```c int main () {|} ``` When `electric-pair-mode` is on, input the left `{`, Emacs helps you complete the right `}`. After press enter, your cursor will move to the next line and auto-indented according to your offset config: ```c int main () { | } ``` So how about making it work like this? ```elixir-ts @doc """|""" # after press enter @doc """ | """ ``` From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 02 13:27:55 2023 Received: (at 62536) by debbugs.gnu.org; 2 Apr 2023 17:27:55 +0000 Received: from localhost ([127.0.0.1]:42541 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pj1Ug-0002Kp-T4 for submit@debbugs.gnu.org; Sun, 02 Apr 2023 13:27:55 -0400 Received: from mail-wr1-f54.google.com ([209.85.221.54]:34496) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pj1Ue-0002Kc-N3 for 62536@debbugs.gnu.org; Sun, 02 Apr 2023 13:27:53 -0400 Received: by mail-wr1-f54.google.com with SMTP id v1so27061239wrv.1 for <62536@debbugs.gnu.org>; Sun, 02 Apr 2023 10:27:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680456467; h=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=efgnwxuPBrxsLwMBkDZh4uYZLvv6clKK+FD6MitBgek=; b=nOZgGjWsXYUQVtUH8ViDYHy/d+DyTGofHvkuJUC2LL4dSfq4Bwd8cqOBblw+CW4hqg gd75B6vr5/3OqJ9aCJfiwJZILhRP+9bk4LRjIYqkelANbSppQcRtjTKiYKquioBHbBrD mb3vcHmEPK8SQfPGszHZrxS/hUf1eZJ4fggBHPJ6Adbp14oSE7DDUbIIZudh3KiS45Jh GiY0OwwspV/MC5k8jXptS2YNTnysgyncQbP0VPMys2b1fX39YCMUJoIvDeDeECm13dsR VgFzSJoZUBrY3K6CQlgPaGTk+AoP+brYTwQhR2005/zl2Maq95qh08TxpojJp67QKsqx GaRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680456467; h=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=efgnwxuPBrxsLwMBkDZh4uYZLvv6clKK+FD6MitBgek=; b=6CnQEcqbLrzH+CaIXEvZbpWk6UooF2OJdpTnwMKCobD/rssJlgiyRYfs7TIWWXeT9x ZiUseLWpZZ4MgClzKoEkHP/LT6czMOdrWwNDyWRfBAP7bAZddHxGES/1cD54omxIMenD 0AuawYtKSA9eIMZ/nSQ1pDG0wF87v36zP2DZDp9PRIU4yMbZkR4sBDDowxSYvHkGsUrH PknaIwct55ixQv1DGZ2A6BmcT30c2e56fs9sj+l31vD88wFSEJXDLxO0EesrPI5EJPuC B6opWP5AqeaR4QPeO9pPPWMph7K3Xuvp1HLIfxAPbIt6rFxOC6tDMZYfpLZTGWoUdiN1 i0hg== X-Gm-Message-State: AAQBX9dXkGhWvzU9fh8FZq3QfXItJxKNBw44FqQR2ckL16NoACWHb5pL Tm2IieeH7Wdiq+hPQUW3GG/flLi6xFI= X-Google-Smtp-Source: AKy350ZPqn0Tm9+D97UNYZLlTil4vZ0w+pjRxoZgy4T7QkrUY572sxjxg09ejY1Fx/LmZjYKh2swbQ== X-Received: by 2002:adf:f1cb:0:b0:2cf:e8b2:4f76 with SMTP id z11-20020adff1cb000000b002cfe8b24f76mr26516980wro.66.1680456466678; Sun, 02 Apr 2023 10:27:46 -0700 (PDT) Received: from melissa.local ([2c0f:ef18:1431:0:b09:9616:db04:c248]) by smtp.gmail.com with ESMTPSA id e19-20020a5d5953000000b002e6a1bf2162sm5754016wri.16.2023.04.02.10.27.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Apr 2023 10:27:46 -0700 (PDT) References: <83sfdm6bet.fsf@gnu.org> <87edp6oim6.fsf@gmail.com> <87lejay8n3.fsf@gmail.com> <06DAF2C4-C224-4C30-AAAE-96D1A84ED145@outlook.com> User-agent: mu4e 1.9.3; emacs 30.0.50 From: Wilhelm Kirschbaum To: Mou Tong Subject: Re: bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python Date: Sun, 02 Apr 2023 19:21:50 +0200 In-reply-to: <06DAF2C4-C224-4C30-AAAE-96D1A84ED145@outlook.com> Message-ID: <87bkk642k0.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62536 Cc: "62536@debbugs.gnu.org" <62536@debbugs.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Mou Tong writes: >> Will it make sense to also add a newline when closing a >> multiline >> comment/heredoc? It feels smoother to me rather than having to >> press >> enter and then C-o ( open-line ) to position the cursor >> correctly? > > I agree with you, but I think it might be better to imitate what > `c-mode` did: > > ```c > int main () {|} > ``` > > When `electric-pair-mode` is on, input the left `{`, Emacs helps > you > complete the right `}`. After press enter, your cursor will move > to the > next line and auto-indented according to your offset config: > > ```c > int main () { > | > } > ``` > > So how about making it work like this? > > ```elixir-ts > @doc """|""" > > # after press enter > @doc """ > | > """ > ``` Yes, I think that is better, let me have a go at it. I was concerned of doing unsolicited movement with my suggestion of inserting newlines. From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 02 15:38:25 2023 Received: (at 62536) by debbugs.gnu.org; 2 Apr 2023 19:38:25 +0000 Received: from localhost ([127.0.0.1]:42700 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pj3Wy-00009P-V5 for submit@debbugs.gnu.org; Sun, 02 Apr 2023 15:38:25 -0400 Received: from mail-wr1-f51.google.com ([209.85.221.51]:36657) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pj3Wv-00009B-Fz for 62536@debbugs.gnu.org; Sun, 02 Apr 2023 15:38:23 -0400 Received: by mail-wr1-f51.google.com with SMTP id i9so27251518wrp.3 for <62536@debbugs.gnu.org>; Sun, 02 Apr 2023 12:38:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680464295; h=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=SjcRsLzxh0Tiiw4jCt6podzTSKLxLfzjt12mfpMhABE=; b=X6R3SSnAT68B782+nwU2ECJFSAO3dktZrUl14Xm50rDF4Zx35ZNl4l4ZAn963MxJrP 2MIvuj0Al6PBuHta+M8kzr7YUw6HIvBiuPmOrmoMCgScQ19MyF2C2Ny1e1W2qo8tP5Uu +DHkh+gRzhVGCQgLboTflWVREjn/tMbHoysZg+vBFrmpqF5ib5zeqjMqUnAdF7o85cta 2AzB6WpB0L9VePVNB4BEwi2mA/GoK0AWccHl5JTj5X6Njtg3XUSjUEXkY2QDpWSJuKqo ZPvcBck0+ABTDdoRAOU/W6jb+7A/W9TSHQmBkq+nR/cXpnCmUb8Ir5mtxLcfMWDSp1rm f0TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680464295; h=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=SjcRsLzxh0Tiiw4jCt6podzTSKLxLfzjt12mfpMhABE=; b=e0r1/Y0cfkOwpGhPTc4jXSmzastx5Pux65eMq18IJQbcrzvz+JFj+qFKqQP01ZQpVZ V1FHt/TM3fvyvwuneEF4sU0a/tImF5HrmmSMk4PPTqLBOokZbt3a4RIqeoewL/1x3F1Y j2bOlQSB7X/fcVwP7ht28bndCmmtSSsegTcOo+d1AwSbenG5ySmo3PocoUicqTLGMGfC /GRY6lehtZBjDzcbE5tfDcIL4Wdfk8mrqjJdY9iKoHkEldv8I2itd/ytH/fM2vOHwDjr qSXa0VWK1J2bANCC94SK6vK3zYjUbwXPgU+aTiRTSPociW4BNY25l4l/XlhxaBa+mNpM ab4w== X-Gm-Message-State: AAQBX9c0UylPhxUgN9Zf0390tRbZkF68m4LF+Ep1w39P1kPq92YXS0Jb PTgZ00XxXLxR33CUkBvHxZoUAbSox5A= X-Google-Smtp-Source: AKy350Y46H4GjNem1Pv7OB7uhVe7dvMTQdSi19HfAp9N9YR9tCdqBSbucfbqBbyjb+xwnHJBMNeSmg== X-Received: by 2002:adf:de88:0:b0:2d8:5df8:4566 with SMTP id w8-20020adfde88000000b002d85df84566mr25518528wrl.8.1680464295104; Sun, 02 Apr 2023 12:38:15 -0700 (PDT) Received: from melissa.local ([2c0f:ef18:1431:0:b09:9616:db04:c248]) by smtp.gmail.com with ESMTPSA id y6-20020adff6c6000000b002ceac2ccc4asm7938581wrp.23.2023.04.02.12.38.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Apr 2023 12:38:14 -0700 (PDT) References: <83sfdm6bet.fsf@gnu.org> <87edp6oim6.fsf@gmail.com> <87lejay8n3.fsf@gmail.com> <06DAF2C4-C224-4C30-AAAE-96D1A84ED145@outlook.com> <87bkk642k0.fsf@gmail.com> User-agent: mu4e 1.9.3; emacs 30.0.50 From: Wilhelm Kirschbaum To: Mou Tong Subject: Re: bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python Date: Sun, 02 Apr 2023 21:24:24 +0200 In-reply-to: <87bkk642k0.fsf@gmail.com> Message-ID: <87edp2vzvg.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62536 Cc: "62536@debbugs.gnu.org" <62536@debbugs.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Mou Tong writes: > >>> Will it make sense to also add a newline when closing a >>> multiline >>> comment/heredoc? It feels smoother to me rather than having to >>> press >>> enter and then C-o ( open-line ) to position the cursor >>> correctly? >> >> I agree with you, but I think it might be better to imitate >> what >> `c-mode` did: >> >> ```c >> int main () {|} >> ``` >> >> When `electric-pair-mode` is on, input the left `{`, Emacs >> helps you >> complete the right `}`. After press enter, your cursor will >> move to >> the >> next line and auto-indented according to your offset config: >> >> ```c >> int main () { >> | >> } >> ``` >> >> So how about making it work like this? >> >> ```elixir-ts >> @doc """|""" >> >> # after press enter >> @doc """ >> | >> """ >> ``` > > Yes, I think that is better, let me have a go at it. I was > concerned > of doing unsolicited movement with my suggestion of inserting > newlines. Playing around with it I think we should add a newline, I changed my mind. Unlike the c example above, the following syntax is not valid elixir: `""""""` and it requires a newline to make it valid. Part of the appeal of making the heredoc electric is to keep the syntax valid. There should never be a reason for the heredoc to be on a single line and also makes the tree-sitter grammar invalid, which causes the blinking issue. This will mean: ``` @doc ""| ``` when typing `"` it will insert `\n"""` and thus have the minimal valid elixir syntax without doing extra movement. ``` @doc """| """ ``` This will be the change ( looking at the electric.el code ). From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 02 22:41:57 2023 Received: (at 62536) by debbugs.gnu.org; 3 Apr 2023 02:41:57 +0000 Received: from localhost ([127.0.0.1]:43038 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjA8r-0004Bd-HM for submit@debbugs.gnu.org; Sun, 02 Apr 2023 22:41:57 -0400 Received: from mail-dm6nam10olkn2027.outbound.protection.outlook.com ([40.92.41.27]:46688 helo=NAM10-DM6-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjA8m-0004BI-Da for 62536@debbugs.gnu.org; Sun, 02 Apr 2023 22:41:55 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=er5ucyeQfS2gCo5o33znCB41scw65Si2RhC1IwVwppOtpxkOUjmddyMOiIrtW81UAZ1g4Esqe9Sqk6XXxdt/zMu0a6SdCzx7m+0bP0Ckh6/3ERXVgr8CoxyrtBGbDgLQjznLEOGhRArkqIaNH+Q0MYkGscwp9khFJiFyhj1KcXckpi2aXe9tRKrTI/UKFIzx1CXsfXTR38NOk8Sr1wjc4v/qk7eCOnxerlAh1cZSUyMZvL1P2yL0s+C8s9qHIpFqyQAycy2X6Tao4dyz8ZsQB9Po2PLUXU5RtvY5WdYLkA2d1Nvq8Q/zZjcmpQWSLlScLhxtY2W3Tql4xII+hp0YEA== 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=YdeehTU8o0DPQWmiP1InAD0HhC+y9iZgzBpyl7lSfFI=; b=m13EpZ9qz0D189bFUp023Dj7Bp9qrDVJ6P1XIM/szrBRrjC0suxcMhRLnfeFLbrfgUSEqp4MvBWtcj3xxo9V3A59SySG/T0h6qGz42uZ3mCbyYia9dbArXShWvmVQQJxpL3CrthkSr+1buobaTrdTQpNSIDd7u7NBpw234YLdiuVjgpVKBKwvVDHAWV06loQeXt8kZALbuB3+K6iaAH+Pp4tMD/SDVZdWWvjvVGPkMS0C+kcCSz4hETpZwBXMNzf0iBISjlBvEXe98zd0cDuZqhGSssIeZWADN69abifUFz0rPYbF9rAlRkNhNli7ZDuI6EKFMd6Qzpwdm2dT4zRKg== 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=YdeehTU8o0DPQWmiP1InAD0HhC+y9iZgzBpyl7lSfFI=; b=LHIOSer79n9R02VCRvOZYiOG9g7yCYz2TmA6LUmq7Q4FI7fz78Ab58ma5+I+66OibNLojrT2bwcw88qSxFHqDm6YoTYYOt60p7iimTXGaa/5O/FMCCullOkTBaih2SS0+slDR3fW3Z0LnX+3W6k3F3dG/148+FcMtPwgr+/FYp9BEnMfuhpZYof/xG/aSUUxcyk0HBt3B+nvSoLvzHKq26UVgjBdu0o7MFNMp/MFqSboI6HP2OlFeBIY6Mul7h5JqHLoY7yZMQ3tcuMggrfk6QhnxWGxJOhawgxncb0AtOoADxDyHxomjOiHtxN1kz0TGm+jZb0lpME37MX5aBgI2w== Received: from SJ0P220MB0675.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:3ad::6) by PH0P220MB0762.NAMP220.PROD.OUTLOOK.COM (2603:10b6:510:115::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.30; Mon, 3 Apr 2023 02:41:45 +0000 Received: from SJ0P220MB0675.NAMP220.PROD.OUTLOOK.COM ([fe80::c67c:bdab:898b:fe7]) by SJ0P220MB0675.NAMP220.PROD.OUTLOOK.COM ([fe80::c67c:bdab:898b:fe7%6]) with mapi id 15.20.6254.033; Mon, 3 Apr 2023 02:41:45 +0000 From: Mou Tong To: Wilhelm Kirschbaum Subject: bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python Thread-Topic: bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python Thread-Index: AQHZYsqs/+/sPlzwQ0e4xl/M7HdCCq8S2XmAgATQNQCAAJPeAIAADBcAgAAiPgCAAHnN4A== Date: Mon, 3 Apr 2023 02:41:44 +0000 Message-ID: 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> In-Reply-To: <87edp2vzvg.fsf@gmail.com> Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [Kj/cE4KnDIvtIuVLR8C56FMM3ID1K9ld] x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0P220MB0675:EE_|PH0P220MB0762:EE_ x-ms-office365-filtering-correlation-id: c56ce5e0-a78a-4405-6c88-08db33ecf6df x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 9z1Ar1e+CqU2FqNzSJ0IFR4FWhmq3Ac972O7QcFqklmwqVofFjbsR3FDhgPdhqg9bWYZtl6+MlWANvHDbDv6VID9JJrT63JJAfGkoDZN3/j2KZxoh4GBH1m4DLdcOPotXmS9QkJl5WW7IHtIzo8Yny77tscMuP+5Wc2G1Y4hReY+d+F9NH6ToFEtxHiecYj3/3kL0U6wla6ZfNhQkvO/gVCMZNS/em37fZwKBRvW/sb8TQSpekstGfFQBWCOJowBUoy6FKQv1BK4kqsloNWgpXeaozyHp+2hwbGQNUdW5cYQaXq1OmPbP5ojIbj8z8kwroHw/OzCprhyqL1lZt4oSFIrV6i+jrIqWJ/c4HmjyPR+oljuZSEpziTkglWgL/LNqY9Rhr89TkskAr+dfYdDlB87IR971ZHzpdeQYgtNK5da9Aj8Hkqa31l333+zAiGZ22yDiUIKlfhCUvZ8Jjl9k831BHizWmW4qD+aQmSrd4JHYv/ad4j0Nn3YWzDjOyM2pQvdfUytIJGcGAMfZtmditQYenRkFHEykRgtJrzWCi7c6/hFJmAXmVXu5eP0W+r9 x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?gb2312?B?dG1oVDVwaGdmYlJWRC93c3l5UllEZm0zbXpWNm53Yk1YRkd3eWxvL3czSVNu?= =?gb2312?B?bDJLZEhEYjNSb2QxT2RIR2hkWUprZjlRYnJkeVFiYm1QazNxK2YrdnhOWUhD?= =?gb2312?B?YUxRaFNMTGJscTNoaTZPR1kwQXhJSi9sOGhiUDBiTlhqWVpkdGZsclNiWnVY?= =?gb2312?B?QXd0L1hNSFpTWDhxekh6bTd0eGxzb3ovTEVFc2hJV29jV2RWZGRTQWtCVVNN?= =?gb2312?B?a2h1NmJPUGdhaWppV3J3UTB5NlkreDhBMWd0U3pCUmQvdlJyVzUzTFFJM0Yr?= =?gb2312?B?M2lCZFFUUXlua2R3ampNR3dZeStYaHlsRzZMenlIVnNZNEp6S2NNWVE1Nzdv?= =?gb2312?B?cUdUVCtMVmtrWjYwUmVCN1RkMnY5enlwdWFQL0NoSzNFdW9zWG5QT2Vma0M2?= =?gb2312?B?TWhoVTRDLzNJMUVoSmYvYnRaeGRDcXhjU2RqNEN1aU42UXhhYnQrYlBuMXBB?= =?gb2312?B?MDViQjZrb1J0MUEzSmVUWFNRN2svSDVQUmZLZk1nUUpyK0p2UEFRSHJyZzBy?= =?gb2312?B?SVRVald2dkVPMkYwd09LbWxNZER3K2h6U2hVTUc4M0NBT2E5QVg0YlV3cWJ5?= =?gb2312?B?T3owUm5QSkdlZjNGNHZGVkZyWm9EUzI1YUlYTTFqZ1ByQTJsSDBTVXNvYTR4?= =?gb2312?B?VHQ1TzExOEE3RlJLZEJhbFFLTzFocVhkcG9IMWM1ZVFMeTEwTHhlc1FJbm1i?= =?gb2312?B?SzhqZStiUWNuTjRmaWdvb0xpOFpQQ1ozYXV4K2xxTkNBbXU2MThSVUhxM0ll?= =?gb2312?B?VFluc2lMQVJuZHZuamRIakZ4RUZnYWJYNWZweGRCNG00RVVrTGdaM2ZFejN3?= =?gb2312?B?dGxDdUc3dC9qeCtYUkFwTjNNRzNmblZYYVo0TVA1M1hrRzdzY1kyK0hZUFFJ?= =?gb2312?B?WlBkc09ORjllckpmc0dXbFZPYVVUaUI2T3g3Rzk2VVFTZk05ZEFsU2pLaTNL?= =?gb2312?B?WUxOREUydUlYbGlXK05JZDRSV2I4enBtZDgyVVFMTm95V2FTaGZ1bDFyZlFY?= =?gb2312?B?OWFVK0lrZWRPN1o2TEhUOVk5Y0k0NTVOSkpOZXhXeHVwR3JCVThKMlJQS2JN?= =?gb2312?B?UDdMZm54ak56TFZqSG5HaGdVaDQ5a1pkRlNoU1NuUTNlYml6UUx3VWloMFN5?= =?gb2312?B?aU9LVzRnQW1VS0FHUW5Ed0ZOVjVhVUpISVhTbGp1TGcwQ0Z3MG5zbWhhanIv?= =?gb2312?B?akhjVkc5T2NYL1QvU3M5cVJIbG85YzRUT1RjdzdrREFnMThUbFhIMTROSkJS?= =?gb2312?B?YW94cXBXRzgxa2dhbDRPZXdtS3dmUGtwZ1ZMRHNZT2xBb2x4cWR3bjRhT2Za?= =?gb2312?B?eHd3ZEpNL3hrTWJtTURLS3RYdXNxZE9OcTZBU2hJVHB4V2R4djJ4VGFmckVy?= =?gb2312?B?amF0d2pTODB5QVpwVU9SdjlRWnBhOFZpNFF0YkUwVUY1aFB4WVJnNDQxb1Ur?= =?gb2312?B?MVViaDRGSmp1YkdXTGFLVFF6RlUyUURhVmFneFpBT3pkS201aHNldWVnN2hX?= =?gb2312?B?T3lHdWsrL25wcm1ROVdOQzAvdmVHMjdjTFBhZG9ROGg1N3k5RFg0WjlYckRC?= =?gb2312?B?NlQzREgwQTJZcVlTbHJ0R3dyODVQTW1EVldvWXZiNndPS3locUsyV21jeWVX?= =?gb2312?B?Tk9OVzFzNXBmbmttQ3dKbFlKZFRmSEE9PQ==?= Content-Type: multipart/alternative; boundary="_000_SJ0P220MB06755396D8C105D6F868C45497929SJ0P220MB0675NAMP_" MIME-Version: 1.0 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: c56ce5e0-a78a-4405-6c88-08db33ecf6df X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Apr 2023 02:41:44.9907 (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: PH0P220MB0762 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 62536 Cc: "62536@debbugs.gnu.org" <62536@debbugs.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --_000_SJ0P220MB06755396D8C105D6F868C45497929SJ0P220MB0675NAMP_ Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: base64 PiBUaGVyZSBzaG91bGQgbmV2ZXIgYmUgYSByZWFzb24gZm9yIHRoZSBoZXJlZG9jIHRvIGJlIG9u IGEgc2luZ2xlIGxpbmUNCj4gYW5kIGFsc28gbWFrZXMgdGhlIHRyZWUtc2l0dGVyIGdyYW1tYXIg aW52YWxpZCwgd2hpY2ggY2F1c2VzIHRoZQ0KPiBibGlua2luZyBpc3N1ZS4NCg0KWW91IGFyZSBy aWdodCwgSSBkaWRuJ3QgY29uc2lkZXIgdGhhdC4NCg0KPiBgYGANCj4gQGRvYyAiIiJ8DQo+ICIi Ig0KPiBgYGANCj4NCj4gVGhpcyB3aWxsIGJlIHRoZSBjaGFuZ2UgKCBsb29raW5nIGF0IHRoZSBl bGVjdHJpYy5lbCBjb2RlICkuDQoNCkNvb2wsIGhvcGluZyB0byBzZWUgdGhlIG5ldyBmZWF0dXJl IHNvb24gKHNvIHNvcnJ5IEkgZG9uJ3Qga25vdyBtdWNoDQphYm91dCBlbGlzcCBhbmQgbWF5IG5v dCBiZSBhYmxlIHRvIGhlbHAgeW91IG11Y2ggd2l0aCBpdC4pDQo= --_000_SJ0P220MB06755396D8C105D6F868C45497929SJ0P220MB0675NAMP_ Content-Type: text/html; charset="gb2312" Content-Transfer-Encoding: quoted-printable
> There should never be a reason for the heredoc to be on a single line
> and also makes the tree-sitter grammar invalid, which causes the<= /div>
> blinking issue.

You are right, I didn't consider that.

> ```
> @doc """|
> """
> ```
>
> This will be the change ( looking at the electric.el code ).

Cool, hoping to see the new feature soon (so sorry I don't know much
about elisp and may not be able to help you much with it.)
--_000_SJ0P220MB06755396D8C105D6F868C45497929SJ0P220MB0675NAMP_-- From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 03 04:29:52 2023 Received: (at 62536) by debbugs.gnu.org; 3 Apr 2023 08:29:52 +0000 Received: from localhost ([127.0.0.1]:43321 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjFZX-000634-Gi for submit@debbugs.gnu.org; Mon, 03 Apr 2023 04:29:52 -0400 Received: from mail-wm1-f52.google.com ([209.85.128.52]:56083) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjFZV-00062o-QF for 62536@debbugs.gnu.org; Mon, 03 Apr 2023 04:29:50 -0400 Received: by mail-wm1-f52.google.com with SMTP id m8so5661210wmq.5 for <62536@debbugs.gnu.org>; Mon, 03 Apr 2023 01:29:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680510583; h=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=yJhXQG72u7tDNEjjm/7I4W+v5bKW1szVhnLB6MLRmEM=; b=DE7tTUz39zigI2R0FS7tm2vVmDXxICEYYDRdvKdenxRnVJM+9Sd/75gTUoaGBqdmSG 0XPXDT7mJCWcr3P27QO93QxaosPuK3bDduWRPsRhIszSysdHCeDOPO/t58hZhuHBOgNJ 1mr9trsrgbKScdhZTSMDG4iKm8nPmSP5BFyEQv/iYecMZ/n/xK9cmFEsNPcoDCaB5n7F rsnIHCfMdnSHvh1hSDFyiIsrs2B1MWNLqdci2QJd6dDv8VSKnr/8c/+U6Uv3PgJaioZb QalsK7hBumUdvh0qwop8nUUZ4eY6TYAnuZMg/btT5TRxXWYtba+rVpU+XyeDyvF/m3qS ucNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680510583; h=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=yJhXQG72u7tDNEjjm/7I4W+v5bKW1szVhnLB6MLRmEM=; b=tEHor38I9l6jY2CJiQGxXX67vbP3hRmY52sMN9XoGck/sf1oNWKu8Hr7FUrgETnGnp KYYAVHeACa5tTIRO3znNbuin0kG+SgisV8436WHyUUUlB4I75DjbzOt+T/knevcmZ5mQ hZTHL73iBa3M7g3oIR1tyGJDGrWAc8J2Wz7csksMxpHkTUZXjS/tEdpdIu+qFxid+6Et 6pXKKriFYkHiCQIRpPUdWZXdY/mtOicPW36bmLfAPCj5pdhiKVkIwA20mlWDB3ZXxxPn WwW/28xfl2odUYkXpmd2Rfg9OjF8h0oLGTagA3wc8AdPxjPjiMVY8ARqFGhkQmM3cQew YV3g== X-Gm-Message-State: AAQBX9ejiMXdU823WERwE0bqstgWxFjH7sSyA+Ch88WcVY5AA7MwVxNw jlq7KCqsMbkuhNLpu0e7qrblJ+MwweQ= X-Google-Smtp-Source: AKy350aPn9RHrJ3i8kh/NzIPHVjgomtlTmQ694KbTOsUnNi/8ueItnXv42ywuWiNItoiEUffBqHvAw== X-Received: by 2002:a7b:ce84:0:b0:3ef:6fee:803a with SMTP id q4-20020a7bce84000000b003ef6fee803amr17870585wmj.35.1680510583278; Mon, 03 Apr 2023 01:29:43 -0700 (PDT) Received: from melissa.local ([2c0f:ef18:1431:0:b09:9616:db04:c248]) by smtp.gmail.com with ESMTPSA id s15-20020a05600c45cf00b003eb2e33f327sm29186636wmo.2.2023.04.03.01.29.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Apr 2023 01:29:42 -0700 (PDT) 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> User-agent: mu4e 1.9.3; emacs 30.0.50 From: Wilhelm Kirschbaum To: Mou Tong Subject: Re: bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python Date: Mon, 03 Apr 2023 10:26:59 +0200 In-reply-to: Message-ID: <87h6tx74i4.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62536 Cc: "62536@debbugs.gnu.org" <62536@debbugs.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; format=flowed Mou Tong writes: >> There should never be a reason for the heredoc to be on a >> single line >> and also makes the tree-sitter grammar invalid, which causes >> the >> blinking issue. > > You are right, I didn't consider that. > >> ``` >> @doc """| >> """ >> ``` >> >> This will be the change ( looking at the electric.el code ). > > Cool, hoping to see the new feature soon (so sorry I don't know > much > about elisp and may not be able to help you much with it.) These two patches should then be sufficient to better handle heredocs for electric-pair-mode: --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Propertize-heredocs-in-elixir-ts-mode.patch Content-Description: Propertize heredocs >From 53a1caf7db5627b9d470b6f652d21812c1fac4db Mon Sep 17 00:00:00 2001 From: Wilhelm H Kirschbaum Date: Tue, 21 Mar 2023 16:34:48 +0200 Subject: [PATCH 1/4] Propertize heredocs in elixir-ts-mode * lisp/progmodes/elixir-ts-mode.el (elixir-ts--syntax-propertize-query): New variable. (elixir-ts--syntax-propertize): New helper. (elixir-ts-mode): Set syntax-propertize-function. --- lisp/progmodes/elixir-ts-mode.el | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/elixir-ts-mode.el b/lisp/progmodes/elixir-ts-mode.el index 286f3e39f43..0cd938c2fc9 100644 --- a/lisp/progmodes/elixir-ts-mode.el +++ b/lisp/progmodes/elixir-ts-mode.el @@ -55,7 +55,9 @@ (declare-function treesit-parser-list "treesit.c") (declare-function treesit-node-parent "treesit.c") (declare-function treesit-node-start "treesit.c") +(declare-function treesit-node-end "treesit.c") (declare-function treesit-query-compile "treesit.c") +(declare-function treesit-query-capture "treesit.c") (declare-function treesit-node-eq "treesit.c") (declare-function treesit-node-prev-sibling "treesit.c") @@ -547,6 +549,22 @@ elixir-ts--defun-name (_ nil)))) (_ nil))) +(defvar elixir-ts--syntax-propertize-query + (when (treesit-available-p) + (treesit-query-compile + 'elixir + '(((["\"\"\""] @quoted-text)))))) + +(defun elixir-ts--syntax-propertize (start end) + "Apply syntax text properties between START and END for `elixir-ts-mode'." + (let ((captures + (treesit-query-capture 'elixir elixir-ts--syntax-propertize-query start end))) + (pcase-dolist (`(,name . ,node) captures) + (pcase-exhaustive name + ('quoted-text + (put-text-property (1- (treesit-node-end node)) (treesit-node-end node) + 'syntax-table (string-to-syntax "$"))))))) + ;;;###autoload (define-derived-mode elixir-ts-mode prog-mode "Elixir" "Major mode for editing Elixir, powered by tree-sitter." @@ -627,7 +645,8 @@ elixir-ts-mode ( elixir-sigil elixir-string-escape elixir-string-interpolation )))) - (treesit-major-mode-setup))) + (treesit-major-mode-setup) + (setq-local syntax-propertize-function #'elixir-ts--syntax-propertize))) (if (treesit-ready-p 'elixir) (progn -- 2.40.0 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0002-Handle-electric-heredocs-pairs-in-elixir-ts-mode.patch Content-Description: Handle electric pairs for heredocs in elixir-ts-mode >From 467876e261ce6f0abfe3aa29b762fae795df65d0 Mon Sep 17 00:00:00 2001 From: Wilhelm H Kirschbaum Date: Sun, 2 Apr 2023 09:43:20 +0200 Subject: [PATCH 2/4] Handle electric heredocs pairs in elixir-ts-mode * lisp/progmodes/elixir-ts-mode.el (elixir-ts--electric-pair-string-delimiter): New helper. (elixir-ts-mode): Add post-self-insert-hook. --- lisp/progmodes/elixir-ts-mode.el | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/lisp/progmodes/elixir-ts-mode.el b/lisp/progmodes/elixir-ts-mode.el index 0cd938c2fc9..9d784aadb26 100644 --- a/lisp/progmodes/elixir-ts-mode.el +++ b/lisp/progmodes/elixir-ts-mode.el @@ -565,13 +565,27 @@ elixir-ts--syntax-propertize (put-text-property (1- (treesit-node-end node)) (treesit-node-end node) 'syntax-table (string-to-syntax "$"))))))) +(defun elixir-ts--electric-pair-string-delimiter () + "Insert corresponding multi-line string for `electric-pair-mode'." + (when (and electric-pair-mode + (eq last-command-event ?\") + (let ((count 0)) + (while (eq (char-before (- (point) count)) last-command-event) + (cl-incf count)) + (= count 3)) + (eq (char-after) last-command-event)) + (save-excursion + (insert (make-string 2 last-command-event))) + (save-excursion + (newline 1 t)))) + ;;;###autoload (define-derived-mode elixir-ts-mode prog-mode "Elixir" "Major mode for editing Elixir, powered by tree-sitter." :group 'elixir-ts :syntax-table elixir-ts--syntax-table - ;; Comments + ;; Comments. (setq-local comment-start "# ") (setq-local comment-start-skip (rx "#" (* (syntax whitespace)))) @@ -581,9 +595,13 @@ elixir-ts-mode (rx (* (syntax whitespace)) (group (or (syntax comment-end) "\n")))) - ;; Compile + ;; Compile. (setq-local compile-command "mix") + ;; Electric pair. + (add-hook 'post-self-insert-hook + #'elixir-ts--electric-pair-string-delimiter 'append t) + (when (treesit-ready-p 'elixir) ;; The HEEx parser has to be created first for elixir to ensure elixir ;; is the first language when looking for treesit ranges. @@ -614,14 +632,14 @@ elixir-ts-mode ;; Indent. (setq-local treesit-simple-indent-rules elixir-ts--indent-rules) - ;; Navigation + ;; Navigation. (setq-local forward-sexp-function #'elixir-ts--forward-sexp) (setq-local treesit-defun-type-regexp '("call" . elixir-ts--defun-p)) (setq-local treesit-defun-name-function #'elixir-ts--defun-name) - ;; Embedded Heex + ;; Embedded Heex. (when (treesit-ready-p 'heex) (setq-local treesit-range-settings elixir-ts--treesit-range-rules) -- 2.40.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 03 05:42:57 2023 Received: (at 62536) by debbugs.gnu.org; 3 Apr 2023 09:42:57 +0000 Received: from localhost ([127.0.0.1]:43356 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjGiG-00087C-Rp for submit@debbugs.gnu.org; Mon, 03 Apr 2023 05:42:57 -0400 Received: from mail-co1nam11olkn2060.outbound.protection.outlook.com ([40.92.18.60]:54241 helo=NAM11-CO1-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjGiC-00086r-Vx for 62536@debbugs.gnu.org; Mon, 03 Apr 2023 05:42:55 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Pg+Xbx8hyTbz9AYqd9gVEpBiZguRth6hTc4xZOab/UR2kTkSe4PB9L/p4rTGdaTUEbj1eASARNSCDZmKY9ZsHkE/mOJ8vVMS4IPY66TolwAM2ZqoDae3LtNGlQmM05/I7EMSMa13owxmMqe2KB+WA75afn3KcV3qTSpqgaw9Y0C0/8kv+a90eT9gRxETSp8QaFjoG2dP4DlqXztqfz1T3M+7It69BRviklzzIpFt16Go7CxQyv7r2w0SmfoLyDBXSrn43ia49awEZxVSed++Fi0MQObTR4UQwYWH/Tb+m2RyGoh/38tzqEAjEOOhvBfT0Pjgblb+TnI5HR5g1p0RcQ== 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=RHBY1MIkgLUR+aIlX+Cgm7wxsungWWNjgjoLOu8X/DY=; b=BIo1iIKccBvT2FdBm4NNUnrrJGvZEOXdRtCV7SbmDBzHEN7opsgK74Y3Ta/NbSl2NuKdMNsIBl2BKyKtBotdPJ+tHWAnvtphzxK+KOjEUEplOMdOADKGlu5snoeNKXWmVkR98zrtJCSqhn3uxf6zvIC6JUjdTUA+4LOyUHBmdGwJyK9DSAKigWdJW49s9OPjIbXQz7KqV5qo5kbfF4wVRqAZGqvQ3dMmTby7yuq/COiW+HPtyBXZ4c2wdEmNMHQfMs89/T5K+F5zrGu5SOOiMw9CzaBQprD1kb0QGH7SfhJv9qcWuWzmQedjxyOGnrFwNWkUzlgRjSU0UtC2YpGmLw== 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=RHBY1MIkgLUR+aIlX+Cgm7wxsungWWNjgjoLOu8X/DY=; b=XM8HaBuN5AZWBdi3QDSyQ2wUnJ4ZEFVwYDO9NrDSKOqHk3l1vR+bkOjcwsoPpl5rFPlfc4lnt95ufNRa8yPEZRBkxlm186thIE44FYRQ0xipdWhHHLlweWzVIKW0ZPo5+l6vdy2SuF6VvSk5XPXw6VKNnCee6wqQKtAcxUId6yU+SRxBEAoW+q+xIpGMGjhHE4/ws+Q2rci+1XQ0JllxS9Ok+XD1b0Nmr6vMWcDg+zC/Rczxfk98U9lcZcN/ix0kUmAxy176xZvajC2YtjjTj/mblzMqVSDJasOjCu5Xu7abmxzEgm+b/wU/1WlXJr3KWjuEPeH+ws+4YERwClexyg== Received: from SJ0P220MB0675.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:3ad::6) by DM8P220MB0405.NAMP220.PROD.OUTLOOK.COM (2603:10b6:8:38::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.33; Mon, 3 Apr 2023 09:42:46 +0000 Received: from SJ0P220MB0675.NAMP220.PROD.OUTLOOK.COM ([fe80::c67c:bdab:898b:fe7]) by SJ0P220MB0675.NAMP220.PROD.OUTLOOK.COM ([fe80::c67c:bdab:898b:fe7%6]) with mapi id 15.20.6254.033; Mon, 3 Apr 2023 09:42:46 +0000 From: Mou Tong To: Wilhelm Kirschbaum Subject: =?utf-8?B?5Zue5aSNOiBidWcjNjI1MzY6IDMwLjAuNTA7IENhbiB3ZSBhZGQgIiIiIC4u?= =?utf-8?Q?._"""_electric_pair_in_elixir,_just_like_python?= Thread-Topic: bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python Thread-Index: AQHZYsqs/+/sPlzwQ0e4xl/M7HdCCq8S2XmAgATQNQCAAJPeAIAADBcAgAAiPgCAAHnN4IAAYNqAgAALtNY= Date: Mon, 3 Apr 2023 09:42:46 +0000 Message-ID: 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> In-Reply-To: <87h6tx74i4.fsf@gmail.com> Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [cjhzEgRNa55w/Ld9HF5x6Q1RNuGLb2zC] x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0P220MB0675:EE_|DM8P220MB0405:EE_ x-ms-office365-filtering-correlation-id: 83d2fd77-89ca-4040-6851-08db3427c7a6 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: LZkBVPHlw/ua1EokfwhJ5Ze2nzZLjDRuZMjXH6uhe1XSX0RQnOR7hAGTjwzbFboSrXN+incdY16k5UZ3cGLC7dJLHQ0wgDDKwWBTjYGbw1kbZ+PghBK08O3B0E0WqddcfxiJz04i0kCzo4EIW+WCBMy2G/5Ibg/BVNF6+xtOOkrZuJh+5qvedL3M7KXPY3tv2LwA/Lp80oGNgrBKk1zAvFWsIC3d5wICBCliL1W1VKzAChwEzr4+gTePamnSKjUSqF6DJJ/iJqSFdwUVIWztQlnLxFvEwX35EiDPTs/HOooprXHTVpk04ZFEaVoqSHZdyQ8X9nX9olRkuqVKZ+0LJ++x7L4AOldScar7tEM0tbiECU/W3e6QZPLrJEIZ5v7y1h8X1Nnzkv0T8Ho5iMb7A5v0MJWk48Z0/Y6SGsKYHRS5vHde2vTNbTKxkKllk75K8PcTHxiJ2ch7RQ7/tPKj/BRogvw3bGRC2TRbd4JvtC93tuIrYaUE1DN2oYLlxzdcD7bDWNmQu1JGbzY+u3hcI1HGnwlyFN3miG2Syh6hNiStsJ88iThi417WWgXY10mL x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?UW9lRllaMzlwYTlDR1V4RVJVaUQxSTZGS0IyUW9pcFNGdUlONU1FVGZyRUl4?= =?utf-8?B?RUJUYUFuSEFQTnh0T2FnbDA5Q21GSjBjYnRzKzBzb3ZDVHA0YTBvY1ZiWS9h?= =?utf-8?B?ak1qc1cxaWNZcDBtU3FKakJNaHk1VGdZdkh3OVZTMnFPSEkySGJTVlhmeDZr?= =?utf-8?B?S1FPdWNLSTRPT29kcUtlQ2h6WDZJdGExckpIdzByMjFDQUZrQkw0ZmpKMEw5?= =?utf-8?B?U0ZUalJrdmFqV1VqWnV3SEdseW1RdDJ6c1NNNHlkVHlTNEgxcFBjN3N2L1Z6?= =?utf-8?B?ZmpDS1p4Y2RSSlBvS3VUQXBkV3M2ZHZqajJ6WEhMQVlMblZKSDFSZEZuamxO?= =?utf-8?B?bFBMRldzQzVKNlFwR2wyM2tPYlVaTDNTRjc5cFRqTWU5VmwvQWI2dVRwazFT?= =?utf-8?B?YXZna09yMDdtWFNJajRQbTdJOHNtV1pyU1o2YUg3ekN2cmVDWGVvSmZYNGE3?= =?utf-8?B?MWxBTnNSNkFocXJ4UkdIOXZvTmZnN21hNVU4Smcwa1BKclBzcUQrZlRVWlBL?= =?utf-8?B?L2JacUJ6T01yUEcvTDNyVzMvSytKSXNOSFRJeHVKSWtlTmRDVmEwTEhxYmVF?= =?utf-8?B?OHNaQTlXb1BhaU4zNE1kWnN5M1psVThRZnd2SkkxZnJEVEdLUGY0MG9RdzdW?= =?utf-8?B?S0lEVTNkdWl2WFF6bDkxS1c3dnNERUFSaCtvVkk1Y1FpRUlWSEJpSmJXQmlz?= =?utf-8?B?eVpHMC90Y2Qrb2VsOVhrR0RxVlZQeWcxakdZdFB1eTR2UnViMzNwSzI3MHhZ?= =?utf-8?B?SzQ1S01uRXI3TlJBL1FET2ZSNlcvOUpUcHA1bERVQ3daWm42TTk2K0x6eTdC?= =?utf-8?B?dmgrbFJxdGFYRTMxaDAzWjZJSGp1WExvVS9qRllOTmg4dlJ2OFV4c2Z0S2lK?= =?utf-8?B?cXN2OVVQL3JKaWVVVDNlNStUMjZaNy9PZThhcmwrQnJibGc2QUNRRk5BRG1y?= =?utf-8?B?bGxjcjlEM2xXaHNhcDV5NU9MK3ZHYXZSd3Z6TysrVzZKWDdWa1R4c0hyL3RQ?= =?utf-8?B?ckh6TXpMcFhNbURpa1JlaUFNOHFvb1R3TlFmSHA0UXJ2UjJER2VQbDFaTzNL?= =?utf-8?B?SlVTMlc3L1pIUFhRck96d3krMHRNRU1KZ2ZJQk02bDdzQnhHRmhRdU5sNDJT?= =?utf-8?B?V3ZWamRtS1FSQ0dCWFlVUTRNYVpuVzZLUXdFM3JGazJyc0tLLy8yWlI0UVFW?= =?utf-8?B?dTBXb3laU0Z6ckdzaUt4cGtIMC8yTWNPdjhmQktKanRxbTZ2TWlzOFlFYlYx?= =?utf-8?B?blhzOG5nMnU1bjNLeG1ZVDd2eU9JR1N4ZENIdUY2cHhVYTBQZ1Nydm5CSDJk?= =?utf-8?B?TE0xVHBoTzVsRk9na3ZCY1FsOENsSnk1ejAzSFI4YkxXM01BZnFvRTRrUFBE?= =?utf-8?B?d0JvU05JdlJUVGd6OHpwaU5rc1dlTWVOVzFTMW9BTTVhYmdlZHZOLzdCRlgx?= =?utf-8?B?TTNrMkxqNWJ0NVA5YVoyNkJpcm1sMzU2bFFrMWRON2ZvUXVHdWVoa1RLQnh1?= =?utf-8?B?YmJab2Q4SVNEWHNja3RueEhBSWF3UVpVWWVKdmRORG53aVVSa1gyTXNwd3o0?= =?utf-8?B?cTJuZUY3cVdvckl2RTlYeVFJWHhEYW5INnVveTVJdm5jR293TXNQZ3Vvc2th?= =?utf-8?B?aW0zSE9DeXp4ZmhJMUZGRVFRa3luREE9PQ==?= Content-Type: multipart/alternative; boundary="_000_SJ0P220MB067550C37E886C6C893CDDF197929SJ0P220MB0675NAMP_" MIME-Version: 1.0 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: 83d2fd77-89ca-4040-6851-08db3427c7a6 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Apr 2023 09:42:46.0921 (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: DM8P220MB0405 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62536 Cc: "62536@debbugs.gnu.org" <62536@debbugs.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --_000_SJ0P220MB067550C37E886C6C893CDDF197929SJ0P220MB0675NAMP_ Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 SSB0ZXN0ZWQgeW91ciBuZXcgcGF0Y2hlcyBhbmQgaXQgd29ya2VkIHBlcmZlY3RseSBmb3IgbWUu IFdoZW4gY2FuIHdlDQptZXJnZSBpdCBzbyBJIGNhbiByZW1vdmUgdGhlIGhhY2sgSSBhZGRlZCBp biBteSBjb25maWd1cmF0aW9uPyDwn5iEDQoNCnBzOg0KDQpXZSBjYW4gYWRkIGBlbGl4aXItdHMt bW9kZWAgdG8gYGF1dG8tbW9kZS1hbGlzdGAgYnk6DQoNCmBgYGVsaXNwDQooYWRkLXRvLWxpc3Qg J2F1dG8tbW9kZS1hbGlzdA0KICAgICAgICAgICAgICcoIlxcKFxcLmVsaXhpclxcfFxcLmV4cz9c XHxtaXhcXC5sb2NrXFwpXFwnIg0KICAgICAgICAgICAgICAgLiBlbGl4aXItdHMtbW9kZSkpDQpg YGANCg0KSXQgbWlnaHQgYmUgcmVkdW5kYW50IHRvIHdyaXRlIGBhZGQtdG8tbGlzdGAgNCB0aW1l cywgYW5kIG90aGVyDQptYWpvci1tb2RlcyBhcmUgYWRkZWQgdG8gYGF1dG8tbW9kZS1hbGlzdGAg Ynkgd3JpdGluZyBgYWRkLXRvLWxpc3RgDQpqdXN0IG9uY2UuDQo= --_000_SJ0P220MB067550C37E886C6C893CDDF197929SJ0P220MB0675NAMP_ Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: base64 PGh0bWw+DQo8aGVhZD4NCjxtZXRhIGh0dHAtZXF1aXY9IkNvbnRlbnQtVHlwZSIgY29udGVudD0i dGV4dC9odG1sOyBjaGFyc2V0PXV0Zi04Ij4NCjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyIgc3R5bGU9 ImRpc3BsYXk6bm9uZTsiPiBQIHttYXJnaW4tdG9wOjA7bWFyZ2luLWJvdHRvbTowO30gPC9zdHls ZT4NCjwvaGVhZD4NCjxib2R5IGRpcj0ibHRyIj4NCjxkaXYgc3R5bGU9ImZvbnQtZmFtaWx5OiBD YWxpYnJpLCBBcmlhbCwgSGVsdmV0aWNhLCBzYW5zLXNlcmlmOyBmb250LXNpemU6IDEycHQ7IGNv bG9yOiByZ2IoMCwgMCwgMCk7IGJhY2tncm91bmQtY29sb3I6IHJnYigyNTUsIDI1NSwgMjU1KTsi IGNsYXNzPSJlbGVtZW50VG9Qcm9vZiI+DQpJIHRlc3RlZCB5b3VyIG5ldyBwYXRjaGVzIGFuZCBp dCB3b3JrZWQgcGVyZmVjdGx5IGZvciBtZS4gV2hlbiBjYW4gd2UNCjxkaXY+bWVyZ2UgaXQgc28g SSBjYW4gcmVtb3ZlIHRoZSBoYWNrIEkgYWRkZWQgaW4gbXkgY29uZmlndXJhdGlvbj8g8J+YhDwv ZGl2Pg0KPGRpdj48YnI+DQo8L2Rpdj4NCjxkaXY+cHM6PC9kaXY+DQo8ZGl2Pjxicj4NCjwvZGl2 Pg0KPGRpdj5XZSBjYW4gYWRkIGBlbGl4aXItdHMtbW9kZWAgdG8gYGF1dG8tbW9kZS1hbGlzdGAg Ynk6PC9kaXY+DQo8ZGl2Pjxicj4NCjwvZGl2Pg0KPGRpdj5gYGBlbGlzcDwvZGl2Pg0KPGRpdj4o YWRkLXRvLWxpc3QgJ2F1dG8tbW9kZS1hbGlzdDwvZGl2Pg0KPGRpdj4mbmJzcDsgJm5ic3A7ICZu YnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsnKCZxdW90O1xcKFxcLmVsaXhpclxcfFxc LmV4cz9cXHxtaXhcXC5sb2NrXFwpXFwnJnF1b3Q7PC9kaXY+DQo8ZGl2PiZuYnNwOyAmbmJzcDsg Jm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsuIGVsaXhpci10cy1tb2Rl KSk8L2Rpdj4NCjxkaXY+YGBgPC9kaXY+DQo8ZGl2Pjxicj4NCjwvZGl2Pg0KPGRpdj5JdCBtaWdo dCBiZSByZWR1bmRhbnQgdG8gd3JpdGUgYGFkZC10by1saXN0YCA0IHRpbWVzLCBhbmQgb3RoZXI8 L2Rpdj4NCjxkaXY+bWFqb3ItbW9kZXMgYXJlIGFkZGVkIHRvIGBhdXRvLW1vZGUtYWxpc3RgIGJ5 IHdyaXRpbmcgYGFkZC10by1saXN0YDwvZGl2Pg0KPGRpdj5qdXN0IG9uY2UuPC9kaXY+DQo8ZGl2 PjwvZGl2Pg0KPC9kaXY+DQo8L2JvZHk+DQo8L2h0bWw+DQo= --_000_SJ0P220MB067550C37E886C6C893CDDF197929SJ0P220MB0675NAMP_-- From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 03 06:39:30 2023 Received: (at submit) by debbugs.gnu.org; 3 Apr 2023 10:39:30 +0000 Received: from localhost ([127.0.0.1]:43418 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjHaz-0001TU-Tj for submit@debbugs.gnu.org; Mon, 03 Apr 2023 06:39:30 -0400 Received: from lists.gnu.org ([209.51.188.17]:56272) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjHax-0001TG-VV for submit@debbugs.gnu.org; Mon, 03 Apr 2023 06:39:28 -0400 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 1pjHax-0003zD-Eq for bug-gnu-emacs@gnu.org; Mon, 03 Apr 2023 06:39:27 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pjHas-0007kU-AX; Mon, 03 Apr 2023 06:39:23 -0400 Received: by mail-wm1-x32f.google.com with SMTP id s13so16788517wmr.4; Mon, 03 Apr 2023 03:39:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680518359; 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=1Wy/ldDV7oJQaZA6VnhdMENBRChZ6P2t94xf9Rzi3cE=; b=OZGV2GjGcLO3gNAt3UvLXb3A0pFItJ+mpUEmRp77zV2cLW8XOPay2LSD7TvNz/AXV9 cEpvkO6uux8g45O1vaOgie50RxKJXRTaiJvdaTn1bjXiLvOd8UByh561FW7yLwzLwRM2 I1ZgPvvvjQQHky1FWJ/DULWmnY6McXwHpnrnyPx/QWQ3yS3Fss744/VLM47jVHpmzGV2 UHwsUAnP8oqvN9lbEzBxw96Ej1N4SwnrCQFnSOrIVPxHQQr1lkVUqRXjOYBrFZigFL7L hpTmWkkXaM4siwuJPio0PJk/u5vxlyf2F8BOvAIkYzDf8FjAc6VDFzBQwxG3sUI5AL9w sg/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680518359; 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=1Wy/ldDV7oJQaZA6VnhdMENBRChZ6P2t94xf9Rzi3cE=; b=N0F4m0m/x0TTJrOLKJPjXJfcmHb/FjKVGp0siWhaKmSPgIXIV50fhHS+nVhtTex6TF Ibxsr+3P2fpAEF00Hb1dkFSBAQ1AmdCIfEmKUrH88mezf/wvLm5l1Dtt9T4rNbtYaIA1 s0ps7r1HU6tm+cyKkGIfGYSpfzBBCQto+niD7FK8BwGJePEEMHB5wKEUOKI3edD+Vzy1 +XxJIBxSBfy67z1K6QQm6Mlcg5OYqg0bQq78+bM3L0+YoaTmMIZTw7G+cD3P5GvG5sY2 QI8+hD+rlXuIWsGB3SqOjoMVlZKvfd6oEgWcZXffNTKSRh9vquAS83vG8v0hmxE60cR+ G1fw== X-Gm-Message-State: AAQBX9czO03RS25c2XYvYA45fW4/j8bITV/7H/hO8M5ZvGtd5D4yLVNV mSQZZQUqPSnj0wWEh8wlWRKNxFe7yBUpAw== X-Google-Smtp-Source: AKy350aFyX3IstqDZQl396q+H/Ip0IMJYBx5FnZL+LABvJg8YY1e/UNr8+z0SKh6QTX9W6QFfcFoTg== X-Received: by 2002:a7b:c005:0:b0:3ef:5dd6:2f94 with SMTP id c5-20020a7bc005000000b003ef5dd62f94mr25226180wmb.31.1680518359442; Mon, 03 Apr 2023 03:39:19 -0700 (PDT) Received: from melissa.local ([2c0f:ef18:1431:0:b09:9616:db04:c248]) by smtp.gmail.com with ESMTPSA id t15-20020a05600c450f00b003ef7795e5a3sm19261389wmo.20.2023.04.03.03.39.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Apr 2023 03:39:18 -0700 (PDT) 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> User-agent: mu4e 1.9.3; emacs 30.0.50 From: Wilhelm Kirschbaum To: Mou Tong Subject: Re: bug#62536: =?utf-8?B?5Zue5aSNOg==?= bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python Date: Mon, 03 Apr 2023 12:38:17 +0200 In-reply-to: Message-ID: <87a5zp6yi4.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=wkirschbaum@gmail.com; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: bug-gnu-emacs@gnu.org, Eli Zaretskii , "62536@debbugs.gnu.org" <62536@debbugs.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) > I tested your new patches and it worked perfectly for me. When=20 > can we=20 > merge it so I can remove the hack I added in my configuration? =F0=9F=98= =84 > Great, happy that worked. Now we wait for Eli or someone to apply=20 the path on master if all is in order :). > ps: > > We can add `elixir-ts-mode` to `auto-mode-alist` by: > > ```elisp > (add-to-list 'auto-mode-alist > '("\\(\\.elixir\\|\\.exs?\\|mix\\.lock\\)\\'" > . elixir-ts-mode)) > ``` > > It might be redundant to write `add-to-list` 4 times, and other > major-modes are added to `auto-mode-alist` by writing=20 > `add-to-list` > just once. It makes sense, but don't want to just change this for the sake of changing if it is working as is. From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 03 08:02:49 2023 Received: (at 62536) by debbugs.gnu.org; 3 Apr 2023 12:02:49 +0000 Received: from localhost ([127.0.0.1]:43595 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjItc-0006ht-Qo for submit@debbugs.gnu.org; Mon, 03 Apr 2023 08:02:49 -0400 Received: from mail-ot1-f53.google.com ([209.85.210.53]:41720) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjIta-0006hh-Gv for 62536@debbugs.gnu.org; Mon, 03 Apr 2023 08:02:47 -0400 Received: by mail-ot1-f53.google.com with SMTP id f19-20020a9d5f13000000b00693ce5a2f3eso15462200oti.8 for <62536@debbugs.gnu.org>; Mon, 03 Apr 2023 05:02:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680523361; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=G6BdS1+66q3HqO7HM8tBKGSbA7cKXs81/6YFe8swsH4=; b=X4UaHTodVwcWIHasT6EfIpw9R8eG1z1ed6nVFv5DM+/mh1kSWhdQh4HRoDo/0HPgqH +4o/r3J9aikgiYR/FE1Oiijy8LwDGA9S27w0x/qxNrRfgOZ/C2/BA3vF8YTjJkNAGyz7 OUPA4vw/O8wzuK1OdSjBekmVowOBzX0Bpydu0cDJII8g7cm+2ME0/VIeZ169hm4rGvYJ 2Uv0NbXRyCLXwpfYx+/fIDYiQB4dXKWdt3SoVBEBArwuxjPBSpikuJpxmyWqf7HDRV/j +KrP8l/+S3iejv3BDpr+6OwyDkGcIfyMbr4zfXL9PLT9CVsuk+ZBmvQ5mkbNmQXcMjgD yM2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680523361; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=G6BdS1+66q3HqO7HM8tBKGSbA7cKXs81/6YFe8swsH4=; b=bunH4OjN+oodsK5MgU4mOM+LmWB//n3nwovjOVyM1zysai0HQMonkdUJdvVNQajZ9I YC2UMbxrsQh3pqpdwqZAYRriB/sY++P8KkybIrvqrMiPJ2SzPbCRDQQqAwWWxC3PrCHQ XXFsHm3Fj7nXq6Cfx2fNOBq8YpYBbEE41gZX/B6oFZVDqFJrb4yGro3TuSlTo2oyi+bG pFAElPCYm3/3lJjDR1jNXdQyn9JxyUHxwS4xUXGsCaTA1uxPCfowpJRvF/nSE7gn/ktA yL7iIHStaS+sTIwL6OiiGEH0Q8vZKqaYpmtuC2ON36EeAzwp9aJ77mT5Pg18srvgXYQ8 IAkA== X-Gm-Message-State: AO0yUKV5VL7IAsydFfJQz+ob/kPY91BZ0Bc08SCl9Kgfig5QB3FkBuOX 8WfnJI83q39WU0ND4mPk031b/N19g2qVPtK1pqA= X-Google-Smtp-Source: AK7set86SNxQwj1gtYJv9Xh0qtw4Lz+uaupDhMGbVjl4XUqIGAolDgTWQi4CjQZf+eoYlNTRxxyESfm/ojbhwSN2mtw= X-Received: by 2002:a9d:7dc9:0:b0:699:bf77:e691 with SMTP id k9-20020a9d7dc9000000b00699bf77e691mr11791728otn.4.1680523360835; Mon, 03 Apr 2023 05:02:40 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: <87h6tx74i4.fsf@gmail.com> From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Date: Mon, 3 Apr 2023 13:02:29 +0100 Message-ID: Subject: Re: bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python To: Wilhelm Kirschbaum Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62536 Cc: "62536@debbugs.gnu.org" <62536@debbugs.gnu.org>, Stefan Monnier , Mou Tong X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) As the author of most of elec-pair.el, I wanted to chime in to say that it can be worth checking if this newline-inserting, indent-inserting functionality isn't already covered by one of electric-pair-open-newline-between-pairs electric-indent-mode electric-layout-mode and its electric-layout-rules which would be generally preferable to adding custom psif's to post-self-insert-hook. CCint the expert Stefan here. Jo=C3=A3o From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 03 08:18:10 2023 Received: (at 62536) by debbugs.gnu.org; 3 Apr 2023 12:18:10 +0000 Received: from localhost ([127.0.0.1]:43614 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjJ8U-00074s-6y for submit@debbugs.gnu.org; Mon, 03 Apr 2023 08:18:10 -0400 Received: from mail-wr1-f43.google.com ([209.85.221.43]:40734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjJ8S-00074g-PI for 62536@debbugs.gnu.org; Mon, 03 Apr 2023 08:18:09 -0400 Received: by mail-wr1-f43.google.com with SMTP id t4so23893221wra.7 for <62536@debbugs.gnu.org>; Mon, 03 Apr 2023 05:18:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680524283; 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=+mWk3Zg3qee7Tou8I/9UIxrGUjKolfm3J0pe6K8HKTo=; b=clRje3M+FTJnEyyZXfwsbhTq7D8qKOpLWRUKz839Bn1kZUfFLbr1eCzvM9pFMDohjj TZfrcrBEHmzGw/SZ/cDuYZBV90p7BZ7TyDDK53eUrEQCvRh5jvwSZ/CmE/3n2MF0xK/O cZE+U1tFpT0ZL3TDbpnSr78WI1Z6Y9TXhNUuxiJe3TN+lVBLYpZ15elHVZ85RFD2wJkv rZJIdc2dOiPClHDEVoaQ1syyvKl/OU78x/fkXysQnfZBv1B6+XzyN2mY9CkXCdBottK+ i0kNwPesTXqxgFshHCdR/S+Bia6ynqXAamzEu95GB56y3TLgoX4lJSPY6n7cig2hh2n1 Q1Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680524283; 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=+mWk3Zg3qee7Tou8I/9UIxrGUjKolfm3J0pe6K8HKTo=; b=JnTco3XfuolYdrWoHzVRu8UiBsyhOCEykYeqvrsRXk86N3O+/nM+MjbU310nIsA+CU ckspNJ2I91j8aZ6LBNAmhEfHMfIEudzt8OkpvBpySah9DrKzl38gtl6HaIHhlEuPa78w uYEZaSxCLRGuFUA/h4zPoZug5lCqerb0mCkaRO/QlRQinW/lDOCbqsp4zFBtabcpdJgq LMYIpPoEmw8CMHDc4YR+m30RdfCHtTY7lV0vuJQPzmnIHtz+Aa4sT0cimBB/zCQpG848 v+cJ3Y7291ltziUOMET90lN6q+O42n7d7zi9iMbKPkOyVubGMe2pxbOZhvr1FPlNFWMy uJ8A== X-Gm-Message-State: AAQBX9csTpj0QEF3sICZk53Og4qBnnL79xhZ4ftoEuOtVnNTNkgOboUY YQ8dC3f+z0jfnOkbByDpdkw= X-Google-Smtp-Source: AKy350bZhPgyourfAYeE2nrlRgJOhl4Df/S1/41gMgwQ3Z0wTAcJ7ZtzhKaz/amo8KN+mg1y6Uuq3g== X-Received: by 2002:a5d:4e06:0:b0:2e4:bfa0:8c29 with SMTP id p6-20020a5d4e06000000b002e4bfa08c29mr9533527wrt.50.1680524282788; Mon, 03 Apr 2023 05:18:02 -0700 (PDT) Received: from melissa.local ([2c0f:ef18:1431:0:b09:9616:db04:c248]) by smtp.gmail.com with ESMTPSA id m3-20020a056000180300b002e5f3d81c06sm9097608wrh.89.2023.04.03.05.18.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Apr 2023 05:18:02 -0700 (PDT) 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> User-agent: mu4e 1.9.3; emacs 30.0.50 From: Wilhelm Kirschbaum To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Subject: Re: bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python Date: Mon, 03 Apr 2023 14:08:30 +0200 In-reply-to: Message-ID: <875yad6txm.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62536 Cc: "62536@debbugs.gnu.org" <62536@debbugs.gnu.org>, Stefan Monnier , Mou Tong X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Jo=C3=A3o T=C3=A1vora writes: > As the author of most of elec-pair.el, I wanted to > chime in to say that it can be worth checking if this > newline-inserting, indent-inserting functionality isn't > already covered by one of > > electric-pair-open-newline-between-pairs > electric-indent-mode > electric-layout-mode and its electric-layout-rules > > which would be generally preferable to adding custom psif's > to post-self-insert-hook. Hi, thanks for chiming in. I will have a closer look to see if there is a more elegant solution and hopefully we can avoid adding=20 a custom psif. From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 03 10:02:44 2023 Received: (at 62536) by debbugs.gnu.org; 3 Apr 2023 14:02:44 +0000 Received: from localhost ([127.0.0.1]:44884 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjKlg-00020d-FI for submit@debbugs.gnu.org; Mon, 03 Apr 2023 10:02:44 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51756) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjKld-00020M-R1 for 62536@debbugs.gnu.org; Mon, 03 Apr 2023 10:02:42 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pjKlY-0008OS-3E; Mon, 03 Apr 2023 10:02:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=GFp9zgB8w2HYbSVNGH8XQq2YBf7gFVRn6Q+ENOFDKDQ=; b=aRLvYSS95doG ka4wLdCV64sc42w0fTSngxvrHNC7w6nDOyVS9JLWaT3ckbTEwPRhcmY9XzUNlzw5ixeO9Ab4chDbQ hPVgodyqZXCkFOoRtPJsQYZCzY/69G0+h3kXlbMrF80ZAyJiPJoDxgwYpSwdfPEdm5uYDT2r8Ruw6 H6TBj+z1H9l/wUXUT4pfDZ6OdQcDIJwNpsADFG/SRg1NbbhNQTjJVhA+OM6kBv6gJsaDyNRl3cKrx QDbS2iJuZFTCcIllkTtAmCCcRgXhuP441YXMU4pNwP/9ovj/fQJvEOQzWf+i9a/em4dokIO3ABLcJ Nth8w+kGQS2LlFTN6hagZg==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pjKlT-0001TQ-As; Mon, 03 Apr 2023 10:02:34 -0400 Date: Mon, 03 Apr 2023 17:02:52 +0300 Message-Id: <83y1n9ukqb.fsf@gnu.org> From: Eli Zaretskii To: Wilhelm Kirschbaum In-Reply-To: <87h6tx74i4.fsf@gmail.com> (message from Wilhelm Kirschbaum on Mon, 03 Apr 2023 10:26:59 +0200) Subject: Re: bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python 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> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62536 Cc: 62536@debbugs.gnu.org, mou.tong@outlook.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: "62536@debbugs.gnu.org" <62536@debbugs.gnu.org> > From: Wilhelm Kirschbaum > Date: Mon, 03 Apr 2023 10:26:59 +0200 > > These two patches should then be sufficient to better handle > heredocs for electric-pair-mode: Do these replace the two previous ones you posted? Or are they in addition to them? From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 03 10:18:10 2023 Received: (at 62536) by debbugs.gnu.org; 3 Apr 2023 14:18:10 +0000 Received: from localhost ([127.0.0.1]:44935 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjL0c-0002Ph-EE for submit@debbugs.gnu.org; Mon, 03 Apr 2023 10:18:10 -0400 Received: from mail-il1-f173.google.com ([209.85.166.173]:37689) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjL0b-0002PU-6E for 62536@debbugs.gnu.org; Mon, 03 Apr 2023 10:18:09 -0400 Received: by mail-il1-f173.google.com with SMTP id v5so12835069ilj.4 for <62536@debbugs.gnu.org>; Mon, 03 Apr 2023 07:18:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680531483; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=eyQX6b6mK5jWKNVwtgoWbOwfF78BEB87DinCE//ZnnY=; b=nw+cyl0q9w+JBW71f9UUINeJnfPUFYtd/Wfgur/lONueoP7z/HnbG8UnEpnX/TmafT 1+IRiLpIylnAmqATIwawNJN4SM0gjNft0poGgFC0AojfM8biAbsGi614DBUfCDjOIPWI KQbuQ0sKte8izs8/4Aqj/Ofa+2UwHdlMEBzHctGeUdAMuhtd32dVMKiqrFNwYGjSmSg1 R98lZNTVqL+x1TK2CWP6yJmU5vjLXno6ngvJFJcGpxjBAmkC8L4mKvuHGSCVjpevdchc xEKHsMhQu6eH/RAzzpP/lp3dS94sZkrdoMy5FNTydJkgWUnma3+PsXd+EOynkyXi7Uny hKXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680531483; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=eyQX6b6mK5jWKNVwtgoWbOwfF78BEB87DinCE//ZnnY=; b=lAfh8XJRb3Dy8F74qar+FrbivMOCZZGUeQ9L5BnwtvBuIrOZL40XGq5yVVTqW1aRIY qxgQQaZSraSOjXYZ0cufY1mumuIUQeIN9iYyHccdf49+t2ENQ2ogfaw3gnnIjJhB5xKy BTbiRE+lgwDInjXW9NxWIfUChKLt0SOkzk7cgV3l5uTEB8IFwE8PllGcjUPN7K2LpBzA x7lgEsX8b7WLUHLIemECR//ZiKaDO/dCrTW0dEUeDUlN4ONYRFU9TeSbx4UOBHnUtP3r arOvLE1a8li6fIS6U0JtxwajmEYrOpwujJfBUjKVGcRGiRigdVBwn44uiUwsfjxFwe3K B4Rg== X-Gm-Message-State: AAQBX9cvvTfd3Il1qW8KnPF930qQpt/J95ZK2c7eSPt3EmIVPEYpASKd Cx0HRJ8A/Lcd8krFwMnoVUrINcW7O3ld8qTY9B8= X-Google-Smtp-Source: AKy350a4+iWXHS9BRXUVhfRuWU8iUMEi58fT49yeL6VUauFHN2eqWykcSwj6fm4MONczgTcJtoWFS+oytk0j7YEiMp0= X-Received: by 2002:a92:c568:0:b0:313:b6ee:2037 with SMTP id b8-20020a92c568000000b00313b6ee2037mr11571871ilj.3.1680531483229; Mon, 03 Apr 2023 07:18:03 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: <83y1n9ukqb.fsf@gnu.org> From: Wilhelm Kirschbaum Date: Mon, 3 Apr 2023 16:17:51 +0200 Message-ID: Subject: Re: bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python To: Eli Zaretskii Content-Type: multipart/alternative; boundary="00000000000017855905f86f3aa5" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62536 Cc: 62536@debbugs.gnu.org, =?UTF-8?B?54mfIOahkA==?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --00000000000017855905f86f3aa5 Content-Type: text/plain; charset="UTF-8" On Mon, 3 Apr 2023, 16:02 Eli Zaretskii, wrote: > > Cc: "62536@debbugs.gnu.org" <62536@debbugs.gnu.org> > > From: Wilhelm Kirschbaum > > Date: Mon, 03 Apr 2023 10:26:59 +0200 > > > > These two patches should then be sufficient to better handle > > heredocs for electric-pair-mode: > > Do these replace the two previous ones you posted? Or are they in > addition to them? > Sorry, they replace the previous two. > --00000000000017855905f86f3aa5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Mon, 3 Apr 2023, 16:02 Eli Zaretskii, <eliz@gnu.org> wrote:
> Cc: "62536@debbugs.gnu.org" <= 62536@debbugs.gnu.org>
> From: Wilhelm Kirschbaum <wkirschbaum@gmail.com>
> Date: Mon, 03 Apr 2023 10:26:59 +0200
>
> These two patches should then be sufficient to better handle
> heredocs for electric-pair-mode:

Do these replace the two previous ones you posted?=C2=A0 Or are they in
addition to them?

<= div dir=3D"auto">Sorry, they replace the previous two.
--00000000000017855905f86f3aa5-- From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 03 10:38:43 2023 Received: (at 62536) by debbugs.gnu.org; 3 Apr 2023 14:38:43 +0000 Received: from localhost ([127.0.0.1]:44969 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjLKV-0002wj-D1 for submit@debbugs.gnu.org; Mon, 03 Apr 2023 10:38:43 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60440) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjLKU-0002wV-FJ for 62536@debbugs.gnu.org; Mon, 03 Apr 2023 10:38:42 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pjLKP-0008B6-0V; Mon, 03 Apr 2023 10:38:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=TUyDaki10NmZYThLtxeY98lHUusCwVkabZaQDp265OA=; b=Jm1AS/JXkSDKppux2X9t dKUEhQpjFrLvTQd1OfLl/t66+a7u/mTUF1RgARjnHmzUcVqNCbw6c+w/8L9IPq615goBqSaxRSlk1 Efjhy0EcBOQLNFcXP70hMzx7Ui2WjY2bAycpg55czuX29iEHaw3M+fD8qRh7lmRjpmvSQ4AIWECcI hP02kvFerK03fHaxwLyer01MJAE9L5+tLO9acL7VsLjTkB0F3O3k/nXaX4lSH8/+eR3IBXwqNpss8 Lcytgr/1WmgVK4/a6hnDiUxqODCPMldHWNlHJL4vZOEoRBO4KAkt5POlWPrc/VpsfXH1ieoWTxJmf hgatsbieCN3JEA==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pjLKN-0004Kh-8y; Mon, 03 Apr 2023 10:38:36 -0400 Date: Mon, 03 Apr 2023 17:38:51 +0300 Message-Id: <83o7o5uj2c.fsf@gnu.org> From: Eli Zaretskii To: Wilhelm Kirschbaum In-Reply-To: (message from Wilhelm Kirschbaum on Mon, 3 Apr 2023 16:17:51 +0200) Subject: Re: bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python 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> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62536 Cc: 62536@debbugs.gnu.org, mou.tong@outlook.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Wilhelm Kirschbaum > Date: Mon, 3 Apr 2023 16:17:51 +0200 > Cc: 牟 桐 , 62536@debbugs.gnu.org > > On Mon, 3 Apr 2023, 16:02 Eli Zaretskii, wrote: > > > Cc: "62536@debbugs.gnu.org" <62536@debbugs.gnu.org> > > From: Wilhelm Kirschbaum > > Date: Mon, 03 Apr 2023 10:26:59 +0200 > > > > These two patches should then be sufficient to better handle > > heredocs for electric-pair-mode: > > Do these replace the two previous ones you posted? Or are they in > addition to them? > > Sorry, they replace the previous two. OK, but I understand you are still considering a better way to solve this? So I should not yet install the last patches? From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 04 01:42:37 2023 Received: (at 62536) by debbugs.gnu.org; 4 Apr 2023 05:42:37 +0000 Received: from localhost ([127.0.0.1]:46277 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjZRF-00034v-4u for submit@debbugs.gnu.org; Tue, 04 Apr 2023 01:42:37 -0400 Received: from mail-wr1-f52.google.com ([209.85.221.52]:45932) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjZRD-00034j-Qh for 62536@debbugs.gnu.org; Tue, 04 Apr 2023 01:42:36 -0400 Received: by mail-wr1-f52.google.com with SMTP id r11so31471180wrr.12 for <62536@debbugs.gnu.org>; Mon, 03 Apr 2023 22:42:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680586949; 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=Ch4ukMeddwnXLyaJV9YJaXez0L+Smd2rQR4KFfpS2ik=; b=kXMPaVINHZY1rpk7TLsB7E7TyBz0GTBAT/1+/ef/5NNlTcJzLjNTbdsz5qDlgHhYGB Nf6Fu6xiyT52iviziM9t7NiQdA5lB+t3FRmcu3qCb6Y9wMuE+mHpfo6wf/NRyOnlZ5Pp ewYaObS5TlYWiEb61IWrfwz89BpNI9/9m8eVbaBtsVxAs4hUNAXvWSwfiBCA0czMFy49 S8+C2vF8u7m5OlTvjK/onFlvgKMDcJAa1PA/Fl83RxIVaeaz7arLAq2Gk0seG4qKoyF3 vL5VnAOcMMpuW52eIHIZCYBf7xoQ3xJzlnfIi8wd+KcyV3xjkAVSmX10drX4+5Dvjcrc r6mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680586949; 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=Ch4ukMeddwnXLyaJV9YJaXez0L+Smd2rQR4KFfpS2ik=; b=lGKsNP2B3ZXtvJDyonwrlf1ttkB9o3Ltbl628uy+kzNQFm4q0lL7DCXqE5WZzhYTXs gVw3WN90bG/tb6yta/lbhYKwXVs2qewDaI+bV0xc1N6kFxphhUSu9HByGaQaLFLyPvHl ajBYh79W8rjaxSnDHQ7NlPwQZGRKOOlK17Qf9IK8YX4hWP2Mnla9cv9EBeJpREIwTDjH hJVX90RVAUfE7qM73H0VjMa+4NCHzFWB71DN7JZLLn+u1Jvi/GpGrvx/++B/4q80FpLP E7OEiNOecikK5+QLvPEi0q0C3mi/KeFTfRklCBpvtoMM1wS6QDT8qIj+pymuAekN6EZL KnOQ== X-Gm-Message-State: AAQBX9fyOfTslkbZTL8vQYxdz/FDiXI5fOZeJViAUVwkuMXBODRINuz4 VOs54S//AXVLLhQrxHVzNwtYRjWISaUFBw== X-Google-Smtp-Source: AKy350Yr2/9cwqhkfoSy+0wAB2YS580g7ZslFM33NWfgiLpV9HySVR1Jhq+VXsDkr1bOwdOH27owcA== X-Received: by 2002:adf:ce8b:0:b0:2db:43ed:1baa with SMTP id r11-20020adfce8b000000b002db43ed1baamr611008wrn.24.1680586949416; Mon, 03 Apr 2023 22:42:29 -0700 (PDT) Received: from melissa.local (ec2-13-245-158-50.af-south-1.compute.amazonaws.com. [13.245.158.50]) by smtp.gmail.com with ESMTPSA id k4-20020a05600c1c8400b003ee610d1ce9sm21606844wms.34.2023.04.03.22.42.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Apr 2023 22:42:29 -0700 (PDT) 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> User-agent: mu4e 1.9.3; emacs 30.0.50 From: Wilhelm Kirschbaum To: Eli Zaretskii Subject: Re: bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python Date: Tue, 04 Apr 2023 07:39:24 +0200 In-reply-to: <83o7o5uj2c.fsf@gnu.org> Message-ID: <871ql06w59.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62536 Cc: 62536@debbugs.gnu.org, mou.tong@outlook.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> From: Wilhelm Kirschbaum >> Date: Mon, 3 Apr 2023 16:17:51 +0200 >> Cc: =E7=89=9F =E6=A1=90 , 62536@debbugs.gnu.org >>=20 >> On Mon, 3 Apr 2023, 16:02 Eli Zaretskii, wrote: >>=20 >> > Cc: "62536@debbugs.gnu.org" <62536@debbugs.gnu.org> >> > From: Wilhelm Kirschbaum >> > Date: Mon, 03 Apr 2023 10:26:59 +0200 >> >=20 >> > These two patches should then be sufficient to better handle >> > heredocs for electric-pair-mode: >>=20 >> Do these replace the two previous ones you posted? Or are=20 >> they in >> addition to them? >>=20 >> Sorry, they replace the previous two. > > OK, but I understand you are still considering a better way to=20 > solve > this? So I should not yet install the last patches? I had a look and don't see how without changing elec-pair.el that=20 there is a more elegant way to do this. I am happy with the current=20 patches to be installed and then perhaps if there is a better way we can=20 apply it to both python-mode and elixir-ts-mode later. From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 04 05:08:46 2023 Received: (at 62536) by debbugs.gnu.org; 4 Apr 2023 09:08:46 +0000 Received: from localhost ([127.0.0.1]:46594 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjcej-0001RQ-KB for submit@debbugs.gnu.org; Tue, 04 Apr 2023 05:08:45 -0400 Received: from mail-oi1-f175.google.com ([209.85.167.175]:37594) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjcei-0001RD-5B for 62536@debbugs.gnu.org; Tue, 04 Apr 2023 05:08:44 -0400 Received: by mail-oi1-f175.google.com with SMTP id bm2so23756332oib.4 for <62536@debbugs.gnu.org>; Tue, 04 Apr 2023 02:08:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680599318; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=aHLBRVEv0ZnZlioOluywNMjdHApWBWGEGnjZshSYUYA=; b=I6/h2WfDRotBbL7zoWw50zvvQ/VrpWrYEw9T6KPa4m6VTq2r2TaPos29nrV0GCF7Bh QxEkixqKv+s8FOOYrOEF9QV9ebP9WiiCfIcugQF0YCdLDTncFOUmHByusnPSy0uRRybY kvudSQwSTbzmrgnRfeK9jtilFLBDWCouv97c01TUQJ3GaK0CZBV+KxRJ13XOu5GNE7qx rwRzczIi9vsknxkGorPUwaKsi/tjCuh2zh7tCWjBimKk3jvXOzplFGe2KU1xiK3zv1Tu 1g0VOm95RSU9E8Ds78Negx/Uv809M8fN1yB4hqWEiVGNs4f/o4dC8zlIu9Xw0P1TYwMs 8dCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680599318; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aHLBRVEv0ZnZlioOluywNMjdHApWBWGEGnjZshSYUYA=; b=lQ+jJwk+bqqLvxwP8iHFZPrE7TO9wpVy2nRCTyxif+IvLB+9QSUNLRpRXnFZPCoaiz //8hdMhRO+MtxCJtNfNfpJu6e0+G+iGMD/BwzOorCJP6CW2YEAVwEOaexD77ZphYWDIl Xk1dSFRzk/37ByDwCwAGBQXO4OEzQozr8NTDCg1SNQuDighC1lsvR1p4CyO2OL0tFix2 uVaXQxMY4/Khei1Z7aWuQ57EZwlf1LHQr8KGGbVavqyomied3XrCZDBA9qa/VI4SEFac LJzDuDlr1iMvgnp6zKu243uJ+rS3dsJcQIpCZ04PXUoSZ7j3Uk4bIWQQNal/Jhfmdd7R HlfQ== X-Gm-Message-State: AAQBX9fcRsjlad72hLQ0W4eFtb16UQ9hj0OT2ckGAnBMkXvUc+1y8GiL wkCg1v/FHGyvn7BvlNhHx8Hs5I6JyEDonpYm+q0= X-Google-Smtp-Source: AKy350YJEx1ICMD3iHxGW03e7VVbpjAfjoIBuTHgbyselwLs7Jvyy3kpHz9twJwm0gbq3hDNiHIUIj3gmkGfKhXw5rI= X-Received: by 2002:a05:6808:229e:b0:36e:f6f7:bb1a with SMTP id bo30-20020a056808229e00b0036ef6f7bb1amr690768oib.5.1680599318203; Tue, 04 Apr 2023 02:08:38 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: <871ql06w59.fsf@gmail.com> From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Date: Tue, 4 Apr 2023 10:08:27 +0100 Message-ID: Subject: Re: bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python To: Wilhelm Kirschbaum Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62536 Cc: Eli Zaretskii , 62536@debbugs.gnu.org, mou.tong@outlook.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Tue, Apr 4, 2023 at 6:43=E2=80=AFAM Wilhelm Kirschbaum wrote: > > >> From: Wilhelm Kirschbaum > >> Date: Mon, 3 Apr 2023 16:17:51 +0200 > >> Cc: =E7=89=9F =E6=A1=90 , 62536@debbugs.gnu.org > >> > >> On Mon, 3 Apr 2023, 16:02 Eli Zaretskii, wrote: > >> > >> > Cc: "62536@debbugs.gnu.org" <62536@debbugs.gnu.org> > >> > From: Wilhelm Kirschbaum > >> > Date: Mon, 03 Apr 2023 10:26:59 +0200 > >> > > >> > These two patches should then be sufficient to better handle > >> > heredocs for electric-pair-mode: > >> > >> Do these replace the two previous ones you posted? Or are > >> they in > >> addition to them? > >> > >> Sorry, they replace the previous two. > > > > OK, but I understand you are still considering a better way to > > solve > > this? So I should not yet install the last patches? > > I had a look and don't see how without changing elec-pair.el 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 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 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 From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 04 14:12:17 2023 Received: (at 62536) by debbugs.gnu.org; 4 Apr 2023 18:12:17 +0000 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 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 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) 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) 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> User-agent: mu4e 1.9.3; emacs 30.0.50 From: Wilhelm Kirschbaum To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Subject: Re: bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python Date: Tue, 04 Apr 2023 19:54:45 +0200 In-reply-to: Message-ID: <87zg7nfrex.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62536 Cc: Eli Zaretskii , 62536@debbugs.gnu.org, mou.tong@outlook.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 04 14:39:29 2023 Received: (at 62536) by debbugs.gnu.org; 4 Apr 2023 18:39:29 +0000 Received: from localhost ([127.0.0.1]:50184 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjlZ3-0001Wl-7M for submit@debbugs.gnu.org; Tue, 04 Apr 2023 14:39:29 -0400 Received: from mail-oi1-f171.google.com ([209.85.167.171]:36753) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjlZ1-0001WX-M6 for 62536@debbugs.gnu.org; Tue, 04 Apr 2023 14:39:28 -0400 Received: by mail-oi1-f171.google.com with SMTP id bj20so24922567oib.3 for <62536@debbugs.gnu.org>; Tue, 04 Apr 2023 11:39:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680633561; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=4gAyN9cfWnUVP8EMn6nA9Cxv6lQh/rci12J3qjyhZFY=; b=pBLVTDXX4CvvOHcFhEVaLBOCMYX14ltf4Mo7p15ybhikXSJdBIIKXGDy3XHxoQn2SQ TMjdXju1iVbwoyu7oLPALZ2IOCgDg+AnrZg5z2kUbaqEwTtloMUAB0wL5hrcT93M8TAz NZeSMlAP+uP2icZojA2DrramH1xRs/+KdaT2ojW67WM2sDyaUjoyqELXOM6+UYQAbmE4 A62wnx0SCqzn5z5UbrYiUwGkzkmWNninPI2Pl6y+6zRYnZaInNlnJkxYL4UoIHNWufI9 WhMyzCDNosKrfumxgdkclR6LPX5I5MjlPYgPaNICKMFFuLck48Lvg7Iij1fY/7O82yWw 14iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680633561; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4gAyN9cfWnUVP8EMn6nA9Cxv6lQh/rci12J3qjyhZFY=; b=niu/9QSO3QeTKI3Tx+0tUterA1+5WQTa0U8bSVYLSOj7d1jQTpOEsM3cjO4L8AeJQd X7jdWp8VFqZj0g1m6O1eJ81wW7fmQXV0GWsO/vT/X+oFiGdHgk4AtrWmj8IW4O/Pb7Rz 28peycZh6B+P0FI/IrxbsqSxCM+abJ8QlOG21wYTrl2HbbYuFTh0GLF8VyYMsfaLC5Hm m1YmSu8vZy7Bf3ZZ4LucYLAbhiUYClIGRdh0+JTdlJbZ5YVIZNd8msCByVoDCFW0opGQ eqH+2TBQPMGvyw2K2Z1HMxDJ68AscRLL+V/Ily05gAqWXoXaYesPhVYMcwcUAumHl8Co f9Zg== X-Gm-Message-State: AAQBX9dXlM1jJ1mkwtG98FnvYAkAzYN+GtsUzk/0L2FAIjd2y3V8Qynt p4bY3I39/FYTOjLq/TPkXrc6BIYJUI9iU26PVyI= X-Google-Smtp-Source: AKy350YxCbqZfn6LNsEd/X1jHRaPAsSQ9f3/dN2MZSDLsexdYNo6MlCrax1zdVvcv6OKIJHKLl7sTx+YNg4u1oSqCuI= X-Received: by 2002:a05:6808:2018:b0:384:1cf9:912e with SMTP id q24-20020a056808201800b003841cf9912emr1334610oiw.5.1680633561677; Tue, 04 Apr 2023 11:39:21 -0700 (PDT) MIME-Version: 1.0 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> <87zg7nfrex.fsf@gmail.com> In-Reply-To: <87zg7nfrex.fsf@gmail.com> From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Date: Tue, 4 Apr 2023 19:39:10 +0100 Message-ID: Subject: Re: bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python To: Wilhelm Kirschbaum Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62536 Cc: Eli Zaretskii , 62536@debbugs.gnu.org, mou.tong@outlook.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Tue, Apr 4, 2023 at 7:12=E2=80=AFPM Wilhelm Kirschbaum wrote: > The custom psif is not for the newline, but for pairing up the > triple > quotes `"""` with another set of tripe quotes when > electric-pair-mode is > enabled. The newline is for keeping the syntax valid in elixir, > otherwise the font and navigation breaks because `""""""` is not > valid > Elixir syntax and the tree-sitter grammar really does not like it. I see. My apologies for not having noticed this in the preceding emails. If you want some kind of electricity so that typing the third `"` results in two `"` and a newline getting added, then that is completely new and probably does require a custom psif. If that's _not_ what is meant, read on. Else skip to last paragraph. > Unless electric-indent-chars can identify the triple quotes, we > need a > custom psif regardless of other functionality, but I don't see > this > option. Maybe I am wrong and you can point me to this feature? Here, you'd not want electric-indent-chars, right? If you're dealing with the necessity of electrically adding a newline to maintain syntax correctness, you're looking for electric-layout-mode and electric-layout-rules, not electric-indent. And in electric-layout-rules you _can_, I think, identify triple quotes using a function as described in the last paragraph of its docstring. > 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 > can add > a check before inserting the newline? Sure, but I'd say just use electric-layout-rules in that case. > I don't know if many people > using > elixir-ts-mode will know about the electric layout mode and might > get annoyed with > electric-pair-mode for heredocs ( tripple quote pairs ). But your suggestion to check for electric-layout-mode in the custom psif leads to same situation, right? You can choose to turn on electric-layout-mode by default locally in elixir-ts-mode if you want to give your users this sane behaviour by default. Like other electric-* modes, it's a mode that helps maintain the buffer valid (for some meaning of "valid"). Just like without electric-pair-mode you type a '{' and the buffer is syntactically invalid until you fix it. The "annoyance" can be solved by turning it on, unless it's on already. Anyway, I just wanted to call attention to these existing facilities in Emacs that were designed to help out major-mode authors so that ad-hoc solutions aren't replicated again and again, making maintenance difficult. But, then again, I understand that the facilities might not be as powerful as I and Stefan (mostly Stefan, really) intended. Here, my naive understanding of the matter tells me they are, but if I'm wrong and using the custom psif gets the job done, then don't take my suggestion as a blocker, especially if all your patches are ready and good to go. We can always come back to this later. Jo=C3=A3o From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 04 15:35:25 2023 Received: (at 62536) by debbugs.gnu.org; 4 Apr 2023 19:35:25 +0000 Received: from localhost ([127.0.0.1]:50258 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjmRA-0005eF-Sd for submit@debbugs.gnu.org; Tue, 04 Apr 2023 15:35:25 -0400 Received: from mail-wr1-f48.google.com ([209.85.221.48]:39693) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjmR9-0005e0-01 for 62536@debbugs.gnu.org; Tue, 04 Apr 2023 15:35:23 -0400 Received: by mail-wr1-f48.google.com with SMTP id m2so33967004wrh.6 for <62536@debbugs.gnu.org>; Tue, 04 Apr 2023 12:35:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680636917; 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=oGFV1jQUA6mfefds9m33Oqq3NdvoxSvC1/h0nrb+sK8=; b=jjBZlLHO7ggewCDTbjWOcw0hPpNhIIz8riNzMyseGpnWUc/tX6d36EAesvlZH9jSM9 FLTcg3/cBfNWMjIbHwawSacb6yK0zPzQ8oviK4QujW3jSc0kminOttgOmj0zqtxwqE8m VjJ6rYSLBoCUCJfSPhrvWIgO4yDTH/VIv1efp/UzKc/N4OI6UhnoARyHvA12ZYNqg5+E GtS9/HeEDWrMaSBLIIPayJnLb4P7rpDiitNBUYL/E4zYUhaBABCyGKVWqDmZIbU1Jhes nFR83wijbLy2nhf3VG/7Apjl7SvbL2ntBNLhLPg0wybkqyqGX/3fN7sPghUJ9N02AHsI HcMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680636917; 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=oGFV1jQUA6mfefds9m33Oqq3NdvoxSvC1/h0nrb+sK8=; b=bNtrn5uUtNIwq/XPJ3KkZgyGAMkKhOy5oROcq4xD0pQiSMy+zJL0ZxIzPsa3M2uZ3F 6OvV4zwrxJAUfBcYB5mwIDVVailG4lmmZSvaqt+qSj55eYIxth/RNpCynQUrCaY4xhtQ 9C2lBcuHWrVmextLmmaVKuUMEjOOPPLu8YqoYaFRJxXSpX8w+Rbpy/b4S3SS4GSimYO/ 21VBI3JbaMj1eEfEf0WpHvIWEdAIXJf0YfKD32gFo+eXsAi9c8VZ5YzexlAvbszDupoA S0Fo1Ru16HnWvpyW6RKTbQIWkOSMOrR7e4taqU3xk/BD41+I4MhyqJwM4cpngAcEGP6T G92g== X-Gm-Message-State: AAQBX9dtozwde9MXg8eBRW7dxZTZ5l5c3LiMeeZI0Z3SeeuUp/WklSnM CLNL5l89rh2e06MNQFLN1w4= X-Google-Smtp-Source: AKy350ZrjvZm/mcjosxZUAPCTWBapgjxy7W0odnxm6ukvxWswiH2xkphe/UG53LYhhMNmYpUtgjyoA== X-Received: by 2002:a5d:6291:0:b0:2d6:5afe:7b99 with SMTP id k17-20020a5d6291000000b002d65afe7b99mr2069662wru.10.1680636917097; Tue, 04 Apr 2023 12:35:17 -0700 (PDT) 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 t16-20020adfdc10000000b002e5ff05765esm12510164wri.73.2023.04.04.12.35.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Apr 2023 12:35:16 -0700 (PDT) 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> <87zg7nfrex.fsf@gmail.com> User-agent: mu4e 1.9.3; emacs 30.0.50 From: Wilhelm Kirschbaum To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Subject: Re: bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python Date: Tue, 04 Apr 2023 21:03:36 +0200 In-reply-to: Message-ID: <87v8ibfnke.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62536 Cc: Eli Zaretskii , 62536@debbugs.gnu.org, mou.tong@outlook.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > On Tue, Apr 4, 2023 at 7:12=E2=80=AFPM Wilhelm Kirschbaum=20 > wrote: > >> The custom psif is not for the newline, but for pairing up the >> triple >> quotes `"""` with another set of tripe quotes when >> electric-pair-mode is >> enabled. The newline is for keeping the syntax valid in=20 >> elixir, >> otherwise the font and navigation breaks because `""""""` is=20 >> not >> valid >> Elixir syntax and the tree-sitter grammar really does not like=20 >> it. > > I see. My apologies for not having noticed this in the=20 > preceding > emails. If you want some kind of electricity so that typing the > third `"` results in two `"` and a newline getting added, then > that is completely new and probably does require a custom psif. > > If that's _not_ what is meant, read on. Else skip to last > paragraph. > >> Unless electric-indent-chars can identify the triple quotes, we >> need a >> custom psif regardless of other functionality, but I don't see >> this >> option. Maybe I am wrong and you can point me to this feature? > > Here, you'd not want electric-indent-chars, right? If you're > dealing with the necessity of electrically adding a newline > to maintain syntax correctness, you're looking for > electric-layout-mode and electric-layout-rules, not > electric-indent. > Right, makes sense. > And in electric-layout-rules you _can_, I think, identify > triple quotes using a function as described in the last > paragraph of its docstring. > Yes, I tested this earlier and it does work. >> If it does not make sense to add the newline as this might not=20 >> be >> expected behaviour when electric-layout-mode is not enabled, we >> can add >> a check before inserting the newline? > > Sure, but I'd say just use electric-layout-rules in that case. > You convinced me :)=20 > You can choose to turn on electric-layout-mode by default > locally in elixir-ts-mode if you want to give your users this=20 > sane > behaviour by default. > Is that a good idea? I have not used electric-pair-mode or electric-layout-mode enough to know how this impacts the workflow. > Like other electric-* modes, it's a mode that helps maintain > the buffer valid (for some meaning of "valid"). Just like=20 > without > electric-pair-mode you type a '{' and the buffer is=20 > syntactically > invalid until you fix it. The "annoyance" can be solved by > turning it on, unless it's on already. > > Anyway, I just wanted to call attention to these existing > facilities in Emacs that were designed to help out major-mode > authors so that ad-hoc solutions aren't replicated again > and again, making maintenance difficult. But, then again, > I understand that the facilities might not be as powerful > as I and Stefan (mostly Stefan, really) intended. Here, my > naive understanding of the matter tells me they are, but > if I'm wrong and using the custom psif gets the job done, > then don't take my suggestion as a blocker, especially if all > your patches are ready and good to go. We can always come > back to this later. > > Jo=C3=A3o Thanks for doing so, I am relatively new to hacking on Emacs, so appreciate the feedback. Is there perhaps a way we can allow a similar function for=20 electric-pair as with electric-layout to identify more than just the last typed=20 char? This will mean that we can entirely get rid of custom psifs and=20 think it will be useful in at least 1 more mode. From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 04 15:57:00 2023 Received: (at 62536) by debbugs.gnu.org; 4 Apr 2023 19:57:00 +0000 Received: from localhost ([127.0.0.1]:50267 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjmm4-0006OO-Gk for submit@debbugs.gnu.org; Tue, 04 Apr 2023 15:57:00 -0400 Received: from mail-wm1-f43.google.com ([209.85.128.43]:33727) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjmm2-0006O7-Md for 62536@debbugs.gnu.org; Tue, 04 Apr 2023 15:56:59 -0400 Received: by mail-wm1-f43.google.com with SMTP id v20-20020a05600c471400b003ed8826253aso1341075wmo.0 for <62536@debbugs.gnu.org>; Tue, 04 Apr 2023 12:56:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680638213; 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=2jEKgoR+2G3IJrXbSup+CPFP0itrnTdhOQocvYeMZ8s=; b=L9sjl3qSeFu1aWJ3jiUEQJYoGzmlt5Y7ueY5TKUFWI3vDdX9z0e/hgJsG29r0jlIyl AbHc/VDT33LFUca7BC3EAAaEDBMY4TAx6nOvNcm+O+G7fENMS96VLZHghupcFQ5S0lj9 EOd4PpVrjziundwyvHHer111ZBp4Vz4KYXk5GW0iKf8pY8hc65X8vK77j3Y+RTJ/YFfZ d3QsnWqQi2d968DYoxGIP/5rVHsQ/rSpE+oW6tVw3iHuXSQF+iBgPKNpq4/VS+sgD67m 77mXyHV1LXJ9p7wiDPS9uPMZ+msCVVAzikgaVBFZ08oewUv3UveQQMNdLa0Dd9P6brjI Qndw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680638213; 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=2jEKgoR+2G3IJrXbSup+CPFP0itrnTdhOQocvYeMZ8s=; b=Lu0NiLECWy8RWAQGueNEcbEtOWU6UaebqQRyCZJ2nrvdMKbKgX5ltDjbS4Ww4MKI6u qPHPszumiWHqVZdGTQmmp1aKL6NjTvggLdpyW7RNO90WKWf7J319Yggs3auH0QHHooV1 JN8Hi8jWxEQodbZpWcMDAYdV/KqLBaGjBbyjmi2D0a7MOeZk8vRdxSLYaoeie6W3CM7o kOiVR/jImlltmi4NgEMxQGQQc8nMtPQ7P87Jd//k9Ss45c4hLa3ayfdphnDECfevjGzO vVMH7/keWeIt4/0THmNEvzynhjZtwdLcwdVaF5N6xM3EJSOfATRVJ7p7YCo2MAK/KaVF ZKQQ== X-Gm-Message-State: AAQBX9fpT19Jb/sPLois83JGWjqCkv110674OJkRLcyJK+IPwbl0gfpI sX0+V245fvnBnEpWMH0ts7w= X-Google-Smtp-Source: AKy350YDfgWoF3o1fVbl7RhnNyAjA+dRI8nfjvaGDK3Sig3MV5YZM/fUNDtCjLBFe8o3KBxLutqAaA== X-Received: by 2002:a05:600c:2243:b0:3ee:4dc0:d4f6 with SMTP id a3-20020a05600c224300b003ee4dc0d4f6mr3024907wmm.17.1680638212737; Tue, 04 Apr 2023 12:56:52 -0700 (PDT) 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 g4-20020adffc84000000b002d8566128e5sm12974558wrr.25.2023.04.04.12.56.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Apr 2023 12:56:52 -0700 (PDT) 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> <87zg7nfrex.fsf@gmail.com> <87v8ibfnke.fsf@gmail.com> User-agent: mu4e 1.9.3; emacs 30.0.50 From: Wilhelm Kirschbaum To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Subject: Re: bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python Date: Tue, 04 Apr 2023 21:46:47 +0200 In-reply-to: <87v8ibfnke.fsf@gmail.com> Message-ID: <87r0szfmke.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62536 Cc: Eli Zaretskii , 62536@debbugs.gnu.org, mou.tong@outlook.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> On Tue, Apr 4, 2023 at 7:12=E2=80=AFPM Wilhelm Kirschbaum >> wrote: >> >>> The custom psif is not for the newline, but for pairing up the >>> triple >>> quotes `"""` with another set of tripe quotes when >>> electric-pair-mode is >>> enabled. The newline is for keeping the syntax valid in=20 >>> elixir, >>> otherwise the font and navigation breaks because `""""""` is=20 >>> not >>> valid >>> Elixir syntax and the tree-sitter grammar really does not like=20 >>> it. >> >> I see. My apologies for not having noticed this in the=20 >> preceding >> emails. If you want some kind of electricity so that typing=20 >> the >> third `"` results in two `"` and a newline getting added, then >> that is completely new and probably does require a custom psif. >> Just to clarify on the desired behaviour: With `|` is (point): When typing the first quote `"|` it pairs to be `"|"` as single=20 quote strings are valid in Elixir. Then when typing the second `"` it=20 skips the second quote `""|`, now when typing the third quote `""|"` it=20 pairs the heredoc: `"""|"""` and with electric-layout it will now insert=20 the newlines: `"""\n|\n"""`. This means, as the original report, the user can type `@doc """|` and will correctly jump into the heredoc and=20 tree-sitter grammar will stay valid. @doc """ | """ There is no scenario in Elixir I can thin of where this is not the desired behaviour. From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 04 16:34:31 2023 Received: (at 62536) by debbugs.gnu.org; 4 Apr 2023 20:34:31 +0000 Received: from localhost ([127.0.0.1]:50358 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjnMM-0007Xi-PZ for submit@debbugs.gnu.org; Tue, 04 Apr 2023 16:34:30 -0400 Received: from mail-wr1-f47.google.com ([209.85.221.47]:43925) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjnML-0007XU-CF for 62536@debbugs.gnu.org; Tue, 04 Apr 2023 16:34:29 -0400 Received: by mail-wr1-f47.google.com with SMTP id l12so34094613wrm.10 for <62536@debbugs.gnu.org>; Tue, 04 Apr 2023 13:34:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680640463; h=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=ButtnEbQoRHkgb/2OOTVniG8+7dEgzb/t2JciGfK1aw=; b=GbEi15/zfRrKmC3gVPrq/+x1+wM1a0bPDXaKuPMNu/W/zqp999hj9e0oSsfS0ZL3O2 25+3zXEsh/Ao+RoG8HJ/Ta2z1YhN6yG8XVQJoBNQeTqUZojqYi+fO4BoRXYK0QMGqgOG 9Dlo8pV4u1bVhFXoWEedNXltS9XNikKpFTI0S2z2XsliOIqQ3MDekQeiquz44US3t2nF /w0Tvu1JbXO1EaMVXTvwKrPKkAQ1zsCRRzyLkE/XEEiOmoB2vMhGt9IWEosi16oCaiNS GgN25IyJntm3ogtdpTZ6bFuqcrVgwtQHvcCqd32EnjM56L0/mhnhq+KPIhpailtog28W Uyrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680640463; h=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=ButtnEbQoRHkgb/2OOTVniG8+7dEgzb/t2JciGfK1aw=; b=SMw5BddZkNCqvQZfGRxBo18SX7jpgWrd9wvFNoaw2HKAk/39rHladd4bp8h7TqZHMs tjGTxMtW3YVyoOyEh999O0hpIyst0M5dNVX4AjVtrQJvA0A6XI4uYPWFJ5nGMF6m8oQo 5sqRpWBw2begKnLQlu4eeqWbpNMo+NeC1pxrMqXSa59bevJ7G74HZZ1IC9BUN0tSbBkd XnBnwPB74w4azBjyjIRwNoqoWNS/uzGgThoxhQX4hQe7kGisFbJeBnL5X4AUnPPKNAP+ ZvBeXnK+UMdSHPoxOr7UlFb1l64ILpnggVpv1k0Wn4t3VtkCXi69ZWMgcGlcPOhxGgfn S3DA== X-Gm-Message-State: AAQBX9cPjyHKBqZ7nbex/wg7goYJteMyJP0leTcQ4wrl4iz6vBLnZrEL f3U/qZBmyNpX9RJWORnyc8Y= X-Google-Smtp-Source: AKy350bdSjUP/LuqrFS1UQD1db/v6rM3K0q0cx3ymn1fywSI8WO4H8TcPo3EmU+nm7nhcmSVljvYtA== X-Received: by 2002:adf:d0c4:0:b0:2e5:1c60:5afd with SMTP id z4-20020adfd0c4000000b002e51c605afdmr2534144wrh.1.1680640463321; Tue, 04 Apr 2023 13:34:23 -0700 (PDT) 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 p8-20020a5d68c8000000b002c55521903bsm13078027wrw.51.2023.04.04.13.34.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Apr 2023 13:34:22 -0700 (PDT) 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> <87zg7nfrex.fsf@gmail.com> <87v8ibfnke.fsf@gmail.com> User-agent: mu4e 1.9.3; emacs 30.0.50 From: Wilhelm Kirschbaum To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Subject: Re: bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python Date: Tue, 04 Apr 2023 22:29:10 +0200 In-reply-to: <87v8ibfnke.fsf@gmail.com> Message-ID: <87mt3nfktw.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62536 Cc: Eli Zaretskii , 62536@debbugs.gnu.org, mou.tong@outlook.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> And in electric-layout-rules you _can_, I think, identify >> triple quotes using a function as described in the last >> paragraph of its docstring. >> > Yes, I tested this earlier and it does work. > Even though it works, it does not play nice with the custom psif, because the layout rules seems to trigger before the hook. From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 05 09:07:49 2023 Received: (at 62536) by debbugs.gnu.org; 5 Apr 2023 13:07:49 +0000 Received: from localhost ([127.0.0.1]:51718 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pk2rd-0002po-Bg for submit@debbugs.gnu.org; Wed, 05 Apr 2023 09:07:49 -0400 Received: from mail-oa1-f41.google.com ([209.85.160.41]:36413) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pk2rb-0002pZ-IR for 62536@debbugs.gnu.org; Wed, 05 Apr 2023 09:07:47 -0400 Received: by mail-oa1-f41.google.com with SMTP id 586e51a60fabf-17ebba88c60so38334679fac.3 for <62536@debbugs.gnu.org>; Wed, 05 Apr 2023 06:07:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680700062; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=d/MqdF/oRUahI6uCOdwgZ0P49HpGs1ch/DwFLHphCVg=; b=G9iLA1vDWFtEzGojdQ18zauXHNyfK/bJDs3GzcoRFtKdDdJgt23TfsH7YGXukH62uC 2azFE2WDdXwx3DZmOnRYyGwxayFFfLeNy9F/STWKyieIsBFKug5gAzrPzpXoOK2YKzRg ATePCdwuEib04PMWjkCz0g7wiWxaBD2IcAFi7oaVaJQ3j9vl6a8cgn4AiQRGGA+RkqdA K6EaJdwfXb4LkDC4PhOfJ90dIU5o0twxR0pHxFBkYaZck08um6tTZGAwyLCCwTDFHuUf goGX1xmtql6sL77QT+TCo8qdOJrEEUpqamOIOajgdRWdnrcFY43Ra+XZpW9IPKZ7KWUE 8oLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680700062; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=d/MqdF/oRUahI6uCOdwgZ0P49HpGs1ch/DwFLHphCVg=; b=LkVUeGjvzaz9KGlo0M6k+AUxQf2jjrQRy/DbJbspOsg8fDXx4MRGfA6k43Mpd92D+4 bd9L6eWPyKHJgta3F9KKLrVRSppdpX0Sx+YDwFTC6NeMXjZ4kbY/5/GEXQGTJ8ncj4+j RcJYT7Mpp/fK88cLPwjg9WmRtKEaO1sTiQ5ZFgPwPK8q2fej1vrurtdNBBRoSnqXSIwv 1xaYjuWWrxfjYdlCKkeDtxPzbpKXoDMDr/yuZqcBETIZDpbU0V9ZKv1zBjPtNn/0RkLV XE70xI9RgIjC2WT1TRcBXqV3O+9xkkVD/Riio4jz4TsDI0MSN/KQVnHf6BRxVOpCfI9l iiMg== X-Gm-Message-State: AAQBX9fSgqJKlBrF0MARQ38fHrZDOvUaSz/Csf5q2sLyariIZCKfsT7A dca7sZJrCEtaPh7JO5FQ4IudSlV+C/gnjl1ekbY= X-Google-Smtp-Source: AKy350ZFe/sQTzixLT/jaoVnAG6rcu2jD8qjqHOHkkDqnhlfGNlTiOnXDIHm0VnJ0+vihYwlHb/Y5fSahIOBRgdo7Wo= X-Received: by 2002:a05:6871:789:b0:17f:2918:2f46 with SMTP id o9-20020a056871078900b0017f29182f46mr2917650oap.5.1680700061924; Wed, 05 Apr 2023 06:07:41 -0700 (PDT) MIME-Version: 1.0 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> <87zg7nfrex.fsf@gmail.com> <87v8ibfnke.fsf@gmail.com> <87mt3nfktw.fsf@gmail.com> In-Reply-To: <87mt3nfktw.fsf@gmail.com> From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Date: Wed, 5 Apr 2023 14:09:34 +0100 Message-ID: Subject: Re: bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python To: Wilhelm Kirschbaum Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62536 Cc: Eli Zaretskii , 62536@debbugs.gnu.org, mou.tong@outlook.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Tue, Apr 4, 2023 at 9:34=E2=80=AFPM Wilhelm Kirschbaum wrote: > > > >> And in electric-layout-rules you _can_, I think, identify > >> triple quotes using a function as described in the last > >> paragraph of its docstring. > >> > > Yes, I tested this earlier and it does work. > > > > Even though it works, it does not play nice with the custom psif, > because the layout rules seems to trigger before the hook. You should be able to adjust the order of the functions in post-self-insert-hook. The core psifs of electric-pair-mode, electric-indent-mode and electric-layout-mode coordinate their action in this way, as it's very common to reach situations as you describe. Use a numeric third argument to add-hook to coordinate. Assume that the numbers you see in elec-pair.el and electric.el for the core psifs will be relatively unchanged. If you have the latest code you're testing, I can help you test, as I've just installed the tree-sitter grammar for elixir-ts-mode and it seems to be working. Jo=C3=A3o From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 05 10:31:11 2023 Received: (at 62536) by debbugs.gnu.org; 5 Apr 2023 14:31:11 +0000 Received: from localhost ([127.0.0.1]:52392 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pk4AJ-0005O3-7u for submit@debbugs.gnu.org; Wed, 05 Apr 2023 10:31:11 -0400 Received: from mail-wr1-f53.google.com ([209.85.221.53]:34792) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pk4AH-0005Np-5w for 62536@debbugs.gnu.org; Wed, 05 Apr 2023 10:31:10 -0400 Received: by mail-wr1-f53.google.com with SMTP id v1so36421411wrv.1 for <62536@debbugs.gnu.org>; Wed, 05 Apr 2023 07:31:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680705063; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=RRnl20ORsDUkAYe/cW1AN384IT2/wvlhgCv/miBHoCI=; b=R1/ot6pexdbKiqnGLAY2BsepdSEZ+0UXQ7dyYY5A8aiQ7vvgp1OW6Zz5flklOFwF5V CsWgHGLVua7If2GoDL/vIy0Zw9LGwfw+Xm0fDJ8PK6n5MJjydNlqepeBFpksdsy1CME2 Pp4VjjAOBzRioqnsdKQPJtgWL9xXoI2HUff5RI0mSizWeJqQ4L79b2fCOOP0GQikZotN oMZoelO0hHxBt0XWHos7p/UU++Ml05RstHJHNmGJ56VjHhDoA6hOomxZQJ1yob2uT79I hkNH+c7QqLb9HT1QMFU1d0XPIDdX0RS5BIUbjVoPxmBFDu86CjjGGvgiMwl8lR7ITQ8N P/6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680705063; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=RRnl20ORsDUkAYe/cW1AN384IT2/wvlhgCv/miBHoCI=; b=f7nvMmFqnEEGbo5svIw2yNPL+I/uu5109+iy2mT/wYwHWPop96JjHcS8dFELvMNXbx WhEACYjby7/CdGMHzlnSMdZ4w7GRl4RAT54b/NRN2MJpIuEyQOJRy4Lb01lQOjXI/13B gHKTvrsxwjGmL609z9LQFJf/UJEJ4cyw9Y/MrFNkKQb2BKGsHccdp+EmFqueHX3qz32g Mr+DCpQVSC0j5V/503r80vTwwgyWw+HPI6UMIb+/1uEc6ZvRmRPNcaES98kIz2dsE+kx zPUNKygvoKiXBdu6rkvPFf3ny1S+YIj4AHXRGNNf3/+Ak8f+hw1XzYEl/c4qoVgvyHux 5MIQ== X-Gm-Message-State: AAQBX9f6VJEqtowRIolXyrudCmYBjUMb9BFmn7+c1PVgd/q1uM3Op8ne L6drEYUlms1bT/sAkJrpCDk= X-Google-Smtp-Source: AKy350bqtjGMqUDj64Vd9TAg+pXBooWEAQxu4ChJg1jC2v+VGesgFNLvlCTG6tFjf9pI0EMoGkuG/g== X-Received: by 2002:adf:fe8e:0:b0:2c5:4c9d:2dab with SMTP id l14-20020adffe8e000000b002c54c9d2dabmr2075904wrr.10.1680705063327; Wed, 05 Apr 2023 07:31:03 -0700 (PDT) Received: from krug (87-196-72-128.net.novis.pt. [87.196.72.128]) by smtp.gmail.com with ESMTPSA id r8-20020a5d4e48000000b002c70e60abd4sm15370477wrt.2.2023.04.05.07.31.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 07:31:02 -0700 (PDT) From: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= To: Wilhelm Kirschbaum Subject: Re: bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python In-Reply-To: <87mt3nfktw.fsf@gmail.com> (Wilhelm Kirschbaum's message of "Tue, 04 Apr 2023 22:29:10 +0200") 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> <87zg7nfrex.fsf@gmail.com> <87v8ibfnke.fsf@gmail.com> <87mt3nfktw.fsf@gmail.com> Date: Wed, 05 Apr 2023 15:33:05 +0100 Message-ID: <875yaa2yce.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62536 Cc: Eli Zaretskii , 62536@debbugs.gnu.org, mou.tong@outlook.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Wilhelm Kirschbaum writes: >>> And in electric-layout-rules you _can_, I think, identify >>> triple quotes using a function as described in the last >>> paragraph of its docstring. >>> >> Yes, I tested this earlier and it does work. >> > > Even though it works, it does not play nice with the custom psif, > because the layout rules seems to trigger before the hook. There could yet be a snag here, which I didn't anticipate, which is that rules in electric-layout-rules do not trigger if inside strings or comments, and that is hardcoded. Let's assume we got rid of the snag or had some mechanism to override it: diff --git a/lisp/electric.el b/lisp/electric.el index bac3f5a2b3c..cef5326852c 100644 --- a/lisp/electric.el +++ b/lisp/electric.el @@ -409,9 +409,7 @@ electric-layout-post-self-insert-function-1 (goto-char pos) (funcall probe last-command-event)))) (when res (throw 'done res)))))))))) - (when (and rule - ;; Not in a string or comment. - (not (nth 8 (save-excursion (syntax-ppss pos))))) + (when rule (goto-char pos) (when (functionp rule) (setq rule (funcall rule))) (dolist (sym (if (symbolp rule) (list rule) rule)) Then, the following simple patch seems to have good results in my tests. (defun joaot/looking-back-at-exactly-three-quotes-p () (looking-back "\\(\\`\\|[^\"]\\)\"\"\"" (- (point) 4))) =20=20=20=20 (defun joaot/triple-quotes () (when (and (eq ?\" last-command-event) (joaot/looking-back-at-exactly-three-quotes-p)) (save-excursion (insert "\"\"\"" )))) =20=20=20=20 (defun joaot/layout-after-triple-quotes (inserted) (when (and (eq inserted ?\") (joaot/looking-back-at-exactly-three-quot= es-p)) '(after-stay after))) =20=20=20=20 (defun joaot/setup-elixir-electricity () (electric-layout-local-mode 1) (electric-pair-local-mode 1) (electric-indent-local-mode 1) (add-hook 'post-self-insert-hook 'joaot/super-quotes-and-newlines -05 = t) (setq-local electric-layout-rules (list #'joaot/layout-after-triple-quotes))) =20=20=20=20 (add-hook 'elixir-ts-mode-hook 'joaot/setup-elixir-electricity) Jo=C3=A3o From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 05 13:38:31 2023 Received: (at 62536) by debbugs.gnu.org; 5 Apr 2023 17:38:31 +0000 Received: from localhost ([127.0.0.1]:52571 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pk75a-0002yd-I0 for submit@debbugs.gnu.org; Wed, 05 Apr 2023 13:38:30 -0400 Received: from mail-wr1-f45.google.com ([209.85.221.45]:38592) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pk75Y-0002yO-FI for 62536@debbugs.gnu.org; Wed, 05 Apr 2023 13:38:28 -0400 Received: by mail-wr1-f45.google.com with SMTP id q19so33924574wrc.5 for <62536@debbugs.gnu.org>; Wed, 05 Apr 2023 10:38:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680716302; 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=ucbYVdhZXx+8zH0XtK0vdH6NlLmzNCGyk0tutXl0mQE=; b=MpIZv0QDz/bcB0RNJN2j78h7LsJMckuQB4vt/f5FYRxDgNYkzFu0ChsPE7RzV01iGX AOSvlrfmfzQcIaNcNktb61EL8L5LBCWm1Gm8NYmZwQy7S3tyOp3FXm49yTAiflVOUMWe XCWvpZGGNkniyKNw66LHloxvCAR36pMlCc07LLCycit9cVYoof3XJxZsoEdGvrZHzZ1w 8LuzxP50xrh3XDRNScsXbp0idCIYG9SXYvb/f9LFmGFYKDQuoZzupCqtVWBiMOTXc+1Z D2df93H4KiUsd4xB58FN6DWZmAX0GfpW8oqTTzTeI9n2vAZlkB9CEsnPmzlI2jAVzT/B EbnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680716302; 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=ucbYVdhZXx+8zH0XtK0vdH6NlLmzNCGyk0tutXl0mQE=; b=rZ+y+u7lLpcIgK0CO6+BILexv+I9GGE+KeyG5D/dllXL0XNs+uk0bTRWPPG8g/nwW1 nIThlBqQJBN5V2TQ5m0tyraCCWAamue28ynhnV+0/mdI2F7fyhS3y4mkaAkUS3I2w3gW bF3/hQ+/T0+nIeuc3TRr3cpmFS9L4bO5qFCYJvyEGp6MzdTgIrK04V+czf4HnYooNIzH Ond1T6z7+Twu34xlhr3qHYGF7RmdtvmO0uOv64xfdvS/G9mSWgnrSUzXVHf3KbWXHVPO 0jdDkiHT1RQ7CduNPhhNZwyhpr8+u5fuzYoQvognRX+4YYdDMCvkgoNjfiV/8h160qFC kXqQ== X-Gm-Message-State: AAQBX9f9GAFkrIRd/m6mJRP8mEMHZcjSN4PKXPpiaSW8PLyuaIarLWbs BOa+yvRIiKHL63VoF2DLNB8= X-Google-Smtp-Source: AKy350bcimte5EXcdRpzB5gdGoKwmLzj03gxrSKi0O2ExKDczjQAFzH9YsIdbLb0yEnjeXGt3bK8nQ== X-Received: by 2002:a5d:62ce:0:b0:2bf:bf05:85ac with SMTP id o14-20020a5d62ce000000b002bfbf0585acmr2207566wrv.23.1680716302515; Wed, 05 Apr 2023 10:38:22 -0700 (PDT) Received: from melissa.local (ec2-13-245-158-50.af-south-1.compute.amazonaws.com. [13.245.158.50]) by smtp.gmail.com with ESMTPSA id n5-20020adffe05000000b002d97529b3bbsm15545924wrr.96.2023.04.05.10.38.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 10:38:22 -0700 (PDT) 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> <87zg7nfrex.fsf@gmail.com> <87v8ibfnke.fsf@gmail.com> <87mt3nfktw.fsf@gmail.com> <875yaa2yce.fsf@gmail.com> User-agent: mu4e 1.9.3; emacs 30.0.50 From: Wilhelm Kirschbaum To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Subject: Re: bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python Date: Wed, 05 Apr 2023 19:28:06 +0200 In-reply-to: <875yaa2yce.fsf@gmail.com> Message-ID: <87y1n6b56c.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62536 Cc: Eli Zaretskii , 62536@debbugs.gnu.org, mou.tong@outlook.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Wilhelm Kirschbaum writes: > >>>> And in electric-layout-rules you _can_, I think, identify >>>> triple quotes using a function as described in the last >>>> paragraph of its docstring. >>>> >>> Yes, I tested this earlier and it does work. >>> >> >> Even though it works, it does not play nice with the custom=20 >> psif, >> because the layout rules seems to trigger before the hook. > > There could yet be a snag here, which I didn't anticipate, which=20 > is that > rules in electric-layout-rules do not trigger if inside strings=20 > or > comments, and that is hardcoded. > > Let's assume we got rid of the snag or had some mechanism to=20 > override > it: > > diff --git a/lisp/electric.el b/lisp/electric.el > index bac3f5a2b3c..cef5326852c 100644 > --- a/lisp/electric.el > +++ b/lisp/electric.el > @@ -409,9 +409,7 @@=20 > electric-layout-post-self-insert-function-1 > (goto-char pos) > (funcall probe=20 > last-command-event)))) > (when res (throw 'done=20 > res)))))))))) > - (when (and rule > - ;; Not in a string or comment. > - (not (nth 8 (save-excursion (syntax-ppss=20 > pos))))) > + (when rule > (goto-char pos) > (when (functionp rule) (setq rule (funcall rule))) > (dolist (sym (if (symbolp rule) (list rule) rule)) > > > Then, the following simple patch seems to have good results in=20 > my tests. > > (defun joaot/looking-back-at-exactly-three-quotes-p () > (looking-back "\\(\\`\\|[^\"]\\)\"\"\"" (- (point) 4))) >=20=20=20=20=20 > (defun joaot/triple-quotes () > (when (and (eq ?\" last-command-event) > (joaot/looking-back-at-exactly-three-quotes-p)) > (save-excursion (insert "\"\"\"" )))) >=20=20=20=20=20 > (defun joaot/layout-after-triple-quotes (inserted) > (when (and (eq inserted ?\")=20 > (joaot/looking-back-at-exactly-three-quotes-p)) > '(after-stay after))) >=20=20=20=20=20 > (defun joaot/setup-elixir-electricity () > (electric-layout-local-mode 1) > (electric-pair-local-mode 1) > (electric-indent-local-mode 1) > (add-hook 'post-self-insert-hook=20 > 'joaot/super-quotes-and-newlines -05 t) > (setq-local electric-layout-rules > (list #'joaot/layout-after-triple-quotes))) >=20=20=20=20=20 > (add-hook 'elixir-ts-mode-hook=20 > 'joaot/setup-elixir-electricity) > > Jo=C3=A3o Thanks, yes. I think this brings us closer. For some more fun,=20 and the other part of the issue I have not mentioned is this scenario: ```elixir def foo() do ~H""" ) id 1pkDHV-0006ek-Al for submit@debbugs.gnu.org; Wed, 05 Apr 2023 20:15:13 -0400 Received: from mail-wr1-f47.google.com ([209.85.221.47]:38459) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pkDHT-0006eW-Gb for 62536@debbugs.gnu.org; Wed, 05 Apr 2023 20:15:11 -0400 Received: by mail-wr1-f47.google.com with SMTP id q19so34774495wrc.5 for <62536@debbugs.gnu.org>; Wed, 05 Apr 2023 17:15:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680740105; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZDMZUeE7j0z2wr5IsSCdBgzsVDAIxAIHTlnD1Fzw1zQ=; b=JGjw9aX8ewFPbZfcC892jQcz79QWzydhKBomAJmqhvsz+0dMgN671ry+o+VEYR5DfN qTu3Vpf7TNO2r711pIQ5Xv2TrBcCJTdMlPlNs74Df4y/tYRwXy/4hu7F3hx1r8jI3RQQ RJkppYdygQd7pvCOuHFyTbBeNMfr/K1/VTz0PMSD2v484KcjoQIkEKqGJtliUIL1YwdP 8Wwros8/d5WYymKj//9GfF5mASeK9Mpme0eFY2czPmbUSDz1N0CR8+61l5D7svTNwzTF FU3j6ndEwHd/ZGBMgwDfoPtRqYpVugxYEa7eM0WgMMGruYkNfiiPeUxghS5k+cdeULB8 mcNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680740105; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ZDMZUeE7j0z2wr5IsSCdBgzsVDAIxAIHTlnD1Fzw1zQ=; b=o8dh0PAmRp8/puf0guhPy+0IaGi+VsHCngOR40Xb8WDXdQ0VIOfoyB9G9tZ3qyC6IP tUz/HzwN8lE+BqwBITx8hsi/CRHUnU6QQ8EqIwFPrIatsxrMnbtIlCwpvEr5pW/qXAg3 a+I2W9WKSwARSfetLs9okApTRLq72XzSTUL2JwQNfIFkjXfDfFBD/mqQcR+1UZ9OgkAL bc0qBup1hqTY9bRY1PkKZQXZ1ug3nePJorefKj5lXOMH+cOPVBS1GvmYgwBDO3RDwfCH llSCQcX7lTY/7JmEAQFUy5JcveA6LEbe0TvJpsACobQG35tk43PJf26F8Roi1mNnTwco TufQ== X-Gm-Message-State: AAQBX9d/cSdZp6vLajpupQ50TLL1Ibgg/GanA8Onpe5gLCdrkzJ0Wlah jukBYsKK0LZFy5aT+xuWNOU= X-Google-Smtp-Source: AKy350baWEZCOFVziFWh1wp4hrErOz6ztukxQ9V311oynQncJ546Z6vh9K1mgX/B5Y1/nDFHm17k6g== X-Received: by 2002:adf:ef92:0:b0:2e4:1a27:5839 with SMTP id d18-20020adfef92000000b002e41a275839mr5447610wro.43.1680740105465; Wed, 05 Apr 2023 17:15:05 -0700 (PDT) Received: from krug (87-196-72-128.net.novis.pt. [87.196.72.128]) by smtp.gmail.com with ESMTPSA id z5-20020a7bc7c5000000b003e91b9a92c9sm3611741wmk.24.2023.04.05.17.15.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 17:15:04 -0700 (PDT) From: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= To: Wilhelm Kirschbaum Subject: Re: bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python In-Reply-To: <87y1n6b56c.fsf@gmail.com> (Wilhelm Kirschbaum's message of "Wed, 05 Apr 2023 19:28:06 +0200") 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> <87zg7nfrex.fsf@gmail.com> <87v8ibfnke.fsf@gmail.com> <87mt3nfktw.fsf@gmail.com> <875yaa2yce.fsf@gmail.com> <87y1n6b56c.fsf@gmail.com> Date: Thu, 06 Apr 2023 01:17:06 +0100 Message-ID: <87cz4h3lvh.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62536 Cc: Eli Zaretskii , 62536@debbugs.gnu.org, mou.tong@outlook.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Wilhelm Kirschbaum writes: > Thanks, yes. I think this brings us closer. Yes, though keep in mind that needs that patch to lisp/electric.el, or some other mechanism that allows electric-layout-mode to happen in strings or coments. If this mechanism is needed, I don't think it is a lot of work to implement it. But who knows if the text inside the '""" """' should _not_ be considered a string or comment class at all? > For some more fun, and the other part of the issue I have not > mentioned is this scenario: > > ```elixir > def foo() do > ~H""" > """ > end > ``` > > then completing `class=3D""` jumps into the end of the template , which > is > pretty annoying, more so that the current issue at hand. Ah, I think you want to look at elec-pair's electric-pair-skip-whitespace (which is a user variable, but you major-mode could set it to nil) and the function electric-pair-skip-whitespace-function controlling how whitespace is skipped. > > The other patch in this thread will porpertize the `"""` as > `$` for a lack of a better syntax class, which then breaks it again > and > produces: > > ``` > """ > |" > """ > ``` Maybe that means that the text inside the """ """ no longer is "string or comment". Can you evaluate `(syntax-ppss)` inside that block > (define-derived-mode elixir-ts-mode prog-mode "Elixir" > "Major mode for editing Elixir, powered by tree-sitter." > @@ -630,7 +648,8 @@ elixir-ts-mode > ( elixir-sigil elixir-string-escape > elixir-string-interpolation )))) > > - (treesit-major-mode-setup))) > + (treesit-major-mode-setup) > + (setq-local syntax-propertize-function > #'elixir-ts--syntax-propertize))) I think at this point it would be a good idea for you to push whatever is the "best" version of your code up to this point to a branch in a Git repository somewhere, so that I can grab it, test it and try to suggest simplification based on that. Alternatively, attach patches (but at least I sometimes get confused when there are multiple patchsets in a thread). Jo=C3=A3o From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 06 01:59:17 2023 Received: (at 62536) by debbugs.gnu.org; 6 Apr 2023 05:59:17 +0000 Received: from localhost ([127.0.0.1]:53209 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pkIeS-0000Ow-Ru for submit@debbugs.gnu.org; Thu, 06 Apr 2023 01:59:17 -0400 Received: from mail-wm1-f50.google.com ([209.85.128.50]:45817) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pkIeQ-0000Oi-8r for 62536@debbugs.gnu.org; Thu, 06 Apr 2023 01:59:14 -0400 Received: by mail-wm1-f50.google.com with SMTP id v6-20020a05600c470600b003f034269c96so12902692wmo.4 for <62536@debbugs.gnu.org>; Wed, 05 Apr 2023 22:59:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680760748; 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=K7+cZzZQqaOE5Rn0MmoV15/eYnWkVtU2XlfwD6L3psQ=; b=ThvpMEVi+/X8zV6bvgdrUCHd9hhZgbz031yCxozPHUYgX5t2saA2mXGdFLUr3rmmxM TkXWS9wFFxsOn8ybaJMJ+fUuVn7/lUWDGbUUr0zw9w0HHiM8FOdi1heqDGVXwk6ZaSfU XEXUls3/gq+1MlRaDEohEztzvmCzE4NUe3wRB2hDTf/vkyqH/zEq+dedqitDdg7zeEzt RZHm6VEr1zZbOobtxdnk+WjSgsfca9vfAm9oFtqWKMUpDft894BR8Eq7DL6C0ym+hJU7 Qe2SSWLpHlgQQd6rkrCGQLasGoRos+4Ct5MVJygjuYaowRqLtrUDGKN0szc0Yc+U4wFb xByA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680760748; 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=K7+cZzZQqaOE5Rn0MmoV15/eYnWkVtU2XlfwD6L3psQ=; b=vbu2NyF7MhcdY5/Cz6nQoMFn7W6tbfGkJnNe5tapB47hq/NEmrQ/2Ub6bWmU41WT5K 3ELO/KdRwnyhOoZHdq3hCsBzNUHMUOD5JendWcBytS3MX2JS4AW7cALMHfsEtWyP5ni7 fPsweQemn3rkHj0uznQAldBE4r82VBeaBp3QI8JMy2uVjb0HVv4EHq37aCm57YRnoO4e r5bfFGiGUzJAlMOFiPwBQ1NFhzDmDPkuWfKS9hgThKqIkupbNv/vGO64lwDzR1Y9cGZ9 xJPo5P1IDu+0vswgog2f7c82wK0734UPDfTOBQyXEf981gc6HI0hy0SmefFWpugCYX3U rcHA== X-Gm-Message-State: AAQBX9eXgwVllYZF/92VzkI638hkQeAUNZxwQVettLi8T+tdVpcgAp5r rZhjJll3/qsWuEraINxqxL8= X-Google-Smtp-Source: AKy350YK2h89qDy62DTzPL8oEUcctUxaqwRbuoUr+Dbm0QFERCwqXvRsnM3VVRwHAsDhWWQfzXOXAw== X-Received: by 2002:a7b:c8da:0:b0:3ef:6ae7:89c7 with SMTP id f26-20020a7bc8da000000b003ef6ae789c7mr6301761wml.25.1680760748230; Wed, 05 Apr 2023 22:59:08 -0700 (PDT) Received: from melissa.local ([2c0f:ef18:1431:0:b09:9616:db04:c248]) by smtp.gmail.com with ESMTPSA id z6-20020a05600c220600b003ed246c1d28sm490209wml.44.2023.04.05.22.59.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 22:59:07 -0700 (PDT) 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> <87zg7nfrex.fsf@gmail.com> <87v8ibfnke.fsf@gmail.com> <87mt3nfktw.fsf@gmail.com> <875yaa2yce.fsf@gmail.com> <87y1n6b56c.fsf@gmail.com> <87cz4h3lvh.fsf@gmail.com> User-agent: mu4e 1.9.3; emacs 30.0.50 From: Wilhelm Kirschbaum To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Subject: Re: bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python Date: Thu, 06 Apr 2023 07:39:54 +0200 In-reply-to: <87cz4h3lvh.fsf@gmail.com> Message-ID: <875ya9d00o.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62536 Cc: Eli Zaretskii , 62536@debbugs.gnu.org, mou.tong@outlook.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Wilhelm Kirschbaum writes: > >> Thanks, yes. I think this brings us closer. > > Yes, though keep in mind that needs that patch to=20 > lisp/electric.el, or > some other mechanism that allows electric-layout-mode to happen=20 > in > strings or coments. If this mechanism is needed, I don't think=20 > it is a > lot of work to implement it. > > But who knows if the text inside the '""" """' should _not_ be > considered a string or comment class at all? > I will spend some time in the next couple of days to familiar=20 myself a bit more with he electric modes and can hopefully weigh in as=20 well. If we can patch electric.el and make this change simpler it is=20 still preferable imo. >> For some more fun, and the other part of the issue I have not >> mentioned is this scenario: >> >> ```elixir >> def foo() do >> ~H""" >> > """ >> end >> ``` >> >> then completing `class=3D""` jumps into the end of the template ,=20 >> which >> is >> pretty annoying, more so that the current issue at hand. > > Ah, I think you want to look at elec-pair's > electric-pair-skip-whitespace (which is a user variable, but you > major-mode could set it to nil) and the function > electric-pair-skip-whitespace-function controlling how=20 > whitespace is > skipped. > Will try that, thanks. >> >> The other patch in this thread will porpertize the `"""` as >> `$` for a lack of a better syntax class, which then breaks it=20 >> again >> and >> produces: >> >> ``` >> """ >> |" >> """ >> ``` > > Maybe that means that the text inside the """ """ no longer is=20 > "string > or comment". Can you evaluate `(syntax-ppss)` inside that block > (syntax-ppss) here is: (0 nil 1 nil nil nil 0 nil nil nil nil) """ | """ So does not see it as inside a string. The triple quotes can either be a heredoc or a embedded template=20 if prefixed with ~H. > > I think at this point it would be a good idea for you to push=20 > whatever > is the "best" version of your code up to this point to a branch=20 > in a Git > repository somewhere, so that I can grab it, test it and try to=20 > suggest > simplification based on that. Alternatively, attach patches=20 > (but at > least I sometimes get confused when there are multiple patchsets=20 > in a > thread). > > Jo=C3=A3o My current "working" version is here:=20 https://git.sr.ht/~whk/emacs. I rebase on there quite often though. From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 06 06:07:28 2023 Received: (at 62536-done) by debbugs.gnu.org; 6 Apr 2023 10:07:28 +0000 Received: from localhost ([127.0.0.1]:53469 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pkMWe-0007ZV-AE for submit@debbugs.gnu.org; Thu, 06 Apr 2023 06:07:28 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36502) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pkMWc-0007ZI-BY for 62536-done@debbugs.gnu.org; Thu, 06 Apr 2023 06:07:26 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pkMWW-0006D7-No; Thu, 06 Apr 2023 06:07:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=2odxu6ByrKk4ou9CQhjfbMuvbsM8uDgUK1+4jqHmzCY=; b=mYjlhoqtv1db w/WPQhf30/dWmU5rhO/nqUHhrpWSDf3wRh5n/qzlvKacjuZKjpl4jNuw5s+rW9fUa2Tx3wMgtnRdk uNcfeCOUFlrKxDFaQ6j2+2rXMnqQHQa7nTxsB7C+OrIyrPhmICkBcVdGC44o7xHgcn3SC6OxYJlRL MWCXXyq5LjgBPdmlE88oTDDCyZM+GqfSGsBCpopcmi8BeYVmYyAvbfvbNEiwxNG5QOQbOitckypYT CSkUaVRFmEybFgzvfgTN0iZt2qhLnil0rzgoG7runjMj4vPsVJ3Vme86WTa00zgfrMbXIeCiT3eqv i9rZxEUH2p5f3y5Ns7PMyg==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pkMWI-0002Ml-1s; Thu, 06 Apr 2023 06:07:19 -0400 Date: Thu, 06 Apr 2023 13:07:34 +0300 Message-Id: <83lej5qq6x.fsf@gnu.org> From: Eli Zaretskii To: Wilhelm Kirschbaum In-Reply-To: <871ql06w59.fsf@gmail.com> (message from Wilhelm Kirschbaum on Tue, 04 Apr 2023 07:39:24 +0200) Subject: Re: bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python 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> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62536-done Cc: 62536-done@debbugs.gnu.org, mou.tong@outlook.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Wilhelm Kirschbaum > Cc: mou.tong@outlook.com, 62536@debbugs.gnu.org > Date: Tue, 04 Apr 2023 07:39:24 +0200 > > > OK, but I understand you are still considering a better way to > > solve this? So I should not yet install the last patches? > > I had a look and don't see how without changing elec-pair.el 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 > can apply it to both python-mode and elixir-ts-mode later. OK, installed on master, and closing the bug. Thanks. From unknown Sun Jun 22 04:07:11 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 04 May 2023 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator