From: Mou Tong <mou.tong@outlook.com>
To: Wilhelm Kirschbaum <wkirschbaum@gmail.com>
Cc: "62536@debbugs.gnu.org" <62536@debbugs.gnu.org>
Subject: bug#62536: 回复: bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python
Date: Thu, 30 Mar 2023 08:25:34 +0000 [thread overview]
Message-ID: <SJ0P220MB067507D9876B3118B1F50AD7978E9@SJ0P220MB0675.NAMP220.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <87edp6oim6.fsf@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2138 bytes --]
> 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 will
help you insert `end` automatically.
I think it's better to let user trigger `do`'s completion. Because 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 ;)
________________________________
发件人: Wilhelm Kirschbaum <wkirschbaum@gmail.com>
发送时间: 2023年3月30日 14:19
收件人: Eli Zaretskii <eliz@gnu.org>
抄送: 牟 桐 <mou.tong@outlook.com>; 62536@debbugs.gnu.org <62536@debbugs.gnu.org>
主题: Re: bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python
>> From: 牟 桐 <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/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?
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.
[-- Attachment #2: Type: text/html, Size: 4635 bytes --]
next prev parent reply other threads:[~2023-03-30 8:25 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-30 4:25 bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python 牟 桐
2023-03-30 5:44 ` Eli Zaretskii
2023-03-30 6:19 ` Wilhelm Kirschbaum
2023-03-30 8:25 ` Mou Tong [this message]
2023-04-02 7:49 ` Wilhelm Kirschbaum
2023-04-02 16:38 ` Mou Tong
2023-04-02 17:21 ` Wilhelm Kirschbaum
2023-04-02 19:24 ` Wilhelm Kirschbaum
2023-04-03 2:41 ` Mou Tong
2023-04-03 8:26 ` Wilhelm Kirschbaum
2023-04-03 9:42 ` bug#62536: 回复: " Mou Tong
2023-04-03 10:38 ` Wilhelm Kirschbaum
2023-04-03 12:02 ` João Távora
2023-04-03 12:08 ` Wilhelm Kirschbaum
2023-04-03 14:02 ` Eli Zaretskii
2023-04-03 14:17 ` Wilhelm Kirschbaum
2023-04-03 14:38 ` Eli Zaretskii
2023-04-04 5:39 ` Wilhelm Kirschbaum
2023-04-04 9:08 ` João Távora
2023-04-04 17:54 ` Wilhelm Kirschbaum
2023-04-04 18:39 ` João Távora
2023-04-04 19:03 ` Wilhelm Kirschbaum
2023-04-04 19:46 ` Wilhelm Kirschbaum
2023-04-04 20:29 ` Wilhelm Kirschbaum
2023-04-05 13:09 ` João Távora
2023-04-05 14:33 ` João Távora
2023-04-05 17:28 ` Wilhelm Kirschbaum
2023-04-06 0:17 ` João Távora
2023-04-06 5:39 ` Wilhelm Kirschbaum
2023-04-06 10:07 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=SJ0P220MB067507D9876B3118B1F50AD7978E9@SJ0P220MB0675.NAMP220.PROD.OUTLOOK.COM \
--to=mou.tong@outlook.com \
--cc=62536@debbugs.gnu.org \
--cc=wkirschbaum@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.