From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Just a thought about comment-line Date: Sun, 31 May 2020 15:05:11 -0400 Message-ID: References: <306c7cf5-6cfc-436e-a902-8ad4560b32d1@default> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="21699"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: PEDRO ANDRES ARANDA GUTIERREZ , emacs-devel@gnu.org, Yuri Khan To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 31 21:06:04 2020 Return-path: Envelope-to: ged-emacs-devel@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 1jfTHX-0005Y9-W6 for ged-emacs-devel@m.gmane-mx.org; Sun, 31 May 2020 21:06:03 +0200 Original-Received: from localhost ([::1]:35830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jfTHX-0005nf-13 for ged-emacs-devel@m.gmane-mx.org; Sun, 31 May 2020 15:06:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43878) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfTGp-00059k-Py for emacs-devel@gnu.org; Sun, 31 May 2020 15:05:19 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:4325) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfTGm-0006dC-OS for emacs-devel@gnu.org; Sun, 31 May 2020 15:05:18 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 2538E100363; Sun, 31 May 2020 15:05:15 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 92833100312; Sun, 31 May 2020 15:05:13 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1590951913; bh=QHRWVRYzbg1MFQKXnpFcKUr0lSu8g6SfjZPmgG8yTAQ=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=K88Re+RnGEuIKrpX70FkCyR3ad1hS9MHgdBisgYSJV8nYFjBQPfigqR9fF19b3oLv kJlV9F4riRljPXiw2ESXc9xzrEM+Ouw6Gqy2k6spMCbfFEka/Uia7EoOa5s5eQteJ0 pTxcNLuZ8Y7jTPguaJOLMyMNEZCPyy2ur2G4phIq6MgVa2lP4VJxSbiATFeYkYu/Ma hAfMAeXMdvC2SZSHYwvGfKDVqKaUfvE+fEv9CIAt2Xy2TGbfatwNWOMNC66hX4/h5v QDgpRjiUcbvvveEJYidnaWPFvFOkI2w95P4eFAU6rYH9xfbxBYFcLHjlVoSANFx2ab wU6byAr6j85/Q== Original-Received: from alfajor (76-10-137-254.dsl.teksavvy.com [76.10.137.254]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id D4241120689; Sun, 31 May 2020 15:05:12 -0400 (EDT) In-Reply-To: (Drew Adams's message of "Sun, 31 May 2020 11:05:55 -0700 (PDT)") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/31 13:10:28 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:251696 Archived-At: >> It automatically decides whether to comment or to uncomment, indeed. > Precisely. It's a compromise, and not a great one (IMO). Better to > have two commands, one for block commenting and the other for > end-of-line commenting. I have never seen someone comment a comment. Do you have a use case for it? > It's not just that it has to correctly guess what you mean. It's also > that _you_ have to guess what it's guessing you mean. ;-) That in nature of DWIM commands, yes. >> Right, as a general rule, the LF char belongs to the line that it >> terminates, so a position at BOL is really "between lines". >> Of course, that would require a special case when START=END=BOL. > > That special case is what `comment-region-lines' handles. At the detriment of the other case. > It just does this: > (comment-region BOL EOL PREFIX-ARG). But that's what the OP complained about when you do C-a C-SPC C-n C-n M-x comment-region-lines RET where it ends up commenting 3 lines, even though there are only 2 lines enclosed in the region. Stefan