diff options
| author | Richard M. Stallman | 1992-09-04 23:38:45 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1992-09-04 23:38:45 +0000 |
| commit | c9c56492177bd74caf7fe63690aa2422cbbd70f8 (patch) | |
| tree | b6d1bda719bfa38eafa8d7e6b7b42025ba5796bc | |
| parent | 07f4ea75c3168323b6c17207578bf7f41f4f4b67 (diff) | |
| download | emacs-c9c56492177bd74caf7fe63690aa2422cbbd70f8.tar.gz emacs-c9c56492177bd74caf7fe63690aa2422cbbd70f8.zip | |
*** empty log message ***
| -rw-r--r-- | lisp/progmodes/c-mode.el | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lisp/progmodes/c-mode.el b/lisp/progmodes/c-mode.el index fc4f4fa9da7..590efd5fd1c 100644 --- a/lisp/progmodes/c-mode.el +++ b/lisp/progmodes/c-mode.el | |||
| @@ -1,5 +1,4 @@ | |||
| 1 | ;;; c-mode.el --- C code editing commands for Emacs | 1 | ;;; c-mode.el --- C code editing commands for Emacs |
| 2 | |||
| 3 | ;; Copyright (C) 1985, 1986, 1987, 1992 Free Software Foundation, Inc. | 2 | ;; Copyright (C) 1985, 1986, 1987, 1992 Free Software Foundation, Inc. |
| 4 | 3 | ||
| 5 | ;; Maintainer: FSF | 4 | ;; Maintainer: FSF |
| @@ -236,8 +235,9 @@ if that value is non-nil." | |||
| 236 | 235 | ||
| 237 | (defun c-fill-paragraph (&optional arg) | 236 | (defun c-fill-paragraph (&optional arg) |
| 238 | "Like \\[fill-paragraph] but handle C comments. | 237 | "Like \\[fill-paragraph] but handle C comments. |
| 239 | If point is inside a comment, the current paragraph of the comment | 238 | If any of the current line is a comment or within a comment, |
| 240 | is filled, preserving the comment indentation or line-starting decorations." | 239 | fill the comment or the paragraph of it that point is in, |
| 240 | preserving the comment indentation or line-starting decorations." | ||
| 241 | (interactive "P") | 241 | (interactive "P") |
| 242 | (let ((first-line | 242 | (let ((first-line |
| 243 | ;; Check for obvious entry to comment. | 243 | ;; Check for obvious entry to comment. |
| @@ -248,9 +248,12 @@ is filled, preserving the comment indentation or line-starting decorations." | |||
| 248 | (if (or first-line | 248 | (if (or first-line |
| 249 | ;; t if we enter a comment between start of function and this line. | 249 | ;; t if we enter a comment between start of function and this line. |
| 250 | (eq (calculate-c-indent) t) | 250 | (eq (calculate-c-indent) t) |
| 251 | ;; See if we enter a comment between beg-of-line and here. | 251 | ;; t if this line contains a comment starter. |
| 252 | (nth 4 (parse-partial-sexp (save-excursion (beginning-of-line) (point)) | 252 | (save-excursion (beginning-of-line) |
| 253 | (point) 0))) | 253 | (re-search-forward comment-start-skip |
| 254 | (save-excursion (end-of-line) | ||
| 255 | (point)) | ||
| 256 | t))) | ||
| 254 | ;; Inside a comment: fill one comment paragraph. | 257 | ;; Inside a comment: fill one comment paragraph. |
| 255 | (let ((fill-prefix | 258 | (let ((fill-prefix |
| 256 | ;; The prefix for each line of this paragraph | 259 | ;; The prefix for each line of this paragraph |
| @@ -534,7 +537,6 @@ Returns nil if line starts inside a string, t if in a comment." | |||
| 534 | (backward-sexp 1) | 537 | (backward-sexp 1) |
| 535 | (error)) | 538 | (error)) |
| 536 | (beginning-of-line) | 539 | (beginning-of-line) |
| 537 | (setq tem (point)) | ||
| 538 | (looking-at "DEFUN\\b")) | 540 | (looking-at "DEFUN\\b")) |
| 539 | c-argdecl-indent | 541 | c-argdecl-indent |
| 540 | (if (and (looking-at "\\sw\\|\\s_") | 542 | (if (and (looking-at "\\sw\\|\\s_") |