summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1992-07-11 18:59:17 +0000
committerRichard M. Stallman <rms@gnu.org>1992-07-11 18:59:17 +0000
commitc763f396fc03f529308c04b0c66f0204e90b20dd (patch)
tree050cf0d4b4c801ae3140ee2d38618d3990465a80 /lisp
parent7047ec77690bdef675cc5e8983cbbc66d0d12a6d (diff)
downloademacs-c763f396fc03f529308c04b0c66f0204e90b20dd.tar.gz
*** empty log message ***
Diffstat (limited to 'lisp')
-rw-r--r--lisp/progmodes/c-mode.el31
1 files changed, 21 insertions, 10 deletions
diff --git a/lisp/progmodes/c-mode.el b/lisp/progmodes/c-mode.el
index c5ed38bf5e8..c2f98c47f02 100644
--- a/lisp/progmodes/c-mode.el
+++ b/lisp/progmodes/c-mode.el
@@ -546,16 +546,27 @@ Returns nil if line starts inside a string, t if in a comment."
(let ((basic-indent
(save-excursion
(re-search-backward "^[^ \^L\t\n#]" nil 'move)
- (if (and (looking-at "\\sw\\|\\s_")
- (looking-at "[^\"\n=]*(")
- (progn
- (goto-char (1- (match-end 0)))
- (forward-sexp 1)
- (skip-chars-forward " \t\f")
- (and (< (point) indent-point)
- (not (memq (following-char)
- '(?\, ?\;))))))
- c-argdecl-indent 0))))
+ (let (comment lim)
+ (if (and (looking-at "\\sw\\|\\s_")
+ (looking-at "[^\"\n=]*(")
+ (progn
+ (goto-char (1- (match-end 0)))
+ (setq lim (point))
+ (forward-sexp 1)
+ (skip-chars-forward " \t\f")
+ (and (< (point) indent-point)
+ (not (memq (following-char)
+ '(?\, ?\;)))))
+ ;; Make sure the "function decl" we found
+ ;; is not inside a comment.
+ (progn
+ (beginning-of-line)
+ (while (and (not comment)
+ (search-forward "/*" lim t))
+ (setq comment
+ (not (search-forward "*/" lim t))))
+ (not comment)))
+ c-argdecl-indent 0)))))
basic-indent)))
;; ;; Now add a little if this is a continuation line.