From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Artur Malabarba Newsgroups: gmane.emacs.devel Subject: Re: master 97cb255: newcomment.el (comment-line): New command on C-x C-; . Date: Sun, 8 Feb 2015 18:26:50 -0200 Message-ID: References: <20150208190338.30436.1351@vcs.savannah.gnu.org> <87lhk8w4jt.fsf@gmx.net> Reply-To: bruce.connor.am@gmail.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1423427222 24846 80.91.229.3 (8 Feb 2015 20:27:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 8 Feb 2015 20:27:02 +0000 (UTC) Cc: emacs-devel To: Stephen Berman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 08 21:27:01 2015 Return-path: Envelope-to: ged-emacs-devel@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 1YKYRU-00013d-IJ for ged-emacs-devel@m.gmane.org; Sun, 08 Feb 2015 21:26:56 +0100 Original-Received: from localhost ([::1]:57737 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKYRU-0000h2-1U for ged-emacs-devel@m.gmane.org; Sun, 08 Feb 2015 15:26:56 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46086) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKYRQ-0000gl-BY for emacs-devel@gnu.org; Sun, 08 Feb 2015 15:26:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YKYRP-0000iE-EO for emacs-devel@gnu.org; Sun, 08 Feb 2015 15:26:52 -0500 Original-Received: from mail-ob0-x22d.google.com ([2607:f8b0:4003:c01::22d]:51424) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKYRP-0000i8-8W for emacs-devel@gnu.org; Sun, 08 Feb 2015 15:26:51 -0500 Original-Received: by mail-ob0-f173.google.com with SMTP id uy5so21855245obc.4 for ; Sun, 08 Feb 2015 12:26:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=XB3kqksp4kmrDMvhUcfJUQN1dV2f7l6JKDkMqG6gf9s=; b=sJ9Ou7sXsFos5aJlzJIW4m120nuNmRUeMu18RAB/4bDiFXmjsWOrPypnt9klxK2szl 9vsFMdo8sH+WP8ZARUtklKDOFShC4tGzQE1RHU2PnOuckkCmVK8A/0sK9Q5eNmgbf+mk vOAYT6lpWJUElChxiRTxBKVYeGud21xpZnQI5vgHX+U0kBxajjVCj+5hOYJcMfvLm1vk KzR/8Tad8q8yUKipTP+BqIffCWtxueA9Gy2lSYH/nGieiTVWrTu/JIAVLz17t6Eo+hbN IqL0GsxaxF1e4VkGDRz8W2vutdNlqFCphtBulOOa1ye5CQBwMfu53OldGNL5F/Pns/9j hU6A== X-Received: by 10.202.50.68 with SMTP id y65mr9113325oiy.91.1423427210676; Sun, 08 Feb 2015 12:26:50 -0800 (PST) Original-Received: by 10.76.125.1 with HTTP; Sun, 8 Feb 2015 12:26:50 -0800 (PST) In-Reply-To: <87lhk8w4jt.fsf@gmx.net> X-Google-Sender-Auth: K_uj3Cn7rupsTb63yRWtadjUOZo X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c01::22d X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:182640 Archived-At: Fixed. 2015-02-08 18:07 GMT-02:00 Stephen Berman : > This patch is missing a final `)', see below. Please fix, and before > you push, trying compiling or at least using check-parens. Thanks. > > Steve Berman > > On Sun, 08 Feb 2015 19:03:38 +0000 Artur Malabarba wrote: > >> +;;;###autoload >> +(defun comment-line (n) >> + "Comment or uncomment current line and leave point after it. >> +With positive prefix, apply to N lines including current one. >> +With negative prefix, apply to -N lines above. Also, further >> +consecutive invocations of this command will inherit the negative >> +argument. >> + >> +If region is active, comment lines in active region instead. >> +Unlike `comment-dwim', this always comments whole lines." >> + (interactive "p") >> + (if (use-region-p) >> + (comment-or-uncomment-region >> + (save-excursion >> + (goto-char (region-beginning)) >> + (line-beginning-position)) >> + (save-excursion >> + (goto-char (region-end)) >> + (line-end-position))) >> + (when (and (eq last-command 'comment-line-backward) >> + (natnump n)) >> + (setq n (- n))) >> + (let ((range >> + (list (line-beginning-position) >> + (goto-char (line-end-position n))))) >> + (comment-or-uncomment-region >> + (apply #'min range) >> + (apply #'max range))) >> + (forward-line 1) >> + (back-to-indentation) >> + (unless (natnump n) (setq this-command 'comment-line-backward))) > > ) ; <== here > >> + >> (provide 'newcomment) >> >> ;;; newcomment.el ends here