From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rasmus Newsgroups: gmane.emacs.bugs Subject: bug#21921: New function comment-line also comments first line after region Date: Sun, 15 Nov 2015 12:45:02 +0100 Message-ID: <87a8qffpvl.fsf@gmx.us> References: <56477C57.6090109@live.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1447657316 15717 80.91.229.3 (16 Nov 2015 07:01:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 16 Nov 2015 07:01:56 +0000 (UTC) To: 21921@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 16 08:01:44 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZyDnL-0003B5-CV for geb-bug-gnu-emacs@m.gmane.org; Mon, 16 Nov 2015 08:01:43 +0100 Original-Received: from localhost ([::1]:46181 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyDnK-0001O5-Pi for geb-bug-gnu-emacs@m.gmane.org; Mon, 16 Nov 2015 02:01:42 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47187) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zxvly-0002lw-MM for bug-gnu-emacs@gnu.org; Sun, 15 Nov 2015 06:47:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zxvlv-00084H-AP for bug-gnu-emacs@gnu.org; Sun, 15 Nov 2015 06:47:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48773) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zxvlv-00084C-6H for bug-gnu-emacs@gnu.org; Sun, 15 Nov 2015 06:47:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Zxvlu-0008ET-7b for bug-gnu-emacs@gnu.org; Sun, 15 Nov 2015 06:47:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <56477C57.6090109@live.com> Resent-From: Rasmus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Nov 2015 11:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21921 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.144758801631626 (code B ref -1); Sun, 15 Nov 2015 11:47:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 15 Nov 2015 11:46:56 +0000 Original-Received: from localhost ([127.0.0.1]:38481 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zxvln-0008E2-JC for submit@debbugs.gnu.org; Sun, 15 Nov 2015 06:46:55 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:37118) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZxvlT-0008DZ-2p for submit@debbugs.gnu.org; Sun, 15 Nov 2015 06:46:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZxvlR-00081p-SN for submit@debbugs.gnu.org; Sun, 15 Nov 2015 06:46:34 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:34439) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZxvlR-00081l-PB for submit@debbugs.gnu.org; Sun, 15 Nov 2015 06:46:33 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47112) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZxvlQ-0002VR-Ps for bug-gnu-emacs@gnu.org; Sun, 15 Nov 2015 06:46:33 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZxvlN-00081Q-Il for bug-gnu-emacs@gnu.org; Sun, 15 Nov 2015 06:46:32 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:54047) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZxvlN-000819-Bo for bug-gnu-emacs@gnu.org; Sun, 15 Nov 2015 06:46:29 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Zxvkr-0007L5-4Y for bug-gnu-emacs@gnu.org; Sun, 15 Nov 2015 12:45:57 +0100 Original-Received: from x4db26f62.dyn.telefonica.de ([77.178.111.98]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 15 Nov 2015 12:45:52 +0100 Original-Received: from rasmus by x4db26f62.dyn.telefonica.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 15 Nov 2015 12:45:52 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 70 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: x4db26f62.dyn.telefonica.de Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAAAAAByaaZbAAAAAmJLR0QA/4ePzL8AAAAJcEhZ cwAAAEgAAABIAEbJaz4AAAIMSURBVEjHvZbLleswDEPDjlgKOkEnKAWFoBYW8RayEydRJvM246WO rkjw61v953f7M6DRIFlVBUeSJAIfAYCSLdmWk0QCuj8BTUpKrCQzEfuLSw3IiZRJ1L8S3czYMc8D VH+JkuKMUFXV8kzid9euAOyZiKjqhkRKb+7dqqoosquq9fJsg682LhpQ1Y4toTSnsFfi4pK6SpJo wqMqopoStnmoaldBImgRVCSSErm3QKIKJAGKlGxbfiuQszRIdBVAAAS16iOxXkQ8Mo0jKsR6P5mZ xNoA3QD6AEDK8mFhD1T3chQkAMpJDsTWRsPpEUX0ASRJJtkCIPHIeB+XZ5ngO9AAu6plk6jynF8m vpcTLgBZVcpMzC7Og3g0U9R9ACBV6+HEAi/3fTYITeEOSFXFjAUQugI6AEe8u0RZVVVo2oKzAWZd uR0z4zAM6Z7lmYm9TxyOU655tPIwyWeARyfLJrW4lW57XxqrhSyvVyVatmNb22o9tMuZWLIkKbb2 Fup+2A1099KffAaeGnGVSZzVctsW9arvZncDa3Am0iquLbCKSpRFyqfiT8CSDZz3EzuWVq9/3kD9 aLjY8jegu7rB5Y9Mifi+43oNDWvj0DuAopZkiW+D9QXoLhK0csjdLbnbs+RV3ZYJ9LmB+kdghUcX 5/tJxwtAre17GcBN/BDWNSqvsemXSP3dv8avv39wgAhOeVDQLwAAAABJRU5ErkJggg== User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:j+j8KQHnqQEmJuVSwkN7Z8Y5Nt4= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:108748 Archived-At: Hi Clément, Thanks for details report. Clément Pit--Claudel writes: > Its documentation says: > > If region is active, comment lines in active region instead. > > However, it seems that it also comments out the line just after the end > of the region. > > For example, given the following text > > abc > def > ghi > > Placing the cursor before `a', then pressing C-SPC C-n C-n, causes two > lines to be marked: (> is highlighting, | is point) > >>abc >>def > |ghi > > Yet pressing C-x C-; (comment-region) comments out all three lines. Because the end of region is at point. Try to run this: (list (point) (region-beginning) (region-end)) Also, from the docstring, Unlike ‘comment-dwim’, this always comments whole lines. You'd get what you'd expect if you run comment-dwim (M-;) > Similarly, again starting from > > abc > def > ghi > > placing the point before `g' and pressing C-SPC C-p C-p causes two lines > to be marked: Again, in fact the region start at 'g'. Check e.g. with C-x C-x. But it's not obvious from the face. >>|abc >>def > ghi > > Yet pressing C-x C-; comments out all three lines. I find this second example especially confusing. > > Is this behaviour only surprising to me? Perhaps the confusion is caused by region not being displayed at column zero. The behavior is correct IMO. For your particular examples, comment-dwim does what you want, it seems. Hope it helps, Rasmus -- Spil noget med Slayer!