From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#41793: `comment-only-p' erroneously flags blank lines as comments Date: Mon, 9 May 2022 15:07:10 +0000 Message-ID: References: <20200610175331.GA23889@bb84> <20200610185251.GA25375@bb84> <871re54mmc.fsf@gnus.org> <87sfpj7yaj.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10011"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "41793@debbugs.gnu.org" <41793@debbugs.gnu.org> To: Lars Ingebrigtsen , Toby Cubitt Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 09 17:20:28 2022 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 1no5BT-0002Sp-2H for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 09 May 2022 17:20:27 +0200 Original-Received: from localhost ([::1]:34628 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1no5BS-0004iA-6k for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 09 May 2022 11:20:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36014) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1no4zT-0008Rc-U6 for bug-gnu-emacs@gnu.org; Mon, 09 May 2022 11:08:09 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37066) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1no4zS-0003RR-4G for bug-gnu-emacs@gnu.org; Mon, 09 May 2022 11:08:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1no4zR-0005cl-Vw for bug-gnu-emacs@gnu.org; Mon, 09 May 2022 11:08:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 May 2022 15:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41793 X-GNU-PR-Package: emacs Original-Received: via spool by 41793-submit@debbugs.gnu.org id=B41793.165210884321570 (code B ref 41793); Mon, 09 May 2022 15:08:01 +0000 Original-Received: (at 41793) by debbugs.gnu.org; 9 May 2022 15:07:23 +0000 Original-Received: from localhost ([127.0.0.1]:59196 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1no4ym-0005bn-0I for submit@debbugs.gnu.org; Mon, 09 May 2022 11:07:23 -0400 Original-Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:54290) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1no4yi-0005bc-Ir for 41793@debbugs.gnu.org; Mon, 09 May 2022 11:07:18 -0400 Original-Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 249EpTCr023549; Mon, 9 May 2022 15:07:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2021-07-09; bh=xVqqr3VO8MpdZCm90+xJmgxEC5RwoI9zWCEDCu3Lu0I=; b=x2Z3U8a6TeNPz0RKBhYFJZo6bojcy9UpsUplSjCR3ILsefEUiy2Bt4eD64dmGV+OapWu qoh+0XnO2xBgiGwuW8ig9KfXEodOzIT6OZG/kr+5FfRR5qfPisfiz8OXIdgHYfH1oFFz YUwuyKe6J8OwEhkMtpAiMtNt8rXPffoD6z0oZlsYh13vTCDrMaPb6uICa+IhSTEx57y+ kefaadviUYJrvz/AyGdQZyohwKGNFE2aRaJfBQFnbUDJRXRpOwoEt00uFKMl5FAv653h PCqhhTb9F6YYloIY0PzzsO678XuCbIUlm27Ylvrv3TrydgoK6PUb0BBU40PDNn+AzOpD sQ== Original-Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3fwgcsm06u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 09 May 2022 15:07:14 +0000 Original-Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 249F5GTY029032; Mon, 9 May 2022 15:07:13 GMT Original-Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2175.outbound.protection.outlook.com [104.47.58.175]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3fwf713cy6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 09 May 2022 15:07:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B3q1OWDYr8cTRaSGiWTbMnqMFn8JOF+Hp9mLhgcQcL9yMigVnt97N6yVHKjfYWQXA/Z58GwXVeadSNewwaKdE3PuD2Qhf5H94hu0XYbHYoryaZqOc8TYMHo8Q1G4Ki4bLv5OuI9krzAth19XAIpo+Cec14yLZWLJaeWmWgIdw4a1mYs03DfRfPmPyCYNklSq4p6HwyKTbRG7OLg4zVYXDGtNqSwznkyAw14mLYIMxSDfQFX2RhyouErNN59hZvu8IphMml5n/HGXst5pJR8Ch9fCF8KTN4v6KPfGCmcv0WrbrOZQXsxZdFwiVE1rCRbcrvNpeilizp0mLbiy9DsMZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=xVqqr3VO8MpdZCm90+xJmgxEC5RwoI9zWCEDCu3Lu0I=; b=lxayUhl1p1fpHPgwkmM+TJN1AD1l/4Q0SPeOhdMnzF889VlNA6LPksUby8ED1XGgG1lAB9Zc6uBFbc3/H6t5Q2VKOYXcNZF8AyErvxGKCnY0rshPsYyENtt7evSI0uXn03Ynyhxr1Fec1McBj5U8ZkBy+aa71Rk3/AVLyPR/caReb9kPMFDRVzRhIilz/paqkq4Rgn1i/NuRG9DjHFgS9+zDLQqwbK8fGRWkpyDwGooia8rGxPH4DG4y6fCLTUyAfr4NEQElbS73OnGw+Z6bQBDWKJe6D0DNfIZIGyG8n1bs++UW7TlzjJr1N3IV8BQ92qP/dhl+5kd8KHV4B3Xi9w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xVqqr3VO8MpdZCm90+xJmgxEC5RwoI9zWCEDCu3Lu0I=; b=PDbQRdERml7o6r3NaOXAgtz/BxXmQVvCp8gkZGqqpAT/uNiKtEz0dQ9iOzOUQLgcV9a22iEvw1nvvYUz/CKzkUs64Ciks/YF4tzsiiow9UaY0gltzU8OyCpWBSTf1y96sbCbwVfWZYx4shv969cowGel7LWBjlYLLnOQZg2NSk0= Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by MW5PR10MB5692.namprd10.prod.outlook.com (2603:10b6:303:1a3::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.20; Mon, 9 May 2022 15:07:11 +0000 Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::a0e7:5f38:ab50:5123]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::a0e7:5f38:ab50:5123%9]) with mapi id 15.20.5227.023; Mon, 9 May 2022 15:07:11 +0000 Thread-Topic: [External] : bug#41793: `comment-only-p' erroneously flags blank lines as comments Thread-Index: AQHYY5hV7TYdHW1oy0CaCenbPER4aa0WnQjw In-Reply-To: <87sfpj7yaj.fsf@gnus.org> Accept-Language: en-US Content-Language: en-US x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 151d0085-590f-44de-be5a-08da31cd97b6 x-ms-traffictypediagnostic: MW5PR10MB5692:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: vIhDITFzAxB2pw6PCkHlScPWrCth26q/siCDsPwCmmg7lp8vjCXgq12WM8WfqKWIGEFbXaT1SWEJF8FXheesddrDyZ1nUt8wmG3OHLG4fuH3Lmy+II1f26SH8STi0dy6/H3xE7W2QMeX9qfx71ifoLb97UVU4dvH/uC8Ip53AR/LiKSF3Q2mb0FRIWThSMmljj2Kf+vjORMl9nw0qeKrxFQwURPHpebq5z3oz3G5esMocnyHWzmYnCZnByvkq+Q8ZFX1XRnQ4ZcY8lb+/8MIQy8vo8LX3wyZy+EMKy9FRVjK1SM4LsoCJnkZrnaRPdp09+IrcNm1I46QZVC+ekkk552T61zSZ/su4ND0bvAA6CdkFzhl9nSkwNrltT2WY+zL4BZ3WxrdgsJ6jxzcUEXnUh8YAtasT2SnC+/wxVInxWJOW7wTu4i2ETJCh8OOoC0IhpesZ4CNgYDQ7YWA/OI9wdKSZjhesVVYJL3hdeQ4Bh8zU+US2VPTaRQqbF2dntbNq8Ckq9tWRpedmsO9cC6V38a/zHEH/858jteoAGpH27SWpHmh1j5UsFxFfhjyUj+CP4aE0nvesPyb0Og1JXkPU5e0y9bYwserCtWPImU5hsd/2eeEorjA/7+azyrt2r9D4mHAeEPrSQiT6YtBR3b/nhTjFFS85a+nt6SjjomHhULTAxmf9mDV3ADesXeXkN8Vw25RwwNWgtVEP+FA532cuEQIFO9pcEZbMWJQNdHa3v0= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(71200400001)(186003)(86362001)(66946007)(83380400001)(8936002)(5660300002)(122000001)(38100700002)(2906002)(52536014)(8676002)(4326008)(33656002)(110136005)(76116006)(508600001)(66556008)(55016003)(38070700005)(64756008)(316002)(7696005)(66446008)(66476007)(44832011)(26005)(6506007)(9686003)(81973001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: YVDCvXtLW7u6/fkv0ivMPgMNe+s/1nUNtnzAlb1N5CZhXof4z7yPJjXC7lQFMunssrZDdLiAMYHHmYiMW73JvJsjF8rJEkb6giYEVOmSe5/p2njrkuSVryuuSuzvz0V7sGzO20Brr9FkVvToz62LSolOT3pnOB36bdFivbPoiFK4B5XY8hBly3flqzKvZb89WaS2FpFSRe14Tn8hDwaaswVlazYsTDYDI0gTLHPdO3ks5ty4P5HE2Ia58DuLtPbHdipnF75ES6zM/JRyZDFwOBsRaMvxhUat/Raf0y65OEKPVY7PWT75zmB0XvZbDFCofp+OkIfTmUWgEJniSqn0VCTwMwFlIfasj2i+TFIIxORNpVVuFEmqALFcjZ02xQSZ3r5ROxoZzGSZ7U1HEYjULUpcrS/ItoOSJI7lUBBmoFwbhNRNjnick4VBAtJURXavOye/2DkSL4tp0ZPLfGEgUus74L53EPJoUezv0TFn6aUnlwozJ5JRpFfzH8qd3hRe98mjbI7N36zK0+q43Upa5LqkzBxCUJ+ostlqRuRuGoJhdQjFXx9OY3a9jB1xHLLTX/+CpdVvXPsnr1mq7sBG7QmySAqW6SRdLGEIwVOdcJIxDFCgEhHMTJ4gVR56qQYxdY/sL/c8hxC5A7b2BoctxBXbj3djo/nlAlYrLk40qyrTDhL325B+QtHMdWfpJk2qD0CRzCP0o1WROkPDTmO1uYAcY/k7Ca2CR4tBNB7ljVivHlt6Y0kU1Z7P+V xa3JenR3eJTgLHeKYIAlHJuATac5KtImJZjf4BRk71tBr8z8fLCjm2c5zWAhgbXLl6y2zGZH53H5ew255MuE5RVSEOvFSSDmnv X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 151d0085-590f-44de-be5a-08da31cd97b6 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 May 2022 15:07:10.9582 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: mIVuEwZ/uvYW8SHmn84+no9XhHsuWlRH1nHN6PU8KEjn7eu7XJy95kNWjBjN+8RYJSspPuABpwsKwqbzhwVprA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW5PR10MB5692 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.486, 18.0.858 definitions=2022-05-09_04:2022-05-09, 2022-05-09 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 malwarescore=0 mlxscore=0 mlxlogscore=802 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2205090086 X-Proofpoint-GUID: 9xRNy9EpjhjmJkCbcgST_2z_EniTSH-z X-Proofpoint-ORIG-GUID: 9xRNy9EpjhjmJkCbcgST_2z_EniTSH-z 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" Xref: news.gmane.io gmane.emacs.bugs:231758 Archived-At: > Anyway, I think it's ambiguous whether whitespace only=20 > should be a comment or not. The current algo considers > this to be one comment: >=20 > ;; foo >=20 > ;; bar >=20 > And I think that's correct. If we consider whitespace lines to not be > comments, this would change how our comment navigation commands work. We do NOT consider that to be the case. Never have. > So there's some DWIM in this area, but I think how it currently works > is basically the way we want it to work, so I'm closing this bug report. Those are two separate comments. The line between them is NOT commented out. A comment is delimited by `comment-start' and `comment-end'. (And `comment-(start|end)-skip' and `comment-end-can-be-escaped', if you like.) Comments that have "" as `comment-end' "are terminated by end-of-line" (to quote the doc string). The doc is quite clear about all of this, IMO - in doc strings, in the Emacs manual, and in the Elisp manual. A Lisp comment "continues to the end of the line" - no further. ((elisp) `Comments'.) Beyond the doc, this is fundamental to Elisp behavior. Try `(forward-comment 1) on your test case, for example. Code depends on `forward-comment' and the like, including thingatpt.el code. ___ Whether `comment-only-p' should or should not report `t' here is a different question from what I addressed above. That depends on what the intention of `comment-only-p is. I suggest you find out what that function was intended for, and what existing code might depend on its current behavior. But one thing is certain: what you said about the example you show being a single comment is 100% wrong. It is two comments. The same thing is true for this example, BTW: ;; foo ;; bar Those are two comments. It's possible, maybe even likely, that the intention of `comment-only-p' is to return non-nil when one comment is immediately followed by another. Or maybe even when one is followed by whitespace and then by another. TBD. But those are two separate comments, each delimited by the first `;' on each line and the first end-of-line that follows that first `;'.