From: Stefan Monnier Date: Mon, 19 Nov 2001 04:59:24 +0000 (+0000) Subject: (comment-indent): Fix misindentation for comment-only lines. X-Git-Tag: emacs-21.2~290 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fc37e84c18d5cedfab1e5653fe73448229c34f69;p=emacs.git (comment-indent): Fix misindentation for comment-only lines. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c71c4ec392f..b57f20d6141 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2001-11-18 Stefan Monnier + + * newcomment.el (comment-indent): + Fix misindentation for comment-only lines. + 2001-11-16 Stefan Monnier * rect.el (delete-rectangle-line): Fix pos/column confusion. diff --git a/lisp/newcomment.el b/lisp/newcomment.el index 98b02a6bfb0..65da3bea78f 100644 --- a/lisp/newcomment.el +++ b/lisp/newcomment.el @@ -5,7 +5,7 @@ ;; Author: code extracted from Emacs-20's simple.el ;; Maintainer: Stefan Monnier ;; Keywords: comment uncomment -;; Revision: $Id: newcomment.el,v 1.35 2001/09/27 21:13:44 monnier Exp $ +;; Revision: $Id: newcomment.el,v 1.35.4.1 2001/11/13 20:16:06 monnier Exp $ ;; This file is part of GNU Emacs. @@ -462,11 +462,12 @@ If CONTINUE is non-nil, use the `comment-continue' markers if any." ;; comment-indent-function refuses delegates to indent. (indent-according-to-mode) ;; Avoid moving comments past the fill-column. - (setq indent - (min indent - (+ (current-column) - (- fill-column - (save-excursion (end-of-line) (current-column)))))) + (unless (save-excursion (skip-chars-backward " \t") (bolp)) + (setq indent + (min indent + (+ (current-column) + (- fill-column + (save-excursion (end-of-line) (current-column))))))) (if (= (current-column) indent) (goto-char begpos) ;; If that's different from current, change it.