From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Brent Westbrook Newsgroups: gmane.emacs.devel Subject: rust-ts-mode can't refill or reindent comments Date: Thu, 29 Dec 2022 20:20:29 -0500 Message-ID: <87sfgxvdjw.fsf@go.olemiss.edu> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19886"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.8.13; emacs 30.0.50 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Dec 30 09:00:45 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 1pBAJo-0004xh-Ia for ged-emacs-devel@m.gmane-mx.org; Fri, 30 Dec 2022 09:00:44 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pBAJ2-0002KF-RQ; Fri, 30 Dec 2022 02:59:58 -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 1pB4zi-0003mx-QM for emacs-devel@gnu.org; Thu, 29 Dec 2022 21:19:39 -0500 Original-Received: from mail-qt1-x82b.google.com ([2607:f8b0:4864:20::82b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pB4zg-0006js-Pr for emacs-devel@gnu.org; Thu, 29 Dec 2022 21:19:38 -0500 Original-Received: by mail-qt1-x82b.google.com with SMTP id c11so16317523qtn.11 for ; Thu, 29 Dec 2022 18:19:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=go-olemiss-edu.20210112.gappssmtp.com; s=20210112; h=mime-version:message-id:date:subject:to:from:user-agent:from:to:cc :subject:date:message-id:reply-to; bh=FJX4C63b1uFvHAY/Q0U9qT+T5+A0fiL+GSyDJcHk7qQ=; b=xktN2GvGVkACaR5wq95vnPvKQove+zNR4OtgJX7eJ/uprUYRv1hpto/5HLC6kXw21K NjrhSTr9ydB2g4jOGGbqGtpO1lZ1gy6zv5oFfNwNQOISzPFTfJa7YCPzzJd3IZHCK5ij ctmZjoxM2eMmqw25oUc0w5eo4djbKPDKRCOY73LKDrn9Ykxd+MHWoocfTHKc+SlGXkQP 1fSPsZ6LgqcptE7rXw3yUp/JU76u+FvlXps2D5wRyumL14vjORq3v3SRytijOfTC1WD0 yfxxS8fDOycilKP9dCTSCS6F26EtV0xa+gw0Mv6a6VY9K3il3wvAE9qhsIpzOTWXckOH p2EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:subject:to:from:user-agent :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FJX4C63b1uFvHAY/Q0U9qT+T5+A0fiL+GSyDJcHk7qQ=; b=JBwDk5/+Yy6SWbwCujzZtS+7/U1s4EZYhVF/GLvGw+8Q+3s2FvXpyMXefV2+F7VXSV 4koxWy3xFdwyBJYvzBrBkiuXRjfupeTtNEvclMrjW6rzO9H2bJJD810Pg/T4t/z+2HNP 6LJlWyBe3wDMlHVInQU93SA1ez21d4dSl7pgg4iB8mUkrGejslf06ZVOxiS+e6M9mvTz 9N/g4sMqHiSquj0N/gyFKQBN7I4evST04A1Qi0XtJoO4QA0ts2+qLzAmr3eEDhie5e2B 5EArg4QJ46KtFi/+JJPXqh4rHsQUVn6UsAlDdk2w53lF7lQfo5F1QvZN6hTZiNnbUAmb weDA== X-Gm-Message-State: AFqh2koTMdgOvIZSI4cw7EatV4bNKY/sbIyWtARkKPtfPjFzREHuEi1R dSin5iPePAGHg7iKRkU9n7MtioIap48iU7d3 X-Google-Smtp-Source: AMrXdXt0RV1KRa6+imCnDioghBZ4oagrH9WmC03BPunATZWGr2oyK0p9BQHj1fBQIl6mM1KijC/LFA== X-Received: by 2002:ac8:7389:0:b0:3a5:4a20:3096 with SMTP id t9-20020ac87389000000b003a54a203096mr41571500qtp.6.1672366774083; Thu, 29 Dec 2022 18:19:34 -0800 (PST) Original-Received: from keystone (pool-100-15-80-136.washdc.fios.verizon.net. [100.15.80.136]) by smtp.gmail.com with ESMTPSA id j10-20020ac874ca000000b003a69225c2cdsm12296412qtr.56.2022.12.29.18.19.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Dec 2022 18:19:33 -0800 (PST) Received-SPF: pass client-ip=2607:f8b0:4864:20::82b; envelope-from=bwestbr2@go.olemiss.edu; helo=mail-qt1-x82b.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, 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-Mailman-Approved-At: Fri, 30 Dec 2022 02:59:47 -0500 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:302081 Archived-At: 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: (advice-add 'prog-fill-reindent-defun :around #'(lambda (_ _) (fill-paragraph))) 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. 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. 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. For a concrete example, this is the comment from a bevy example that I'm testing on, with my fill-column set to 80: 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 { 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. 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.