diff options
author | Miles Bader <miles@gnu.org> | 2007-04-24 21:56:25 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 2007-04-24 21:56:25 +0000 |
commit | 991a760232de757d71d8dbbed47ee12d81e29d53 (patch) | |
tree | 2440730c37ae3f167a50f5c3ac5eaeab9b72b7b0 /lisp/progmodes/cc-cmds.el | |
parent | 0bb328f8f6fce06a7fc65670c7d5c011b613e1c5 (diff) | |
parent | 3851329262d6558d5e1a93157d44777d0a39e38e (diff) | |
download | emacs-991a760232de757d71d8dbbed47ee12d81e29d53.tar.gz emacs-991a760232de757d71d8dbbed47ee12d81e29d53.tar.bz2 emacs-991a760232de757d71d8dbbed47ee12d81e29d53.zip |
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 698-710)
- Update from CVS
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 216)
- Update from CVS
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-196
Diffstat (limited to 'lisp/progmodes/cc-cmds.el')
-rw-r--r-- | lisp/progmodes/cc-cmds.el | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index 79043c87b63..079ebb02622 100644 --- a/lisp/progmodes/cc-cmds.el +++ b/lisp/progmodes/cc-cmds.el @@ -856,8 +856,8 @@ is inhibited." (narrow-to-region (point-min) (point)) (back-to-indentation) (looking-at (concat c-current-comment-prefix "[ \t]*$"))))) - (kill-region (progn (forward-line 0) (point)) - (progn (end-of-line) (point))) + (delete-region (progn (forward-line 0) (point)) + (progn (end-of-line) (point))) (insert-char ?* 1)) ; the / comes later. ; Do I need a t (retain sticky properties) here? (setq indentp (and (not arg) @@ -1360,10 +1360,24 @@ No indentation or other \"electric\" behavior is performed." (and c-opt-block-decls-with-vars-key (save-excursion (c-syntactic-skip-backward "^;}" lim) - (and (eq (char-before) ?\}) - (eq (car (c-beginning-of-decl-1 lim)) 'previous) - (looking-at c-opt-block-decls-with-vars-key) - (point))))) + (let ((eo-block (point)) + bod) + (and (eq (char-before) ?\}) + (eq (car (c-beginning-of-decl-1 lim)) 'previous) + (setq bod (point)) + ;; Look for struct or union or ... If we find one, it might + ;; be the return type of a function, or the like. Exclude + ;; this case. + (c-syntactic-re-search-forward + (concat "[;=\(\[{]\\|\\(" + c-opt-block-decls-with-vars-key + "\\)") + eo-block t t t) + (match-beginning 1) ; Is there a "struct" etc., somewhere? + (not (eq (char-before) ?_)) + (c-syntactic-re-search-forward "[;=\(\[{]" eo-block t t t) + (eq (char-before) ?\{) + bod))))) (defun c-where-wrt-brace-construct () ;; Determine where we are with respect to functions (or other brace @@ -1531,7 +1545,7 @@ defun." (setq arg (c-forward-to-nth-EOF-} (- arg) where))) ;; Move forward to the next opening brace.... (when (and (= arg 0) - (c-syntactic-re-search-forward "{" nil t)) + (c-syntactic-re-search-forward "{" nil 'eob)) (backward-char) ;; ... and backward to the function header. (c-beginning-of-decl-1) |