From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#66670: [PATCH] Use buffer-local comment-continue in comment-indent-new-line Date: Sun, 22 Oct 2023 00:11:03 -0400 Message-ID: References: Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8349"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 66670@debbugs.gnu.org, monnier@gnu.org To: Spencer Baugh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 22 06:11:51 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 1quPoc-0001zg-Qh for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 22 Oct 2023 06:11:51 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1quPoO-0001oI-AN; Sun, 22 Oct 2023 00:11:36 -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 1quPoM-0001o3-Ql for bug-gnu-emacs@gnu.org; Sun, 22 Oct 2023 00:11:34 -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 1quPoM-0004Ja-IH for bug-gnu-emacs@gnu.org; Sun, 22 Oct 2023 00:11:34 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1quPoo-0006bE-5z for bug-gnu-emacs@gnu.org; Sun, 22 Oct 2023 00:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 22 Oct 2023 04:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66670 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 66670-submit@debbugs.gnu.org id=B66670.169794790825348 (code B ref 66670); Sun, 22 Oct 2023 04:12:02 +0000 Original-Received: (at 66670) by debbugs.gnu.org; 22 Oct 2023 04:11:48 +0000 Original-Received: from localhost ([127.0.0.1]:45305 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quPoZ-0006am-NY for submit@debbugs.gnu.org; Sun, 22 Oct 2023 00:11:48 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:52754) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quPoS-0006aR-Dv for 66670@debbugs.gnu.org; Sun, 22 Oct 2023 00:11:45 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id B18A9100169; Sun, 22 Oct 2023 00:11:06 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1697947865; bh=VqnT/Oj7I+IcV9Ey6sPJf30B8UMOdh+8kekXl/STKEc=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=N1X0IFfigSbFIl0n6IOB5P0ctpyT92xxpdlC+x26ZexU2tM9YOvYO+TnFGoUHZ1RL lVKFJ/cddCzjrojxEgIxUYcdocfxn5suQNLelystRi0jb1NmT23LZHyJyJyWdqIHZw N33608vVkTuKaeIT52xbtMVDkgFO8KDvOTNs3M49KnUniQ/FTHB9CR73QCxPp6kPMU PCtSuYc7AShNckYN/iyiq0sfaCN9fZ4TTqKyiOfQjW3j+pkeCopqkKHauR+dUkM6Lx 3oQc5XO0dmB+w2Xp+KWpDDOFL77a9Ow9bV7cRB1CtONbSHhMn2CcxMEh7qJN2eVuCS EkybLP/6f/xyA== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 6F1DA10006B; Sun, 22 Oct 2023 00:11:05 -0400 (EDT) Original-Received: from pastel (unknown [45.72.216.111]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 4202112016C; Sun, 22 Oct 2023 00:11:05 -0400 (EDT) In-Reply-To: (Spencer Baugh's message of "Sat, 21 Oct 2023 18:15:24 -0400") 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:272950 Archived-At: >>> ;; Recreate comment-continue from comment-start. >>> - ;; FIXME: wrong if comment-continue was set explicitly! >>> ;; FIXME: use prev line's continuation if available. >>> - (comment-continue nil)) >>> + (comment-continue (if (local-variable-p 'comment-continue) >>> + comment-continue >>> + nil))) >> >> Are you sure? `comment-continue` is very rarely set globally. >> Usually it's set buffer-locally by `comment-normalize-vars`. > > Or by the major-mode! But yes, I see your point, this patch is > effectively removing the (comment-continue nil) definition. Yup. > I guess that the (comment-continue nil) definition is there in the first > place so that comment-normalize-vars recalculates it based on > comment-start, Indeed, that's what the comment tries to say. > which is the comment prefix from the previous line? Something like that, yes. > So we therefore copy the prefix from the previous line? Not necessarily. If the previous line was the beginning of the comment with "/*" we should use " *". > Should we just recalculate comment-continue directly in > comment-indent-new-line instead, if necessary? We could. But we still need to decide whether to do that or to just trust the `comment-continue` value set by those major modes which set it by hand :-( Stefan