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: Wed, 30 Oct 2024 22:38:00 -0700 Message-ID: References: <87ttd7o2q8.fsf@kleehammer.com> <867c9tak7q.fsf@gnu.org> <5F76FC01-BE2F-47CC-BA7A-4F77A2F4E41A@gmail.com> <8634kf6q3e.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="17979"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Dmitry Gutov , Michael Kleehammer , 73900@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 31 06:40:16 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 1t6Nuq-0004WR-4c for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 31 Oct 2024 06:40:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t6Nuj-00043p-MB; Thu, 31 Oct 2024 01:40:09 -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 1t6Nud-0003zm-GL for bug-gnu-emacs@gnu.org; Thu, 31 Oct 2024 01:40:05 -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 1t6Nub-0005j1-U5 for bug-gnu-emacs@gnu.org; Thu, 31 Oct 2024 01:40:03 -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=yRJhFUdz2y08PsOUjy08dC3Mx/rFQ/H27PSzbj+toGU=; b=F/+hzns/7QWoGrKSybkAko6IDq2ikm/EBjGYDcWCHx6Bk5iWwZWqPI+H1d4kE+MzjlHywxz1BmsRak1w2CCitdNG7tPd6e4x+sfK5JN9vtLXridue5TB/XGMbd02n9tKE848wPCrRTXo9eRcpeoY+LfmpDvtC3qtlC2nxpvaRxkXLgLssp6pBvhD5l24956N2bJcN2QJX94QUyMX7bfIa2G/us+Pn8M0eNdhd7TVLvZ33gnUM7XvzBPzugCS7h/l+xXXFr2k0/MrOlYL8uhr0GH1+U3iXXrzT1WLvHpn0C4nk1564kK7PAJo7chHIETl0thFW5j79wuj7YvrIfekOw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t6Nub-0001fq-Mu for bug-gnu-emacs@gnu.org; Thu, 31 Oct 2024 01:40: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: Thu, 31 Oct 2024 05:40: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.17303531606387 (code B ref 73900); Thu, 31 Oct 2024 05:40:01 +0000 Original-Received: (at 73900) by debbugs.gnu.org; 31 Oct 2024 05:39:20 +0000 Original-Received: from localhost ([127.0.0.1]:39950 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t6Ntv-0001ex-NI for submit@debbugs.gnu.org; Thu, 31 Oct 2024 01:39:20 -0400 Original-Received: from mail-oi1-f181.google.com ([209.85.167.181]:55772) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t6Ntt-0001en-R3 for 73900@debbugs.gnu.org; Thu, 31 Oct 2024 01:39:18 -0400 Original-Received: by mail-oi1-f181.google.com with SMTP id 5614622812f47-3e5f968230bso266310b6e.3 for <73900@debbugs.gnu.org>; Wed, 30 Oct 2024 22:39:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730353092; x=1730957892; 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=yRJhFUdz2y08PsOUjy08dC3Mx/rFQ/H27PSzbj+toGU=; b=BQlrlNTz05+qWrvR7m08on5sptL2u8YxOHDD0cIgzpq1LsCS47pSjiL1aAfZvXrLxO 9fGktrNcVLn+UgfF1IjneQ28cn7wLtGJQZ73i9HHdV7IOiuqCkHQKMykP18tjhvvNsVy 7OzzLx/mWWJqic2o+1AWbsUsHM0u/3MgUNQaMQ7O7vyGVrALRPeJEizX4wHj2QdNX3s2 BuH190Fnlu5DFTkzOfOCeMKEPKuDBQ+7UEpf+D0y4wYHMlI7UcUuYWJOJsRAJRzOyzGd rQ87fh6aGkxNt6Eg8d+fvw9+MeacHq6F0xIQfybsfMjoWxHndPN+QFfO2hZXoixIfFLo N08g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730353092; x=1730957892; 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=yRJhFUdz2y08PsOUjy08dC3Mx/rFQ/H27PSzbj+toGU=; b=SuQ1ceUw42YonH2weakOFcsUJrvwFmyxFR8XNrLDKiOS5qNf0QWE1YDboVft6hLQFw xKFuLBrpcCWOgKBOSput83aJXZnDPQk/fEYuqhD9p69A4JbIcAU9h9vNmX9Ccl08s+lW rHcfu1b2FWjV/TOX0lq1zbvq6dZzzueThtS6tZqe7VI3/94NlT1J0qAnhPPpm8FrPAZc eUJb2Ttqp8XeEqSYFa/fcQwQKOYPtPN7mtg/ZSkuMYEqVcZ373hTVjO155M2YQBy+pSO KvIOAFR64fCIOFhw8CbQcpyodyvEaiDmeL90piWSoPYTX8U88Sg2M6M6UDMkhMAVVnHk XbXw== X-Forwarded-Encrypted: i=1; AJvYcCW2tb0Dzp/rFKOQFL8zlTIiJH8wnsnUdSgOZr6wCwVMmW/w5uvfybxoGhMhWbfiJJ5kvBR+jg==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzkmL3jf0615Drtu7dwXB5yHnaiPkeSRsB8toGaeeV28UhFZfLy tmdBRU0tuIcGuaVWV0smcGlJ+zkfoY4vZd9aOgnKvjQRkYydEqx1 X-Google-Smtp-Source: AGHT+IHnmOixG4Uzbm9TERnvb8U7+sK+nXVfCfS8+k4AYlAADvY2VNfn9GkoTnDO/HowYPkRSCPP5Q== X-Received: by 2002:a05:6808:38c5:b0:3e3:ae35:f418 with SMTP id 5614622812f47-3e6384d7441mr19477723b6e.47.1730353092064; Wed, 30 Oct 2024 22:38:12 -0700 (PDT) Original-Received: from smtpclient.apple ([2601:646:8f81:6120:e48b:e566:9832:af15]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7ee45a0ec8bsm457160a12.79.2024.10.30.22.38.11 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Oct 2024 22:38:11 -0700 (PDT) In-Reply-To: <8634kf6q3e.fsf@gnu.org> 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:294593 Archived-At: > On Oct 29, 2024, at 5:39=E2=80=AFAM, Eli Zaretskii = wrote: >=20 >> From: Yuan Fu >> Date: Tue, 29 Oct 2024 00:33:05 -0700 >> Cc: Eli Zaretskii , >> Michael Kleehammer , >> 73900@debbugs.gnu.org >>=20 >>=20 >>=20 >>> 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. >>=20 >> 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. >>=20 >> However, I did the foolish thing of pushing to master. Should I = cherry pick the commit into emacs-30? >=20 > Yes, please. Just first fix the problem I reported a few minutes ago. >=20 >> Would that create any merge conflict down the line? >=20 > No. Ok, thanks. I fixed that problem and pushed both to emacs-30. Yuan=