From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs 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 Message-ID: <87cz4h3lvh.fsf@gmail.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10568"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 62536@debbugs.gnu.org, mou.tong@outlook.com To: Wilhelm Kirschbaum Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 06 02:16:28 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pkDIh-0002WI-GP for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 06 Apr 2023 02:16:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pkDIK-000511-2R; Wed, 05 Apr 2023 20:16:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pkDII-00050o-QV for bug-gnu-emacs@gnu.org; Wed, 05 Apr 2023 20:16:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pkDII-0002Ut-HQ for bug-gnu-emacs@gnu.org; Wed, 05 Apr 2023 20:16:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pkDII-0006gs-CZ for bug-gnu-emacs@gnu.org; Wed, 05 Apr 2023 20:16:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 06 Apr 2023 00:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62536 X-GNU-PR-Package: emacs Original-Received: via spool by 62536-submit@debbugs.gnu.org id=B62536.168074011325595 (code B ref 62536); Thu, 06 Apr 2023 00:16:02 +0000 Original-Received: (at 62536) by debbugs.gnu.org; 6 Apr 2023 00:15:13 +0000 Original-Received: from localhost ([127.0.0.1]:53043 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pkDHV-0006ek-Al for submit@debbugs.gnu.org; Wed, 05 Apr 2023 20:15:13 -0400 Original-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 Original-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) Original-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) In-Reply-To: <87y1n6b56c.fsf@gmail.com> (Wilhelm Kirschbaum's message of "Wed, 05 Apr 2023 19:28:06 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:259294 Archived-At: 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