all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "João Távora" <joaotavora@gmail.com>
To: Wilhelm Kirschbaum <wkirschbaum@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>,
	62536@debbugs.gnu.org, mou.tong@outlook.com
Subject: bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python
Date: Thu, 06 Apr 2023 01:17:06 +0100	[thread overview]
Message-ID: <87cz4h3lvh.fsf@gmail.com> (raw)
In-Reply-To: <87y1n6b56c.fsf@gmail.com> (Wilhelm Kirschbaum's message of "Wed,  05 Apr 2023 19:28:06 +0200")

Wilhelm Kirschbaum <wkirschbaum@gmail.com> 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"""
>  <foo class=
>  """
> end
> ```
>
> then completing `class=""` 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ão





  reply	other threads:[~2023-04-06  0:17 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     ` bug#62536: 回复: " Mou Tong
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 [this message]
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=87cz4h3lvh.fsf@gmail.com \
    --to=joaotavora@gmail.com \
    --cc=62536@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=mou.tong@outlook.com \
    --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.