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: Fri, 02 Nov 2007 08:10:25 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Glenn Morris <gm>       07/11/02 08:10:25

Index: newcomment.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/newcomment.el,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -b -r1.106 -r1.107
--- newcomment.el       26 Oct 2007 09:52:12 -0000      1.106
+++ newcomment.el       2 Nov 2007 08:10:25 -0000       1.107
@@ -599,6 +599,9 @@
     (let* ((eolpos (line-end-position))
           (begpos (comment-search-forward eolpos t))
           cpos indent)
+      (if (and comment-insert-comment-function (not begpos))
+         ;; If no comment and c-i-c-f is set, let it do everything.
+         (funcall comment-insert-comment-function)
       ;; An existing comment?
       (if begpos
          (progn
@@ -610,8 +613,6 @@
                (forward-char (/ (skip-chars-backward " \t") -2)))
            (setq cpos (point-marker)))
          ;; If none, insert one.
-       (if comment-insert-comment-function
-           (funcall comment-insert-comment-function)
          (save-excursion
            ;; Some `comment-indent-function's insist on not moving
            ;; comments that are in column 0, so we first go to the
@@ -624,7 +625,7 @@
            (setq begpos (point))
            (insert starter)
            (setq cpos (point-marker))
-           (insert ender))))
+           (insert ender)))
       (goto-char begpos)
       ;; Compute desired indent.
       (setq indent (save-excursion (funcall comment-indent-function)))
@@ -649,7 +650,7 @@
          (delete-region (point) (progn (skip-chars-backward " \t") (point)))
          (indent-to indent)))
       (goto-char cpos)
-      (set-marker cpos nil))))
+       (set-marker cpos nil)))))
 
 ;;;###autoload
 (defun comment-set-column (arg)




reply via email to

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