From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: Re: comment-kill can't deal with following situation Date: Sun, 02 Mar 2008 16:42:17 -0500 Message-ID: References: <198A33EB1E9E344EBC566802C7761D6B4ACE3C@CNSHGSMBS04.ad4.ad.alcatel.com> <86tzjsqb47.fsf@163.com> <86hcfps0c2.fsf@163.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1204494158 32393 80.91.229.12 (2 Mar 2008 21:42:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 2 Mar 2008 21:42:38 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org To: lgfang Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Mar 02 22:43:03 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JVvxT-0003tz-3N for geb-bug-gnu-emacs@m.gmane.org; Sun, 02 Mar 2008 22:42:59 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JVvww-0006Xj-7e for geb-bug-gnu-emacs@m.gmane.org; Sun, 02 Mar 2008 16:42:26 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JVvwr-0006VL-Pk for bug-gnu-emacs@gnu.org; Sun, 02 Mar 2008 16:42:21 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JVvwp-0006Tk-Ur for bug-gnu-emacs@gnu.org; Sun, 02 Mar 2008 16:42:21 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JVvwp-0006TX-Nr for bug-gnu-emacs@gnu.org; Sun, 02 Mar 2008 16:42:19 -0500 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JVvwp-0007CE-CP for bug-gnu-emacs@gnu.org; Sun, 02 Mar 2008 16:42:19 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CALutykdMCrW2/2dsb2JhbACrAIEA X-IronPort-AV: E=Sophos;i="4.25,435,1199682000"; d="scan'208";a="15464964" Original-Received: from smtp.pppoe.ca ([65.39.196.238]) by ironport2-out.pppoe.ca with ESMTP; 02 Mar 2008 16:42:18 -0500 Original-Received: from pastel.home ([76.10.181.182]) by smtp.pppoe.ca (Internet Mail Server v1.0) with ESMTP id IYS28218; Sun, 02 Mar 2008 16:42:18 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id F03978279; Sun, 2 Mar 2008 16:42:17 -0500 (EST) In-Reply-To: <86hcfps0c2.fsf@163.com> (lgfang's message of "Sun, 02 Mar 2008 21:49:01 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:17639 Archived-At: >>> comment-kill is defined in newcomment.el. It is supposed to >>> kill comments (refer to its document). But it can't deal with >>> the cases in which there are more than one comment in a line. >>> An example is: Stefan> If you do not provide a prefix arg, comment-kill should Stefan> only kill 1 comment. Indeed when providing a prefix arg, > The document says: > Kill the comment on this line, if any. With prefix ARG, kill > comments on that many lines starting with this one. > So, take following C code for example: > int j; /* comment 1 */ int k; /* comment 2*/ > I think comment-kill should kill both comment 1 and comment 2 even > without prefix ARG. Here I disagree. I find it more useful to only kill one comment at a time (you can always choose to run the command 2 times, but you cannot run it 1/2 a time). Also the docstring says "kill *the comment* on this line", which admittedly is ambiguous when there are more than 1 comments, but indicates a clear intention to only kill 1 comment. Stefan> But in the presence of multi-line comments, the behavior Stefan> doesn't match the docstring either. > Even if all comments reside in one line and call comment-kill either > with/without prefix arg, the behavior is in-correct so long as there > are more than one comments. We should not make a design decision based on the behavior in one particular kind of circumstances (only single-line comments), since that's how we got into this mess in the first place. So please reply to my previous request: I don't know of anybody who uses the prefix arg of comment-kill, so if you could explain how you use it, it might help decide what the behavior should be. -- Stefan