emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/newcomment.el,v


From: Glenn Morris
Subject: [Emacs-diffs] Changes to emacs/lisp/newcomment.el,v
Date: Sat, 03 Nov 2007 03:00:32 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Glenn Morris <gm>       07/11/03 03:00:32

Index: newcomment.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/newcomment.el,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -b -r1.107 -r1.108
--- newcomment.el       2 Nov 2007 08:10:25 -0000       1.107
+++ newcomment.el       3 Nov 2007 03:00:32 -0000       1.108
@@ -1152,7 +1152,8 @@
 If the region is active and `transient-mark-mode' is on, call
   `comment-region' (unless it only consists of comments, in which
   case it calls `uncomment-region').
-Else, if the current line is empty, insert a comment and indent it.
+Else, if the current line is empty, call `comment-insert-comment-function'
+if it is defined, otherwise insert a comment and indent it.
 Else if a prefix ARG is specified, call `comment-kill'.
 Else, call `comment-indent'.
 You can configure `comment-style' to change the way regions are commented."
@@ -1164,6 +1165,10 @@
        ;; FIXME: If there's no comment to kill on this line and ARG is
        ;; specified, calling comment-kill is not very clever.
        (if arg (comment-kill (and (integerp arg) arg)) (comment-indent))
+      ;; Inserting a comment on a blank line. comment-indent calls
+      ;; c-i-c-f if needed in the non-blank case.
+      (if comment-insert-comment-function
+          (funcall comment-insert-comment-function)
       (let ((add (comment-add arg)))
         ;; Some modes insist on keeping column 0 comment in column 0
        ;; so we need to move away from it before inserting the comment.
@@ -1172,7 +1177,7 @@
        (save-excursion
          (unless (string= "" comment-end)
            (insert (comment-padleft comment-end add)))
-         (indent-according-to-mode))))))
+            (indent-according-to-mode)))))))
 
 ;;;###autoload
 (defcustom comment-auto-fill-only-comments nil




reply via email to

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