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.bugs Subject: bug#73900: 30.0.91; auto-fill adds extra space in js-ts-mode Date: Tue, 29 Oct 2024 00:33:05 -0700 Message-ID: <5F76FC01-BE2F-47CC-BA7A-4F77A2F4E41A@gmail.com> References: <87ttd7o2q8.fsf@kleehammer.com> <867c9tak7q.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) 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="24203"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , Michael Kleehammer , 73900@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 29 08:35:20 2024 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 1t5gl5-00065q-SA for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 29 Oct 2024 08:35:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t5gks-0002gC-Fo; Tue, 29 Oct 2024 03:35:06 -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 1t5gko-0002dE-4y for bug-gnu-emacs@gnu.org; Tue, 29 Oct 2024 03:35:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t5gkn-00004w-So for bug-gnu-emacs@gnu.org; Tue, 29 Oct 2024 03:35:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:Date:In-Reply-To:From:Mime-Version:To:Subject; bh=X5I7cRLyZ9TkXws3slhjsMxV84+tzweK/MBxAbh2YgE=; b=uSN/EB2d75iLlRJGvRILJFgfY6BCTmyHlQA+oYSfcmH9ViQ5Oai7bDpSDRt0nLAlWFhFAqxR7sAACgIdy/kOk3O08pz6EMzAVe9Qcu7xy/j0MIE7cZw72EbmY5ei55IyKT0tV1VAEqrMO2Hte25gfoF/tnj0+7sXgjy1JrC1eCiS8N189Rr509xP0gUhx4fretHhQj7hsR7L2UORQoT9E2BQHsDXY6v0psbUrEXGy3rYWoIrMJBAQlVH0bRna6SLX/oCBwuW2P8rP1Ltp6bXMJ6vocJJ4d9xycErrZvkaSoMJEYUQqTZ36Q1ghLVGJJyvafnwIHMXnkVtP8UPpX33Q==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t5gkn-0008S5-Ml for bug-gnu-emacs@gnu.org; Tue, 29 Oct 2024 03:35:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 29 Oct 2024 07:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73900 X-GNU-PR-Package: emacs Original-Received: via spool by 73900-submit@debbugs.gnu.org id=B73900.173018726632433 (code B ref 73900); Tue, 29 Oct 2024 07:35:01 +0000 Original-Received: (at 73900) by debbugs.gnu.org; 29 Oct 2024 07:34:26 +0000 Original-Received: from localhost ([127.0.0.1]:55800 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t5gkD-0008R3-Ov for submit@debbugs.gnu.org; Tue, 29 Oct 2024 03:34:26 -0400 Original-Received: from mail-pg1-f178.google.com ([209.85.215.178]:42299) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t5gkB-0008Qn-Jg for 73900@debbugs.gnu.org; Tue, 29 Oct 2024 03:34:24 -0400 Original-Received: by mail-pg1-f178.google.com with SMTP id 41be03b00d2f7-7e6d04f74faso3428206a12.1 for <73900@debbugs.gnu.org>; Tue, 29 Oct 2024 00:34:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730187197; x=1730791997; darn=debbugs.gnu.org; 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=X5I7cRLyZ9TkXws3slhjsMxV84+tzweK/MBxAbh2YgE=; b=PpbIuulawCrkdcXBTu+HBIW1Uv6J23qbqukDATGAWYH0krXE6cYsaiDD9vU0n16TJH 4lIVrNU+YvpuRSyjU+FUM3deF6Ii3L6no50QVnCmonfosfwj4OVF49xiarIuvxby1Oeu rOwmhT+yEhu8Wjw9KuL/QYf7gSwtIrFNQosxWiOMcH7aR2nvfgr4spKumyi88bQGrmmk Z54MHepXsM39VnJbX9ipLcqLlMgLfADx9O5aWHRIzhrCQWYmJJ4QS3KOwiyxl+xAD4+3 GbILf+jtTDnIoLkZKuJEk+bVjAK/OrKUz4YO8fw7q9iAiI4l4IY5JK82jV1lES/SDM4L bfZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730187197; x=1730791997; 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=X5I7cRLyZ9TkXws3slhjsMxV84+tzweK/MBxAbh2YgE=; b=WA6cOn7ozAbuA5aEydUKOG3PtVrxUUkpMLt+9vhy37MTcXlATl3ovMxHhTvtPoKs8E iZy5lL6l7/yrMz860sIxrUkmoEK4MhAeSvey5e4SKnQAQA6cLRWwgS/pTcIBTAW+XkRP 21029yWbx9tZmEormJQtSdX6eTEK/c93rO857AYsrDvdsrRPeVeNeeJCiOBpoM9S8qz8 5mt6p1tCP2OJp4b+GOOkAopk9TVXwka2Jy7oOu08gvqRPDx9a5nrIa0RJK+MKyhgbt8Q pjul9olfN2TYng6K2umj46Bq+vZ6RawFOfbqbFaHjojQWUqIfyugXaXO51Mh2G8e+g0s WE5Q== X-Forwarded-Encrypted: i=1; AJvYcCWDkTyFANQg1Jy3DZoZ4xhcocfnL3XHbYCj2AIVaKHm21iXcslDcCvwZYaHwD2zBJuTLJ1T1g==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzsgZwyiL2uWliYmZT1iaOSdnE3pC5qYwMyWpPfjD/23eFKFdhC nbwy+w9FZQRNwGy98Dft6hCgazL3lP5P5vj4CaaR5K9Alj/zQmTQ X-Google-Smtp-Source: AGHT+IGuwH/LMlYpjJReZMhU+tjJYlx6iqBlMpxiostWyd0M2e0oyyPEKWYg+ZJUbe4OIO7P6zaMnA== X-Received: by 2002:a05:6a20:d522:b0:1d9:dc8:b80d with SMTP id adf61e73a8af0-1d9e1f78382mr1794931637.20.1730187197486; Tue, 29 Oct 2024 00:33:17 -0700 (PDT) Original-Received: from smtpclient.apple ([2601:646:8f81:6120:38ab:4a6:e63:29b]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7205793175bsm6975917b3a.48.2024.10.29.00.33.16 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Oct 2024 00:33:16 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3776.700.51) 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:294471 Archived-At: > On Oct 27, 2024, at 8:10=E2=80=AFPM, Dmitry Gutov = wrote: >=20 > On 27/10/2024 12:55, Eli Zaretskii wrote: >>> From: Michael Kleehammer >>> Date: Sat, 19 Oct 2024 22:46:55 -0500 >>>=20 >>> In Emacs 30, js-ts-mode auto-fill chooses an incorrect prefix when >>> wrapping comments. >>>=20 >>> 1) emacs -Q >>>=20 >>> 2) In the scratch buffer: >>> a) M-x js-ts-mode >>> b) M-x auto-fill-mode >>> c) M-x erase-buffer >>> 3) Paste in a long JS comment: >>>=20 >>> // This buffer is for text that is not saved, and for Lisp = evaluation. To create a file, visit it >>>=20 >>> 4) At end of line, press . >>>=20 >>> The text wraps like so: >>>=20 >>> // This buffer is for text that is not saved, and for Lisp = evaluation. >>> // To create a file, visit it >>>=20 >>> In previous versions, it would wrap like so: >>>=20 >>> // This buffer is for text that is not saved, and for Lisp = evaluation. >>> // To create a file, visit it >> Adding people who know about js-ts-mode, in the hope they will have >> comments or suggestions. >=20 > I suppose the answer is somewhere around the fact that we have both = normal-auto-fill-function and fill-paragraph-function, and that = js-ts-mode (through c-ts-common-comment-setup) only configures the = latter, while js-mode (in js--mode-setup) has settings for both. >=20 > Not sure why the default do-auto-fill doesn't skip over the space, = though. Ok, so the actually difference is in comment-line-break-function, which = auto-fill-mode uses to insert line break. In js-mode, it=E2=80=99s set = to c-indent-new-comment-line, which deletes the whitespace; in = tree-sitter mode, it=E2=80=99s c-ts-common-comment-indent-new-line, = which doesn=E2=80=99t. I fixed c-ts-common-comment-indent-new-line to do = the same thing as c-indent-new-comment-line. However, I did the foolish thing of pushing to master. Should I cherry = pick the commit into emacs-30? Would that create any merge conflict down = the line? Yuan=