emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master 97cb255: newcomment.el (comment-line): New command on C-x C-;


From: Stephen Berman
Subject: Re: master 97cb255: newcomment.el (comment-line): New command on C-x C-; .
Date: Sun, 08 Feb 2015 21:07:18 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

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 <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]