GNU bug report logs -
#62536
30.0.50; Can we add """ ... """ electric pair in elixir, just like python
Previous Next
Reported by: 牟 桐 <mou.tong <at> outlook.com>
Date: Thu, 30 Mar 2023 04:31:02 UTC
Severity: normal
Found in version 30.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
On Tue, Apr 4, 2023 at 6:43 AM Wilhelm Kirschbaum <wkirschbaum <at> gmail.com> wrote:
>
> >> From: Wilhelm Kirschbaum <wkirschbaum <at> gmail.com>
> >> Date: Mon, 3 Apr 2023 16:17:51 +0200
> >> Cc: 牟 桐 <mou.tong <at> outlook.com>, 62536 <at> debbugs.gnu.org
> >>
> >> On Mon, 3 Apr 2023, 16:02 Eli Zaretskii, <eliz <at> gnu.org> wrote:
> >>
> >> > Cc: "62536 <at> debbugs.gnu.org" <62536 <at> debbugs.gnu.org>
> >> > From: Wilhelm Kirschbaum <wkirschbaum <at> 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? 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ão
This bug report was last modified 2 years and 48 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.