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: bug#8150: 23.2; cperl-uncomment-region is NOT an inverse of cperl-comment-region Date: Fri, 17 Feb 2012 10:45:23 -0500 Message-ID: References: <878vwxgb07.fsf@cds.caltech.edu> <0aipw177lj.fsf@fencepost.gnu.org> <20110302203816.7e8e2fa1@smart> <87d39dsk35.fsf@ed.ac.uk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1329493592 22719 80.91.229.3 (17 Feb 2012 15:46:32 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 17 Feb 2012 15:46:32 +0000 (UTC) Cc: 8150-done@debbugs.gnu.org To: Lawrence Mitchell Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Feb 17 16:46:29 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RyQ0x-0004ub-IH for geb-bug-gnu-emacs@m.gmane.org; Fri, 17 Feb 2012 16:46:27 +0100 Original-Received: from localhost ([::1]:36436 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RyQ0w-0003VS-S8 for geb-bug-gnu-emacs@m.gmane.org; Fri, 17 Feb 2012 10:46:26 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:35575) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RyQ0t-0003L0-4A for bug-gnu-emacs@gnu.org; Fri, 17 Feb 2012 10:46:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RyQ0g-0007uA-Mu for bug-gnu-emacs@gnu.org; Fri, 17 Feb 2012 10:46:23 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40229) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RyQ0g-0007u6-KZ for bug-gnu-emacs@gnu.org; Fri, 17 Feb 2012 10:46:10 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1RyQ2V-0007Nj-W8 for bug-gnu-emacs@gnu.org; Fri, 17 Feb 2012 10:48:04 -0500 Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Fri, 17 Feb 2012 15:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 8150 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Mail-Followup-To: 8150@debbugs.gnu.org, monnier@IRO.UMontreal.CA Original-Received: via spool by 8150-done@debbugs.gnu.org id=D8150.132949364428311 (code D ref 8150); Fri, 17 Feb 2012 15:48:02 +0000 Original-Received: (at 8150-done) by debbugs.gnu.org; 17 Feb 2012 15:47:24 +0000 Original-Received: from localhost ([127.0.0.1]:43850 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RyQ1s-0007MZ-0d for submit@debbugs.gnu.org; Fri, 17 Feb 2012 10:47:24 -0500 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:53305) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RyQ1n-0007MP-Ac for 8150-done@debbugs.gnu.org; Fri, 17 Feb 2012 10:47:21 -0500 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id q1HFjN0Y016448; Fri, 17 Feb 2012 10:45:23 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 2A04C593DD; Fri, 17 Feb 2012 10:45:23 -0500 (EST) In-Reply-To: <87d39dsk35.fsf@ed.ac.uk> (Lawrence Mitchell's message of "Fri, 17 Feb 2012 12:47:10 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4135=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4135> : streams <729573> : uri <1067200> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.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:56971 Archived-At: > I'm chasing up open bugs I've participated in, probably too late > for 24.1, but just to see if anything's doing. Is there any > objection to applying the patch in this bug report? I've simplified the patch and installed it (see below), Stefan --- lisp/newcomment.el 2012-01-19 07:21:25 +0000 +++ lisp/newcomment.el 2012-02-17 15:41:15 +0000 @@ -872,14 +872,15 @@ (when (and sre (looking-at (concat "\\s-*\n\\s-*" srei))) (goto-char (match-end 0))) (if (null arg) (delete-region (point-min) (point)) - (skip-syntax-backward " ") + (let* ((opoint (point-marker)) + (nchar (skip-syntax-backward " "))) (delete-char (- numarg)) - (unless (or (bobp) + (unless (and (not (bobp)) (save-excursion (goto-char (point-min)) (looking-at comment-start-skip))) ;; If there's something left but it doesn't look like ;; a comment-start any more, just remove it. - (delete-region (point-min) (point)))) + (delete-region (point-min) opoint)))) ;; Remove the end-comment (and leading padding and such). (goto-char (point-max)) (comment-enter-backward)