From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: rust-ts-mode can't refill or reindent comments Date: Fri, 30 Dec 2022 00:37:48 -0800 Message-ID: <09E67D79-E5DF-4A37-AB4C-62EF41FBB990@gmail.com> References: <87sfgxvdjw.fsf@go.olemiss.edu> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) 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="740"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Brent Westbrook Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Dec 30 09:39:22 2022 Return-path: Envelope-to: ged-emacs-devel@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 1pBAvB-000Aa2-U7 for ged-emacs-devel@m.gmane-mx.org; Fri, 30 Dec 2022 09:39:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pBAtr-00051A-6O; Fri, 30 Dec 2022 03:37:59 -0500 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 1pBAtm-0004zl-1t for emacs-devel@gnu.org; Fri, 30 Dec 2022 03:37:56 -0500 Original-Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pBAtk-0003mQ-71 for emacs-devel@gnu.org; Fri, 30 Dec 2022 03:37:53 -0500 Original-Received: by mail-pj1-x1030.google.com with SMTP id fy4so21710335pjb.0 for ; Fri, 30 Dec 2022 00:37:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=oU1agUuE2thO8Eh8I3lmmsrkrqi0U7gYrgyiQhKU48Y=; b=IBoZSeIBRhZ9UwntdNzBglHCxsYqijgGytmu05VqsGuSTqu3rLgl7pDO3Pfrzv0nKU oueEaTnQ3bMOS6+Bc6D/x31keJi58SD3A9SIogVMgahuIpbpPXMyIKU4I2Fcr72emO3j tdJ3ypmCghgJ7Ux2yObO5En1LZ7W3s2n2nuQnG88I0T7Zo1c7I4Dc/n3VVmPGuF7XRMC KxsH8sBjI4JWaiMqQ0SmvD9jldwn4H3Nf3uZF0k3OdBUAsYtzwisGH4HtdlHxWL6ZmIr Tcn7DOwz5DnEUBLQccnnrx3vzu96/ENFmpS49cr6sxeOuxwKxoPDAJEtEgYUiHtfQCFd fLxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oU1agUuE2thO8Eh8I3lmmsrkrqi0U7gYrgyiQhKU48Y=; b=xxpTe3jWrl8Ocui6dzUK9ZvI8ZqynaJrpZIlAP157ZxwPdPYNMXVNPJ36ovVpFNkjy nJW7vG8IBMhgKz5YTTT2i7RjbAsg9+9aCMlrEe3Zl8iA7h+/3XI28VGK1VVCuzaaRzhE nqKMQ4muvl1drLxox3hd2fRn9xO3JYkoeAx7SFQM317+pAoOzA1dx4TAZE3W+SXlA6uG quzjcJcHPJ/ZoW2dCO8XGp55DbWPZlo/t/jrotpmYKPsDiHTt9B26aFLQjyT9xFyBT+H LQU+fqFWe1nmQtJSxVEdIWh+Yz+msvXqERGK1TfGc9dfpKibHADReWldSKM9sfVgo25s RrRg== X-Gm-Message-State: AFqh2kqXxjn/yIwy5Yb+Lesrgp4t/qtutCOuSd4yXoymQ8qaER++E6Hq Y6FMXThRRKbQU3VPWpNfq+y6GVtdATzgRQ== X-Google-Smtp-Source: AMrXdXtv2pRLEMwiea223RNaEFt3o/HuppCkBs9NlASIdgsbHl9IPo6mq+5ID1TPBCKJlbdWw1BCfA== X-Received: by 2002:a17:902:a70c:b0:187:1b7a:6930 with SMTP id w12-20020a170902a70c00b001871b7a6930mr32094222plq.6.1672389470567; Fri, 30 Dec 2022 00:37:50 -0800 (PST) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id w15-20020a1709026f0f00b001870dc3b4c0sm9081623plk.74.2022.12.30.00.37.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Dec 2022 00:37:50 -0800 (PST) In-Reply-To: <87sfgxvdjw.fsf@go.olemiss.edu> X-Mailer: Apple Mail (2.3696.120.41.1.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=casouri@gmail.com; helo=mail-pj1-x1030.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:302083 Archived-At: > On Dec 29, 2022, at 5:20 PM, Brent Westbrook = wrote: >=20 > I've been trying out rust-ts-mode, and this is the second issue I've = run > into with prog-fill-reindent-defun. At first I could solve it by = adding > advice to the function to defer to fill-paragraph: >=20 > (advice-add 'prog-fill-reindent-defun > :around #'(lambda (_ _) (fill-paragraph))) >=20 > but after rebuilding from the master branch today, fill-paragraph = isn't > working either. There are no errors or messages, but both > prog-fill-reindent-defun and fill-paragraph fail to do anything on a > very long comment line when I try calling them interactively or from > bindings. I've also reproduced this with emacs -Q. Strangely enough, it works in my config despite having a bug, so I = didn=E2=80=99t notice it. Anyway, I fixed it. >=20 > I think this is technically a bug, so I can file a bug report if > preferred, but I thought it would be okay to discuss it here. I forgot who said it, but the idea is =E2=80=9Cif you=E2=80=99re not = sure if it warrants a bug, file a bug report=E2=80=9D. > As far as I can tell, rust-ts-mode is using c-ts-mode-comment-setup to > prepare to format comments, but prog-fill-reindent-defun seems to work > as expected on the Rust comment if I switch to c-ts-mode. >=20 > For a concrete example, this is the comment from a bevy example that = I'm > testing on, with my fill-column set to 80: >=20 > impl WallBundle { > // This "builder method" allows us to reuse logic across our wall = entities, making our code easier to read and less prone to bugs when we = change the logic > fn new(location: WallLocation) -> WallBundle { >=20 > 28f26b11a1e seems to be the origin of the issue because > prog-fill-reindent-defun works fine before that (again with -Q). I = tried > commenting out all of the adaptive-regexp stuff in > c-ts-mode-comment-setup, closing the defun after line 656, and this > fixed my issue in rust-ts-mode, but I assume the rest of that code is > necessary for something and that the real issue is somewhere within = it. >=20 > I can keep bisecting that section of the code if that would help, but = I > thought someone more familiar with it might be able to identify the > issue from here. I'm guessing that it's also some kind of clash with > rust-ts-mode itself since that code works fine in c-ts-mode. Thanks for debugging this, it should work now! Yuan