From unknown Wed Jun 25 03:51:21 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#37099 <37099@debbugs.gnu.org> To: bug#37099 <37099@debbugs.gnu.org> Subject: Status: 26.2 Comment-dwim Reply-To: bug#37099 <37099@debbugs.gnu.org> Date: Wed, 25 Jun 2025 10:51:21 +0000 retitle 37099 26.2 Comment-dwim reassign 37099 emacs submitter 37099 Charles Jackson severity 37099 wishlist tag 37099 wontfix thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 20 11:40:08 2019 Received: (at submit) by debbugs.gnu.org; 20 Aug 2019 15:40:08 +0000 Received: from localhost ([127.0.0.1]:33606 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i06Ey-0000QJ-AZ for submit@debbugs.gnu.org; Tue, 20 Aug 2019 11:40:08 -0400 Received: from lists.gnu.org ([209.51.188.17]:36840) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i06Ew-0000QB-GM for submit@debbugs.gnu.org; Tue, 20 Aug 2019 11:40:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37084) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i06Ev-00032p-5y for bug-gnu-emacs@gnu.org; Tue, 20 Aug 2019 11:40:06 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_LOW, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i06Et-0001EA-RH for bug-gnu-emacs@gnu.org; Tue, 20 Aug 2019 11:40:04 -0400 Received: from mail-40130.protonmail.ch ([185.70.40.130]:31417) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i06Et-0001CN-Ay for bug-gnu-emacs@gnu.org; Tue, 20 Aug 2019 11:40:03 -0400 Date: Tue, 20 Aug 2019 15:39:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=default; t=1566315600; bh=yJojAKQTEXnJUAsSpp74K34CQNZjPZJybEbSEtFrPp4=; h=Date:To:From:Reply-To:Subject:Feedback-ID:From; b=Rnbx+Vqk9t56fr5XwIdh3Vlk/mRLFfuDIv2lIFhvPRHFAKnVYD/LER2RA5De8bNVT bDJF0XffoX8WIS7Hv2NRbtQfujQKHOnas2nRgURc9vcDjU1couQnT6Yyku8+NjrvJ8 nAu0rN2TfjgwL/yrzeudgfKIpnS9PhldZmBGzChs= To: "bug-gnu-emacs@gnu.org" From: Charles Jackson Subject: 26.2 Comment-dwim Message-ID: Feedback-ID: p83t8gvtwwvEnDE9c_Yw65bccluM3oRviDMKpc2tgQfCvUp_cnOnhI2azb4pGx1ROQUEh05HOUWLjr8vTaxtfg==:Ext:ProtonMail MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="b1_8acf6d1a11854fc65af8d18dff8f2605" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 185.70.40.130 X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Charles Jackson Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) This is a multi-part message in MIME format. --b1_8acf6d1a11854fc65af8d18dff8f2605 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 SSB3b3VsZCBsaWtlIHRoZSBjb21tZW50LWR3aW0gZnVuY3Rpb24gdG8gYmUgYWJsZSB0byBkaWZm ZXJlbnRpYXRlIGVuZC1vZi1saW5lIGNvbW1lbnRzIGZyb20gd2hvbGUtbGluZSBjb21tZW50cy4K Rm9yIGV4YW1wbGUgaW4gamF2YSBtb2RlIGl0IHdvdWxkIG1ha2Ugc2Vuc2UgZm9yIC8vIHRvIGJl IHRoZSBlbmQtb2YtbGluZSBjb21tZW50LCBidXQgaWYgcG9pbnQgaXMgb24gYW4gZW1wdHkgbGlu ZSB0aGVuIGNvbW1lbnQtZHdpbSB3b3VsZCBpbnNlcnQgLyogKi8gd2l0aCBwb2ludCBpbnNpZGUg dGhlIC8qICovIGxpa2Ugc286IC8qIHwgKi8gd2hlcmUgfCBpcyB0aGUgcG9pbnQgbG9jYXRpb24u --b1_8acf6d1a11854fc65af8d18dff8f2605 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: base64 PGRpdj5JIHdvdWxkIGxpa2UgdGhlIGNvbW1lbnQtZHdpbSBmdW5jdGlvbiB0byBiZSBhYmxlIHRv IGRpZmZlcmVudGlhdGUgZW5kLW9mLWxpbmUgY29tbWVudHMgZnJvbSB3aG9sZS1saW5lIGNvbW1l bnRzLjxicj48L2Rpdj48ZGl2PkZvciBleGFtcGxlIGluIGphdmEgbW9kZSBpdCB3b3VsZCBtYWtl IHNlbnNlIGZvciAvLyB0byBiZSB0aGUgZW5kLW9mLWxpbmUgY29tbWVudCwgYnV0IGlmIHBvaW50 IGlzIG9uIGFuIGVtcHR5IGxpbmUgdGhlbiBjb21tZW50LWR3aW0gd291bGQgaW5zZXJ0IC8qICov IHdpdGggcG9pbnQgaW5zaWRlIHRoZSAvKiAqLyBsaWtlIHNvOiAvKiB8ICovIHdoZXJlIHwgaXMg dGhlIHBvaW50IGxvY2F0aW9uLiA8YnI+PC9kaXY+ --b1_8acf6d1a11854fc65af8d18dff8f2605-- From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 21 13:35:28 2019 Received: (at submit) by debbugs.gnu.org; 21 Aug 2019 17:35:28 +0000 Received: from localhost ([127.0.0.1]:36446 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i0UW8-0003N2-2O for submit@debbugs.gnu.org; Wed, 21 Aug 2019 13:35:28 -0400 Received: from lists.gnu.org ([209.51.188.17]:41012) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i0UW6-0003Mv-KE for submit@debbugs.gnu.org; Wed, 21 Aug 2019 13:35:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42488) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0UW4-0007QZ-Vl for bug-gnu-emacs@gnu.org; Wed, 21 Aug 2019 13:35:25 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_NONE, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0UW3-00067z-Q4 for bug-gnu-emacs@gnu.org; Wed, 21 Aug 2019 13:35:24 -0400 Received: from mod-relay-1.kamens.us ([198.58.96.67]:51166) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1i0UW3-00064a-LP for bug-gnu-emacs@gnu.org; Wed, 21 Aug 2019 13:35:23 -0400 Received: by mod-relay-1.kamens.us (Postfix) id F21765DC4F; Wed, 21 Aug 2019 17:35:21 +0000 (UTC) Delivered-To: gnu-emacs-bug@moderators.isc.org Received: from mail.muc.de (colin.muc.de [193.149.48.1]) by mod-relay-1.kamens.us (Postfix) with SMTP id 88F3B5DC29 for ; Wed, 21 Aug 2019 17:35:21 +0000 (UTC) Received: (qmail 38740 invoked by uid 8); 21 Aug 2019 16:42:35 -0000 To: gnu-emacs-bug@moderators.isc.org Path: not-for-mail From: Alan Mackenzie Newsgroups: gnu.emacs.bug Subject: Re: bug#37099: 26.2 Comment-dwim Date: Wed, 21 Aug 2019 16:42:35 -0000 (UTC) Organization: muc.de e.V. Message-ID: References: User-Agent: tin/2.4.2-20171224 ("Lochhead") (UNIX) (FreeBSD/11.2-RELEASE-p9 (amd64)) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 198.58.96.67 X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) Hello, Charles. Charles Jackson wrote: > [-- text/plain, encoding base64, charset: UTF-8, 8 lines --] > I would like the comment-dwim function to be able to differentiate > end-of-line comments from whole-line comments. OK. What should happen when a whole-line comment becomes and end-of-line comment (by inserting text before it), or vice versa? > For example in java mode it would make sense for // to be the > end-of-line comment, but if point is on an empty line then comment-dwim > would insert /* */ with point inside the /* */ like so: /* | */ where | > is the point location. Why would this make sense? For example, how big is the community of users who would want such a facility. A general solution to this wish would be surprisingly difficult and time-consuming to write. The Emacs source file, newcomment.el (which contains the command comment-dwim) contains no representation of different pairs of comment delimiters, and this would have to be added. It is CC Mode here which maintains the two different pairs of comment delimiters, /* .... */ and // .... \n. In a CC Mode mode (such as Java Mode) you can manually switch between the delimiter pairs with C-c C-k, c-toggle-comment-style. It would be relatively easy to add Lisp "advice" to the function comment-dwim just for Java Mode, which would use c-toggle-comment-style to set the comment delimiters after having determined the required pair of comment delimiters. Again, how useful a facility would this really be? Useful enough to justify the time and effort to write a full solution, or rather a localised need which would best be satisfied with a careful hack (such as outlined above)? -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 30 02:40:50 2021 Received: (at 37099) by debbugs.gnu.org; 30 Jan 2021 07:40:50 +0000 Received: from localhost ([127.0.0.1]:53550 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l5ksE-0003K0-06 for submit@debbugs.gnu.org; Sat, 30 Jan 2021 02:40:50 -0500 Received: from quimby.gnus.org ([95.216.78.240]:53040) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l5ksB-0003Jk-7g for 37099@debbugs.gnu.org; Sat, 30 Jan 2021 02:40:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=7s7UToTbT6e2TdUpX5wOWunyWpwpxyQUibRLVoYRhxk=; b=SwfjPCWq6wyTQHuEXQaBKef/H1 FFpEmlJhimupNBbVEny93AP0KbGHUqo6k8iXgL2do8O0M+1e/GeLJ6xw9IL3G8AfPaS4nbDULH3Mh +pqhH6fcHZ+XjnPWanq5f9Z9LA4VXyQ21NKBatWNXdfKx6utwlKN70PlHivyWXVLO6fo=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l5ks3-0005zG-0g; Sat, 30 Jan 2021 08:40:41 +0100 From: Lars Ingebrigtsen To: Alan Mackenzie Subject: Re: bug#37099: 26.2 Comment-dwim References: X-Now-Playing: Two Tons O' Fun's _For Discos Only (3)_: "I Got The Feeling (Patrick Cowley Megamix)" Date: Sat, 30 Jan 2021 08:40:37 +0100 In-Reply-To: (Alan Mackenzie's message of "Wed, 21 Aug 2019 16:42:35 -0000 (UTC)") Message-ID: <87zh0qx47e.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Alan Mackenzie writes: >> For example in java mode it would make sense for // to be the >> end-of-line comment, but if point is on an empty line then comment-dwim >> would insert /* */ with point inside the /* */ like so: / [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 37099 Cc: 37099@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Alan Mackenzie writes: >> For example in java mode it would make sense for // to be the >> end-of-line comment, but if point is on an empty line then comment-dwim >> would insert /* */ with point inside the /* */ like so: /* | */ where | >> is the point location. > > Why would this make sense? For example, how big is the community of > users who would want such a facility. There didn't seem to be much enthusiasm for the proposed functionality, so I'm closing this bug report. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 30 02:41:00 2021 Received: (at control) by debbugs.gnu.org; 30 Jan 2021 07:41:00 +0000 Received: from localhost ([127.0.0.1]:53553 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l5ksN-0003KO-9J for submit@debbugs.gnu.org; Sat, 30 Jan 2021 02:41:00 -0500 Received: from quimby.gnus.org ([95.216.78.240]:53054) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l5ksL-0003K9-CN for control@debbugs.gnu.org; Sat, 30 Jan 2021 02:40:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=YQm/APgjWjxphgxyoZNmiqqelyX8Qx9Ahgs7S0i9Z7k=; b=pH936QUHfAPNcPsH4vLkQfi9ns TDQNuuFLDTv2ececA0ZmiatWmT6vuCLQCGIC7KYUeH/5mdBN0JLec29pzJSvV5CCAtKIMJ8w2UYkj jQkJLUTm4PA0/8hylZKj/CF27tot+ppHfI3oL47tTRVs5Cq80X6gag/9EySe5Dwkb8/8=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l5ksD-0005zP-Ox for control@debbugs.gnu.org; Sat, 30 Jan 2021 08:40:51 +0100 Date: Sat, 30 Jan 2021 08:40:48 +0100 Message-Id: <87y2gax473.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #37099 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 37099 wontfix close 37099 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 37099 wontfix close 37099 quit From unknown Wed Jun 25 03:51:21 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 27 Feb 2021 12:24:10 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator