From: Stephen Berman <stephen.berman@gmx.net>
To: emacs-devel@gnu.org
Cc: Artur Malabarba <bruce.connor.am@gmail.com>
Subject: Re: master 97cb255: newcomment.el (comment-line): New command on C-x C-; .
Date: Sun, 08 Feb 2015 21:07:18 +0100 [thread overview]
Message-ID: <87lhk8w4jt.fsf@gmx.net> (raw)
In-Reply-To: <E1YKX8s-0007vW-86@vcs.savannah.gnu.org> (Artur Malabarba's message of "Sun, 08 Feb 2015 19:03:38 +0000")
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 <bruce.connor.am@gmail.com> 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
next parent reply other threads:[~2015-02-08 20:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20150208190338.30436.1351@vcs.savannah.gnu.org>
[not found] ` <E1YKX8s-0007vW-86@vcs.savannah.gnu.org>
2015-02-08 20:07 ` Stephen Berman [this message]
2015-02-08 20:26 ` master 97cb255: newcomment.el (comment-line): New command on C-x C-; Artur Malabarba
2015-02-09 1:13 ` Drew Adams
2015-02-10 0:13 ` Artur Malabarba
2015-02-10 6:21 ` Drew Adams
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87lhk8w4jt.fsf@gmx.net \
--to=stephen.berman@gmx.net \
--cc=bruce.connor.am@gmail.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.