From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Wilhelm Kirschbaum 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 07:39:54 +0200 Message-ID: <875ya9d00o.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> <87cz4h3lvh.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12882"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.9.3; emacs 30.0.50 Cc: Eli Zaretskii , 62536@debbugs.gnu.org, mou.tong@outlook.com To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 06 08:00:27 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 1pkIfb-0003AS-JZ for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 06 Apr 2023 08:00:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pkIfO-0003qX-84; Thu, 06 Apr 2023 02:00:15 -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 1pkIfG-0003mW-C4 for bug-gnu-emacs@gnu.org; Thu, 06 Apr 2023 02:00:08 -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 1pkIfD-0007Y2-5C for bug-gnu-emacs@gnu.org; Thu, 06 Apr 2023 02:00:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pkIfC-0000QW-LO for bug-gnu-emacs@gnu.org; Thu, 06 Apr 2023 02:00:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Wilhelm Kirschbaum Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 06 Apr 2023 06:00: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.16807607571550 (code B ref 62536); Thu, 06 Apr 2023 06:00:02 +0000 Original-Received: (at 62536) by debbugs.gnu.org; 6 Apr 2023 05:59:17 +0000 Original-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 Original-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 Original-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) Original-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) In-reply-to: <87cz4h3lvh.fsf@gmail.com> 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:259297 Archived-At: > 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.