Mercurial > hg > xemacs-beta
diff lisp/simple.el @ 371:cc15677e0335 r21-2b1
Import from CVS: tag r21-2b1
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:03:08 +0200 |
parents | a4f53d9b3154 |
children | a300bb07d72d |
line wrap: on
line diff
--- a/lisp/simple.el Mon Aug 13 11:01:58 2007 +0200 +++ b/lisp/simple.el Mon Aug 13 11:03:08 2007 +0200 @@ -2253,8 +2253,7 @@ :group 'fill-comments) (defun indent-for-comment () - "Indent this line's comment to comment column, or insert an empty -comment. Comments starting in column 0 are not moved." + "Indent this line's comment to comment column, or insert an empty comment." (interactive "*") (let* ((empty (save-excursion (beginning-of-line) (looking-at "[ \t]*$"))) @@ -2281,19 +2280,13 @@ (skip-syntax-backward "^ " (match-beginning 0))))) (setq begpos (point)) ;; Compute desired indent. - ;; XEmacs change: Preserve indentation of comments starting in - ;; column 0, as documented. - (cond - ((= (current-column) 0) - (goto-char begpos)) - ((= (current-column) - (setq indent (funcall comment-indent-function))) - (goto-char begpos)) - (t + (if (= (current-column) + (setq indent (funcall comment-indent-function))) + (goto-char begpos) ;; If that's different from current, change it. (skip-chars-backward " \t") (delete-region (point) begpos) - (indent-to indent))) + (indent-to indent)) ;; An existing comment? (if cpos (progn (goto-char cpos) @@ -2329,7 +2322,7 @@ (defun kill-comment (arg) "Kill the comment on this line, if any. With argument, kill comments on that many lines starting with this one." - ;; this function loses in a lot of situations. it incorrectly recognizes + ;; this function loses in a lot of situations. it incorrectly recognises ;; comment delimiters sometimes (ergo, inside a string), doesn't work ;; with multi-line comments, can kill extra whitespace if comment wasn't ;; through end-of-line, et cetera. @@ -2615,23 +2608,20 @@ (if (save-excursion (skip-chars-backward " \t") (= (point) fill-point)) - ;; 1999-09-17 hniksic: turn off Kinsoku until - ;; it's debugged. - (funcall comment-line-break-function) ;; 97/3/14 jhod: Kinsoku processing -; ;(indent-new-comment-line) -; (let ((spacep (memq (char-before (point)) '(?\ ?\t)))) -; (funcall comment-line-break-function) -; ;; if user type space explicitly, leave SPC -; ;; even if there is no WAN. -; (if spacep -; (save-excursion -; (goto-char fill-point) -; ;; put SPC except that there is SPC -; ;; already or there is sentence end. -; (or (memq (char-after (point)) '(?\ ?\t)) -; (fill-end-of-sentence-p) -; (insert ?\ ))))) + ;(indent-new-comment-line) + (let ((spacep (memq (char-before (point)) '(?\ ?\t)))) + (funcall comment-line-break-function) + ;; if user type space explicitly, leave SPC + ;; even if there is no WAN. + (if spacep + (save-excursion + (goto-char fill-point) + ;; put SPC except that there is SPC + ;; already or there is sentence end. + (or (memq (char-after (point)) '(?\ ?\t)) + (fill-end-of-sentence-p) + (insert ?\ ))))) (save-excursion (goto-char fill-point) (funcall comment-line-break-function))) @@ -2767,7 +2757,6 @@ (defun turn-on-auto-fill () "Unconditionally turn on Auto Fill mode." - (interactive) (auto-fill-mode 1)) (defun set-fill-column (arg) @@ -2853,7 +2842,6 @@ (if (and comcol (not fill-prefix)) ; XEmacs - (ENE) from fa-extras. (let ((comment-column comcol) (comment-start comstart) - (block-comment-start comstart) (comment-end comment-end)) (and comment-end (not (equal comment-end "")) ; (if (not comment-multi-line) @@ -3906,7 +3894,7 @@ "List of classes of warnings that shouldn't be displayed. If any of the CLASS symbols associated with a warning is the same as any of the symbols listed here, the warning will not be displayed. -The warning will still be logged in the *Warnings* buffer (unless also +The warning will still logged in the *Warnings* buffer (unless also contained in `log-warning-suppressed-classes'), but the buffer will not be automatically popped up.