aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/cc-engine.el
diff options
context:
space:
mode:
authorMartin Stjernholm <[email protected]>2005-05-23 00:03:59 +0000
committerMartin Stjernholm <[email protected]>2005-05-23 00:03:59 +0000
commit3efc2cd768a4f9838d2a08fde9408b08cec1b0c6 (patch)
tree0b4a8de389768e0ecdafbe065aad796dcbeed1e8 /lisp/progmodes/cc-engine.el
parentf1e9abb9bfab9c806cf3bb0dbea57812b160322e (diff)
2005-05-23 Martin Stjernholm <[email protected]>
CC Mode update to 5.30.10: * cc-fonts.el (c-font-lock-declarators): Fixed bug where the point could go past the limit in decoration level 2, thereby causing errors during interactive fontification. * cc-mode.el (c-make-inherited-keymap): Fixed cc-bytecomp bug when the file is evaluated interactively. * cc-engine.el (c-guess-basic-syntax): Handle operator declarations somewhat better in C++. * cc-styles.el, cc-mode.el (c-run-mode-hooks): New helper macro to make use of run-mode-hooks' which has been added in Emacs 21.1. (c-mode, c++-mode, objc-mode, java-mode, idl-mode, pike-mode, awk-mode): Use it. (make-local-hook): Suppress warning about obsoleteness. * cc-engine.el, cc-align.el, cc-cmds.el (c-append-backslashes-forward, c-delete-backslashes-forward, c-find-decl-spots, c-semi&comma-no-newlines-before-nonblanks): Compensate for return value from forward-line' when it has moved but not to a different line due to eob. * cc-engine.el (c-guess-basic-syntax): Fixed anchoring in objc-method-intro' and objc-method-args-cont'. 2005-05-23 Alan Mackenzie <[email protected]> CC Mode update to 5.30.10: * cc-mode.el, cc-engine.el, cc-align.el: Change the FSF's address in the copyright statement. Incidentally, change "along with GNU Emacs" to "along with this program" where it occurs. * cc-mode.el: Add a fourth parameter t' to the awk-mode autoload, so that it is interactive, hence can be found by M-x awk-mode whilst cc-mode is yet to be loaded. Reported by Glenn Morris <[email protected]>. * cc-awk.el: Add character classes (e.g. "[:alpha:]") into AWK Mode's regexps. 2005-05-23 Kevin Ryde <[email protected]>: * cc-align.el (c-lineup-argcont): Ignore conses for {} pairs from c-parse-state, to avoid a lisp error (on bad code).
Diffstat (limited to 'lisp/progmodes/cc-engine.el')
-rw-r--r--lisp/progmodes/cc-engine.el34
1 files changed, 25 insertions, 9 deletions
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 0a4cb6c8cd..8453808021 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -24,9 +24,9 @@
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to
-;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; along with this program; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
;;; Commentary:
@@ -3198,6 +3198,7 @@ This function does not do any hidden buffer changes."
;; when font-lock refontifies the current line only.
(when (save-excursion
(and (= (forward-line 1) 0)
+ (bolp) ; forward-line has funny behavior at eob.
(or (< (c-point 'eol) cfd-limit)
(progn (backward-char)
(not (eq (char-before) ?\\))))))
@@ -4551,7 +4552,7 @@ brace."
;; operator token preceded by "operator".
(save-excursion
(and (c-safe (c-backward-sexp) t)
- (looking-at "operator\\([^_]\\|$\\)")))
+ (looking-at "operator\\>\\([^_]\\|$\\)")))
(and (eq (char-before) ?<)
(c-with-syntax-table c++-template-syntax-table
(if (c-safe (goto-char (c-up-list-forward (point))))
@@ -6104,7 +6105,12 @@ This function does not do any hidden buffer changes."
;; Note: We use the fact that lim is always after any
;; preceding brace sexp.
(while (and (zerop (c-backward-token-2 1 t lim))
- (not (looking-at "[;<,=]"))))
+ (or (not (looking-at "[;<,=]"))
+ (and c-overloadable-operators-regexp
+ (looking-at c-overloadable-operators-regexp)
+ (save-excursion
+ (zerop (c-backward-token-2 1 nil lim))
+ (looking-at "operator\\>[^_]"))))))
(or (memq (char-after) '(?, ?=))
(and (c-major-mode-is 'c++-mode)
(zerop (c-backward-token-2 1 nil lim))
@@ -6237,7 +6243,15 @@ This function does not do any hidden buffer changes."
;; CASE 5I: ObjC method definition.
((and c-opt-method-key
(looking-at c-opt-method-key))
- (c-beginning-of-statement-1 lim)
+ (c-beginning-of-statement-1 nil t)
+ (if (= (point) indent-point)
+ ;; Handle the case when it's the first (non-comment)
+ ;; thing in the buffer. Can't look for a 'same return
+ ;; value from cbos1 since ObjC directives currently
+ ;; aren't recognized fully, so that we get 'same
+ ;; instead of 'previous if it moved over a preceding
+ ;; directive.
+ (goto-char (point-min)))
(c-add-syntax 'objc-method-intro (c-point 'boi)))
;; CASE 5P: AWK pattern or function or continuation
;; thereof.
@@ -6316,11 +6330,13 @@ This function does not do any hidden buffer changes."
;; CASE 5K: we are at an ObjC method definition
;; continuation line.
((and c-opt-method-key
- (progn
+ (save-excursion
+ (goto-char indent-point)
(c-beginning-of-statement-1 lim)
(beginning-of-line)
- (looking-at c-opt-method-key)))
- (c-add-syntax 'objc-method-args-cont (point)))
+ (when (looking-at c-opt-method-key)
+ (setq placeholder (point)))))
+ (c-add-syntax 'objc-method-args-cont placeholder))
;; CASE 5L: we are at the first argument of a template
;; arglist that begins on the previous line.
((eq (char-before) ?<)