comparison lisp/cc-mode/cc-cmds.el @ 183:e121b013d1f0 r20-3b18

Import from CVS: tag r20-3b18
author cvs
date Mon, 13 Aug 2007 09:54:23 +0200
parents bfd6434d15b3
children b405438285a2
comparison
equal deleted inserted replaced
182:f07455f06202 183:e121b013d1f0
5 ;; Authors: 1992-1997 Barry A. Warsaw 5 ;; Authors: 1992-1997 Barry A. Warsaw
6 ;; 1987 Dave Detlefs and Stewart Clamen 6 ;; 1987 Dave Detlefs and Stewart Clamen
7 ;; 1985 Richard M. Stallman 7 ;; 1985 Richard M. Stallman
8 ;; Maintainer: cc-mode-help@python.org 8 ;; Maintainer: cc-mode-help@python.org
9 ;; Created: 22-Apr-1997 (split from cc-mode.el) 9 ;; Created: 22-Apr-1997 (split from cc-mode.el)
10 ;; Version: 5.15 10 ;; Version: 5.16
11 ;; Keywords: c languages oop 11 ;; Keywords: c languages oop
12 12
13 ;; This file is part of GNU Emacs. 13 ;; This file is part of GNU Emacs.
14 14
15 ;; GNU Emacs is free software; you can redistribute it and/or modify 15 ;; GNU Emacs is free software; you can redistribute it and/or modify
194 ;; be most disruptive. we'll blink it ourselves later on 194 ;; be most disruptive. we'll blink it ourselves later on
195 (old-blink-paren blink-paren-function) 195 (old-blink-paren blink-paren-function)
196 blink-paren-function 196 blink-paren-function
197 (insertion-point (point)) 197 (insertion-point (point))
198 delete-temp-newline 198 delete-temp-newline
199 (preserve-p (eq ? (char-syntax (char-before)))) 199 (preserve-p (and (not (bobp))
200 (eq ?\ (char-syntax (char-before)))))
200 ;; shut this up too 201 ;; shut this up too
201 (c-echo-syntactic-information-p nil) 202 (c-echo-syntactic-information-p nil)
202 (syntax (progn 203 (syntax (progn
203 ;; only insert a newline if there is 204 ;; only insert a newline if there is
204 ;; non-whitespace behind us 205 ;; non-whitespace behind us
747 ))))) 748 )))))
748 749
749 ;; for proposed new variable comment-line-break-function 750 ;; for proposed new variable comment-line-break-function
750 (defun c-comment-line-break-function (&optional soft) 751 (defun c-comment-line-break-function (&optional soft)
751 ;; we currently don't do anything with soft line breaks 752 ;; we currently don't do anything with soft line breaks
752 (if (not c-comment-continuation-stars) 753 (if (or (not c-comment-continuation-stars)
754 (not (c-in-literal)))
753 (indent-new-comment-line soft) 755 (indent-new-comment-line soft)
754 (let ((here (point)) 756 (let ((here (point))
755 (leader c-comment-continuation-stars)) 757 (leader c-comment-continuation-stars))
756 (back-to-indentation) 758 (back-to-indentation)
757 ;; are we looking at a block or lines style comment? 759 ;; are we looking at a block or lines style comment?
772 (if (boundp 'comment-line-break-function) 774 (if (boundp 'comment-line-break-function)
773 nil 775 nil
774 (require 'advice) 776 (require 'advice)
775 (defadvice indent-new-comment-line (around c-line-break-advice activate) 777 (defadvice indent-new-comment-line (around c-line-break-advice activate)
776 (if (or (not c-buffer-is-cc-mode) 778 (if (or (not c-buffer-is-cc-mode)
779 (not (c-in-literal))
777 (not c-comment-continuation-stars)) 780 (not c-comment-continuation-stars))
778 ad-do-it 781 ad-do-it
779 (c-comment-line-break-function (ad-get-arg 0))))) 782 (c-comment-line-break-function (ad-get-arg 0)))))
780 783
781 ;; used by outline-minor-mode 784 ;; used by outline-minor-mode
1249 (beginning-of-line) 1252 (beginning-of-line)
1250 (skip-chars-forward " \t\n") 1253 (skip-chars-forward " \t\n")
1251 (and (looking-at comment-start-skip) 1254 (and (looking-at comment-start-skip)
1252 (setq comment-start-place (point))))) 1255 (setq comment-start-place (point)))))
1253 (re1 "\\|[ \t]*/\\*[ \t]*$\\|[ \t]*\\*/[ \t]*$\\|[ \t/*]*$")) 1256 (re1 "\\|[ \t]*/\\*[ \t]*$\\|[ \t]*\\*/[ \t]*$\\|[ \t/*]*$"))
1254 (if (and c-double-slash-is-comments-p 1257 (if (save-excursion
1255 (save-excursion 1258 (beginning-of-line)
1256 (beginning-of-line) 1259 (looking-at ".*//"))
1257 (looking-at ".*//")))
1258 (let ((fill-prefix fill-prefix) 1260 (let ((fill-prefix fill-prefix)
1259 ;; Lines containing just a comment start or just an end 1261 ;; Lines containing just a comment start or just an end
1260 ;; should not be filled into paragraphs they are next 1262 ;; should not be filled into paragraphs they are next
1261 ;; to. 1263 ;; to.
1262 (paragraph-start (concat paragraph-start re1)) 1264 (paragraph-start (concat paragraph-start re1))