Received: (at 66670) by debbugs.gnu.org; 13 Feb 2025 12:16:18 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 13 07:16:17 2025 Received: from localhost ([127.0.0.1]:41172 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tiY8f-0003qP-Ko for submit <at> debbugs.gnu.org; Thu, 13 Feb 2025 07:16:17 -0500 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:36637) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <sbaugh@HIDDEN>) id 1tiY8d-0003qC-Uy for 66670 <at> debbugs.gnu.org; Thu, 13 Feb 2025 07:16:16 -0500 Received: from mail-ej1-f72.google.com ([209.85.218.72]) by mxgoog2.mail.janestreet.com with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) (Exim 4.98) id 1tiY8Y-0000000ArAu-11Xh for 66670 <at> debbugs.gnu.org; Thu, 13 Feb 2025 07:16:10 -0500 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-aba566041a1so50151266b.1 for <66670 <at> debbugs.gnu.org>; Thu, 13 Feb 2025 04:16:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; t=1739448969; x=1740053769; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=VS0i5fXbTZxQGIZScLZE+ULDoKL6wqRj6McejZprVDM=; b=BNWJSFUlE59BNIarN5sSFJWnyup6zDsxIB+K4ZiyjXScoTVzjF/mB9N4aedsHMQBzY +OC/+5KtTPOyx+tPg57YVxPOCdCBQ0ZyKqxAgNVv6oygkOmieLVppdL0bdxLPq+5JQqY LZ+jLXF4jRi4ouZV97VQVesJlwuxuDs1144ec= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1739448970; bh=VS0i5fXbTZxQGIZScLZE+ULDoKL6wqRj6McejZprVDM=; h=References:In-Reply-To:From:Date:Subject:To:Cc; b=xRx7YSAbTl7ums0KorbxC+BjgKthZBv/zratr2uFIZ41SiC3vMSo/xrSAoU0uBq6P qFf3z305Brv4OqfgmUtiFjC1kEWsyOdKSqdJhErf57Hx6JazBkpLBvUR0CwrM4OSvf p17JEEG7c/R6N7iNCxybvzOvuxtruK7J4FkueJ2jKNg5kJbdkt4SZP7ygQSLr3ugug W2Jd9g+h06o21E4751G6hjfC/2N3rfOu5l+G/Ui0GK0uiYi7vYBk1WKTbRuU95+L76 vIgGyFwwvFfe2aeBk0WZcbLQBTt94bpvW5RyZmy0TQvW2RU1H6PbAWoYyQqqN7WcT+ oUKEW8d0YuEzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739448969; x=1740053769; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=VS0i5fXbTZxQGIZScLZE+ULDoKL6wqRj6McejZprVDM=; b=vX1IqqYA9yzGesxP/kXkge3FI/CraI4RSkbFVIArRUuaunRADGipEX7/cFzWdKnCFf +1phkusUJBSHzhuXK9O+q8dCNrp2jgwEZqVrDM+wjtaQ9ZxHyKo+XHZ48PhqANcPTHcz a9DOp+4ZCQeeNxBYMSw0YY42ymUTu0r9G91CCUHCHMY4QiSRhoHW6da01i7zxrJZ6nS7 886w30SNwXzT2GmNPfEogBZjxUie5hhSBnDz7Z1u4gpsrZ8G9BddFxNFvHqLizgo9qwp 2Ljt05pJwDvajDJcCOI7A4L8on7FX3AcxHmCvb4G+X5bl1haVuDPNTqfxQgmhcUxoXl8 2jEA== X-Forwarded-Encrypted: i=1; AJvYcCV4kqkYXzRgX4aRVxpCUNV3FFxtKR+sjZrgrjEKBECwxcKlElIt1OHU18P8/d90wcasZsJvrg==@debbugs.gnu.org X-Gm-Message-State: AOJu0YxG2nj0xRKIz2Pjh1KZHxzSTJSA8YFv9PgFVmFhu8e8BE0dqqay FuayQ7K9RKDk09n0wCoN7vMogqiQ5lbdD1Bw4kQHU4PspaxvccTuBZDTuW40dEXRYlTq0Lkfpph PIsgZm6FinGjcdUsPTw4Mureiod8RyW0cSn4o/k6SGJsE/M8VW2ZTRB+0C5R7JVUwHeGvu5Abtb 3ambXbtLNzO/g0DF/XWyv5+fr32NeNGqIeyQ== X-Gm-Gg: ASbGncuGjrYBHIVhX7XCzpRiF6njO3/J8tJZKpfBzndRixN39QpnbwCtwAGxRpgRvZX 9K80qdEBNmZWK4RDWh/MY6JJ80QsraWSy2OV8emHGG/T7dzPh7b67/TxsuKho5qw= X-Received: by 2002:a17:906:7056:b0:ab7:d802:ed18 with SMTP id a640c23a62f3a-aba5111bff3mr193620166b.0.1739448969334; Thu, 13 Feb 2025 04:16:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IEMvZjGvC0DWKifksle0JKKbCuSpPgkzz7qrcw1FuOUfmM6dwFHZvOFNoj1NxjjShA2eIWXcItKwjPFhiMBMtI= X-Received: by 2002:a17:906:7056:b0:ab7:d802:ed18 with SMTP id a640c23a62f3a-aba5111bff3mr193617866b.0.1739448968976; Thu, 13 Feb 2025 04:16:08 -0800 (PST) MIME-Version: 1.0 References: <ierfs23g2lx.fsf@HIDDEN> <jwvttqj3c8y.fsf-monnier+emacs@HIDDEN> <ier4jijfwqr.fsf@HIDDEN> <jwvil6z2tbp.fsf-monnier+emacs@HIDDEN> <CADwFkm=qNVOU5ZmyUJLpxX3WjOCSdtQ3+2fuDQ=S_SEWKLkV2A@HIDDEN> In-Reply-To: <CADwFkm=qNVOU5ZmyUJLpxX3WjOCSdtQ3+2fuDQ=S_SEWKLkV2A@HIDDEN> From: Spencer Baugh <sbaugh@HIDDEN> Date: Thu, 13 Feb 2025 07:15:58 -0500 X-Gm-Features: AWEUYZmMQG0cPoM6r4eaM1KDC2ocq3Rx6X54Be9W-DlBVAWBrN1NAOwdC4rI2e0 Message-ID: <CAO=BR8MAgadoP9Ydsc_Z6i0beGre=Qfc9JVoSc2w24Zf8P=eYQ@HIDDEN> Subject: Re: bug#66670: [PATCH] Use buffer-local comment-continue in comment-indent-new-line To: Stefan Kangas <stefankangas@HIDDEN> Content-Type: multipart/alternative; boundary="000000000000e6bb10062e05053f" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66670 Cc: 66670 <at> debbugs.gnu.org, Stefan Monnier <monnier@HIDDEN>, monnier@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) --000000000000e6bb10062e05053f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Feb 13, 2025, 2:09=E2=80=AFAM Stefan Kangas <stefankangas@HIDDEN= > wrote: > Spencer, what is the latest here? Did you make any progress with this > patch? > No further progress, it seems hard. Feel free to close this bug if appropriate. > --000000000000e6bb10062e05053f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"auto"><div><br><br><div class=3D"gmail_quote gmail_quote_contai= ner"><div dir=3D"ltr" class=3D"gmail_attr">On Thu, Feb 13, 2025, 2:09=E2=80= =AFAM Stefan Kangas <<a href=3D"mailto:stefankangas@HIDDEN">stefankan= gas@HIDDEN</a>> wrote:<br></div><blockquote class=3D"gmail_quote" sty= le=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Spence= r, what is the latest here?=C2=A0 Did you make any progress with this<br> patch?<br></blockquote></div></div><div dir=3D"auto"><br></div><div dir=3D"= auto">No further progress, it seems hard.=C2=A0 Feel free to close this bug= if appropriate.</div><div dir=3D"auto"><div class=3D"gmail_quote gmail_quo= te_container"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;= border-left:1px #ccc solid;padding-left:1ex"> </blockquote></div></div></div> --000000000000e6bb10062e05053f--
bug-gnu-emacs@HIDDEN
:bug#66670
; Package emacs
.
Full text available.Received: (at 66670) by debbugs.gnu.org; 13 Feb 2025 07:09:25 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 13 02:09:24 2025 Received: from localhost ([127.0.0.1]:39887 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tiTLg-0003dC-Gx for submit <at> debbugs.gnu.org; Thu, 13 Feb 2025 02:09:24 -0500 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]:55697) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>) id 1tiTLe-0003cv-47 for 66670 <at> debbugs.gnu.org; Thu, 13 Feb 2025 02:09:22 -0500 Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-5de3c29e9b3so811180a12.3 for <66670 <at> debbugs.gnu.org>; Wed, 12 Feb 2025 23:09:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739430556; x=1740035356; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=8VXvV8KKfchYNl7mqMtShy6msBrPXsAwQKBEivymU24=; b=lLtlPTsfYvoxfNznlA3F4YTVfNA7lOPHlGTFmkttVcRIbwzhCkLsqLu8geLXopN0k1 yvw5H6r+6Im3PYHabBekQB0fcQozYJJZ9h5e3k3zUaRVmSUpKbKsnFSA2kwDvWXPzfLN 9oNCsOLoF3UQoFfDXVc4768RcGjH7wrw7KKDpV/D3YD3KFMHEEXm6wBkQ34OPdEhYWcd KgxV9rBRSmkdztrg+CBLyGZhoTBNmAcPnwYc6Jx5ZVclnUDiGk27dO1jFctfdsOjZQcn jXUF2Niu0iPu7TqESvnuHb1HODmnA1ci9Ja5ESfnOo/rnvXqO6zNWnFOplN5gQqSieUz A0KA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739430556; x=1740035356; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=8VXvV8KKfchYNl7mqMtShy6msBrPXsAwQKBEivymU24=; b=WH7IJlSnumR0lHzHDMtw6qVYgjOC45xJobvbpkHNme+iZu+fRaDt68MFoUEo/j/78O 3rLodHQ84VGZDlzPS7dbI4Uxm5Ykx8q2Vf36myIxInO/Fd2yQ2ni1AsvfeldYmx0Oi/U OtRnCWuDlkQFTe58MUf5a5ih6mTiQKBD2N8n0nEtCqE4eJ5XZz0CE6verDDXkHra71cV wUMsSO7qYIGeAx/DOX1nMjvHyORWG2BmuaCneatqDSjGq1eHdOSjU312R6s5axas5z8/ +eGIY7oPYoeahHN71g5CcKj/eg8ruIAuWuBaYmwkldhxTHTvX53uFa26DkdkTfua64FS xdPw== X-Forwarded-Encrypted: i=1; AJvYcCUybW9HaRSW0+Nj63cYqcsmzZ5aYCUUTu1bQo5DSNiG9c+XG8pjOzgXZ+cqeu/90aSlJILKbw==@debbugs.gnu.org X-Gm-Message-State: AOJu0YyR4vzXHxMVF3s5xcjz/ULHR0wcNuUvkfCVMC7DUM0PqQLjm+4f +ja6Ffg7KJ71utossuvUK4Sp51YRJSqegA/71q2n2BuZZa7bVwcoVFf9YOz8V8eABTHZT4Dt0S1 O6E7pdjuXVK/iPk2sWj2m/qyLFVJLVGiqndFOdw== X-Gm-Gg: ASbGncvFQ0xSBzBrSP9dazqNINl6PWZvVQKRN9q6YrCdvl3xgeYzEjcKmg+itYZkKRZ zmpr6iAXZj254CDsyrNtB68FubkneL4pl+dgSJC5BI+9XLSKLR678aw8yqr2ufVjl1795mWydEl A= X-Google-Smtp-Source: AGHT+IEPZ05TfizyDJrUznc9+B4tkMysuQT9NnuEkbOsXHCkSpb2dylsfWWCqJ8OF2CbCB6a3UeEY3NtR/lzgSrglrI= X-Received: by 2002:a05:6402:3909:b0:5d0:81f3:18bc with SMTP id 4fb4d7f45d1cf-5dec9d66dbcmr1530575a12.1.1739430555594; Wed, 12 Feb 2025 23:09:15 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 12 Feb 2025 23:09:15 -0800 From: Stefan Kangas <stefankangas@HIDDEN> In-Reply-To: <jwvil6z2tbp.fsf-monnier+emacs@HIDDEN> References: <ierfs23g2lx.fsf@HIDDEN> <jwvttqj3c8y.fsf-monnier+emacs@HIDDEN> <ier4jijfwqr.fsf@HIDDEN> <jwvil6z2tbp.fsf-monnier+emacs@HIDDEN> MIME-Version: 1.0 Date: Wed, 12 Feb 2025 23:09:15 -0800 X-Gm-Features: AWEUYZkzh_8szS94suE55RUMnFbrqGbJ55kAXZdd6HZCHgOU5yNj1l8EuINpO_M Message-ID: <CADwFkm=qNVOU5ZmyUJLpxX3WjOCSdtQ3+2fuDQ=S_SEWKLkV2A@HIDDEN> Subject: Re: bug#66670: [PATCH] Use buffer-local comment-continue in comment-indent-new-line To: Stefan Monnier <monnier@HIDDEN> Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66670 Cc: Spencer Baugh <sbaugh@HIDDEN>, 66670 <at> debbugs.gnu.org, monnier@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Stefan Monnier <monnier@HIDDEN> writes: >>>> ;; 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 :-( Spencer, what is the latest here? Did you make any progress with this patch?
bug-gnu-emacs@HIDDEN
:bug#66670
; Package emacs
.
Full text available.Received: (at 66670) by debbugs.gnu.org; 22 Oct 2023 04:11:48 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 22 00:11:48 2023 Received: from localhost ([127.0.0.1]:45305 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1quPoZ-0006am-NY for submit <at> debbugs.gnu.org; Sun, 22 Oct 2023 00:11:48 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:52754) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <monnier@HIDDEN>) id 1quPoS-0006aR-Dv for 66670 <at> debbugs.gnu.org; Sun, 22 Oct 2023 00:11:45 -0400 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== 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) 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) From: Stefan Monnier <monnier@HIDDEN> To: Spencer Baugh <sbaugh@HIDDEN> Subject: Re: bug#66670: [PATCH] Use buffer-local comment-continue in comment-indent-new-line In-Reply-To: <ier4jijfwqr.fsf@HIDDEN> (Spencer Baugh's message of "Sat, 21 Oct 2023 18:15:24 -0400") Message-ID: <jwvil6z2tbp.fsf-monnier+emacs@HIDDEN> References: <ierfs23g2lx.fsf@HIDDEN> <jwvttqj3c8y.fsf-monnier+emacs@HIDDEN> <ier4jijfwqr.fsf@HIDDEN> Date: Sun, 22 Oct 2023 00:11:03 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.152 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66670 Cc: 66670 <at> debbugs.gnu.org, monnier@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) >>> ;; 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
bug-gnu-emacs@HIDDEN
:bug#66670
; Package emacs
.
Full text available.Received: (at 66670) by debbugs.gnu.org; 21 Oct 2023 22:16:07 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 21 18:16:07 2023 Received: from localhost ([127.0.0.1]:45207 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1quKGJ-0000wI-Sa for submit <at> debbugs.gnu.org; Sat, 21 Oct 2023 18:16:07 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:42129) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <sbaugh@HIDDEN>) id 1quKGE-0000vX-BO for 66670 <at> debbugs.gnu.org; Sat, 21 Oct 2023 18:16:02 -0400 From: Spencer Baugh <sbaugh@HIDDEN> To: Stefan Monnier <monnier@HIDDEN> Subject: Re: bug#66670: [PATCH] Use buffer-local comment-continue in comment-indent-new-line In-Reply-To: <jwvttqj3c8y.fsf-monnier+emacs@HIDDEN> (Stefan Monnier's message of "Sat, 21 Oct 2023 17:23:35 -0400") References: <ierfs23g2lx.fsf@HIDDEN> <jwvttqj3c8y.fsf-monnier+emacs@HIDDEN> Date: Sat, 21 Oct 2023 18:15:24 -0400 Message-ID: <ier4jijfwqr.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66670 Cc: 66670 <at> debbugs.gnu.org, monnier@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Stefan Monnier <monnier@HIDDEN> writes: >> ;; 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. 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, which is the comment prefix from the previous line? So we therefore copy the prefix from the previous line? Should we just recalculate comment-continue directly in comment-indent-new-line instead, if necessary? Although even if we did that, I don't see any clear way to know that we should use the configured comment-continue instead of trying to copy the previous line. Should we maybe just not copy the comment prefix from the previous line at all, if comment-continue is non-nil? >> +(ert-deftest local-comment-continue-in-comment-indent-new-line () >> + (with-temp-buffer >> + (setq-local comment-start "/* ") >> + (setq-local comment-end "*/") > ^^ > Out of symmetry, I'd have expected a SPC here. > >> + (insert "foo") >> + (newline) >> + (insert "bar") >> + (forward-line -1) >> + (end-of-line) >> + (comment-region (point-min) (point-max)) >> + (should (equal (thing-at-point 'line) "/* foo\n")) >> + (comment-indent-new-line) > > You should also test it with that very same comment but when > `comment-start` and `comment-end` have been set to something like > "// " and "". Will do.
bug-gnu-emacs@HIDDEN
:bug#66670
; Package emacs
.
Full text available.Received: (at submit) by debbugs.gnu.org; 21 Oct 2023 21:24:30 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 21 17:24:30 2023 Received: from localhost ([127.0.0.1]:45175 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1quJSQ-0007hT-8W for submit <at> debbugs.gnu.org; Sat, 21 Oct 2023 17:24:30 -0400 Received: from lists.gnu.org ([2001:470:142::17]:34828) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <monnier@HIDDEN>) id 1quJSN-0007hC-TE for submit <at> debbugs.gnu.org; Sat, 21 Oct 2023 17:24:29 -0400 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 <monnier@HIDDEN>) id 1quJRq-0001HI-8b for bug-gnu-emacs@HIDDEN; Sat, 21 Oct 2023 17:23:54 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <monnier@HIDDEN>) id 1quJRl-0006ai-Rq; Sat, 21 Oct 2023 17:23:53 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id ECC74100126; Sat, 21 Oct 2023 17:23:46 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1697923421; bh=kGMnFfyLf3GjLeE1RVEgaSG2qVs+AiwvPtH/JbyuXYU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=oxT5YGf4rzSFycbfiJUVFyTBjkUn8jtfBEXUdnUpt22zQApKJ7EHJKC7I4WV1T0Ld JD+SrXKPmpflWnQd4KCyx51uGxtH0vS8LCVNktD7o6NSiPHjj2FX3ryaRJCZ9AB69V LXn0tn6T88sqfVmYDP9vekwfUQE7ngnLRzbzed+4lp/ZXsjQZJUpBZF10qwb4SXIrI ZRbjR14bWVqTsugIYptMDzl0+Ac75W/KRnfxJlOUNAUDESvF3uUjapmGt5TRoXgAfN pT74aVzzMd4FAVZhpsm35pUzqIi32ZZpP+E+56Utj1Z24x5/BbXeXPwogDqE6uDEqN FsE7iq2hTb7Ug== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id AD11A10006B; Sat, 21 Oct 2023 17:23:41 -0400 (EDT) Received: from pastel (unknown [45.72.216.111]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 82A0412036E; Sat, 21 Oct 2023 17:23:41 -0400 (EDT) From: Stefan Monnier <monnier@HIDDEN> To: Spencer Baugh <sbaugh@HIDDEN> Subject: Re: [PATCH] Use buffer-local comment-continue in comment-indent-new-line In-Reply-To: <ierfs23g2lx.fsf@HIDDEN> (Spencer Baugh's message of "Sat, 21 Oct 2023 16:08:42 -0400") Message-ID: <jwvttqj3c8y.fsf-monnier+emacs@HIDDEN> References: <ierfs23g2lx.fsf@HIDDEN> Date: Sat, 21 Oct 2023 17:23:35 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.152 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@HIDDEN; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: submit Cc: bug-gnu-emacs@HIDDEN, Stefan Monnier <monnier@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) > ;; 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`. > +(ert-deftest local-comment-continue-in-comment-indent-new-line () > + (with-temp-buffer > + (setq-local comment-start "/* ") > + (setq-local comment-end "*/") ^^ Out of symmetry, I'd have expected a SPC here. > + (insert "foo") > + (newline) > + (insert "bar") > + (forward-line -1) > + (end-of-line) > + (comment-region (point-min) (point-max)) > + (should (equal (thing-at-point 'line) "/* foo\n")) > + (comment-indent-new-line) You should also test it with that very same comment but when `comment-start` and `comment-end` have been set to something like "// " and "". Stefan
bug-gnu-emacs@HIDDEN
:bug#66670
; Package emacs
.
Full text available.Received: (at submit) by debbugs.gnu.org; 21 Oct 2023 20:09:29 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 21 16:09:29 2023 Received: from localhost ([127.0.0.1]:45132 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1quIHl-0005MW-7u for submit <at> debbugs.gnu.org; Sat, 21 Oct 2023 16:09:29 -0400 Received: from lists.gnu.org ([2001:470:142::17]:48218) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <sbaugh@HIDDEN>) id 1quIHf-0005KS-4P for submit <at> debbugs.gnu.org; Sat, 21 Oct 2023 16:09:23 -0400 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 <sbaugh@HIDDEN>) id 1quIH7-00019u-KW for bug-gnu-emacs@HIDDEN; Sat, 21 Oct 2023 16:08:45 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <sbaugh@HIDDEN>) id 1quIH5-0007Ts-W4 for bug-gnu-emacs@HIDDEN; Sat, 21 Oct 2023 16:08:45 -0400 From: Spencer Baugh <sbaugh@HIDDEN> To: bug-gnu-emacs@HIDDEN Subject: [PATCH] Use buffer-local comment-continue in comment-indent-new-line Date: Sat, 21 Oct 2023 16:08:42 -0400 Message-ID: <ierfs23g2lx.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=64.215.233.18; envelope-from=sbaugh@HIDDEN; helo=mxout5.mail.janestreet.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, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit Cc: Stefan Monnier <monnier@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.1 (/) --=-=-= Content-Type: text/plain Tags: patch This fixes a remaining issue with whitespace values of comment-continue, as described in https://github.com/ocaml/tuareg/issues/216 Namely, the fixes done so far don't cover comment-indent-new-line. In GNU Emacs 29.1.50 (build 12, x86_64-pc-linux-gnu, X toolkit, cairo version 1.15.12, Xaw scroll bars) of 2023-10-19 built on igm-qws-u22796a Repository revision: 9163e634e296435aa7a78bc6b77b4ee90666d2ac Repository branch: emacs-29 Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 System Description: Rocky Linux 8.8 (Green Obsidian) Configured using: 'configure --config-cache --with-x-toolkit=lucid --with-gif=ifavailable' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Use-buffer-local-comment-continue-in-comment-indent-.patch From 9fab95f193eb7da9e6787122b885d1de29b5b657 Mon Sep 17 00:00:00 2001 From: Spencer Baugh <sbaugh@HIDDEN> Date: Sat, 21 Oct 2023 16:05:05 -0400 Subject: [PATCH] Use buffer-local comment-continue in comment-indent-new-line As the FIXME said, comment-indent-new-line was wiping out the value of comment-continue even if it had been set explicitly. Checking local-variable-p should be sufficient to fix this. This makes comment-indent-new-line work properly if comment-continue can't be recalculated from comment-start, such as if comment-continue is all whitespace. * lisp/newcomment.el (comment-indent-new-line): Don't set comment-continue to nil if it's local-variable-p. * test/lisp/newcomment-tests.el (local-comment-continue-in-comment-indent-new-line): Add a test. --- lisp/newcomment.el | 5 +++-- test/lisp/newcomment-tests.el | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/lisp/newcomment.el b/lisp/newcomment.el index 9ae7de70a0e..b217f700f22 100644 --- a/lisp/newcomment.el +++ b/lisp/newcomment.el @@ -1541,9 +1541,10 @@ comment-indent-new-line (cadr (assoc comment-style comment-styles)))) ;; 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))) (comment-indent continuep)) (save-excursion (let ((pt (point))) diff --git a/test/lisp/newcomment-tests.el b/test/lisp/newcomment-tests.el index cb0f304c463..9851b4c2c45 100644 --- a/test/lisp/newcomment-tests.el +++ b/test/lisp/newcomment-tests.el @@ -36,4 +36,21 @@ test-uncomment-space-comment-continue (uncomment-region (point-min) (point-max)) (buffer-string)))))) +(ert-deftest local-comment-continue-in-comment-indent-new-line () + (with-temp-buffer + (setq-local comment-start "/* ") + (setq-local comment-end "*/") + (insert "foo") + (newline) + (insert "bar") + (forward-line -1) + (end-of-line) + (comment-region (point-min) (point-max)) + (should (equal (thing-at-point 'line) "/* foo\n")) + (comment-indent-new-line) + (should (equal (thing-at-point 'line) " * \n")) + (setq-local comment-continue " ") + (comment-indent-new-line) + (should (equal (thing-at-point 'line) " \n")))) + ;;; newcomment-tests.el ends here -- 2.39.3 --=-=-=--
Spencer Baugh <sbaugh@HIDDEN>
:bug-gnu-emacs@HIDDEN
.
Full text available.bug-gnu-emacs@HIDDEN
:bug#66670
; Package emacs
.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.