]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/cc-cmds.el
Merge from emacs-24 branch; up to 2012-05-01T10:20:43Z!rgm@gnu.org
[gnu-emacs] / lisp / progmodes / cc-cmds.el
index 94b296bf59e824c1124905161bf693ee35733be6..7cd0a0b0ae21c0c306c290210d8b51fbacf4dfbc 100644 (file)
@@ -1826,14 +1826,16 @@ with a brace block."
            ;; DEFFLAGSET(syslog_opt_flags,LOG_PID ...) ==> syslog_opt_flags
            (match-string-no-properties 1))
 
-          ;; Objective-C method starting with + or -.
-          ((and (derived-mode-p 'objc-mode)
-                (looking-at "[-+]\s*("))
-           (when (c-syntactic-re-search-forward ")\s*" nil t)
-             (c-forward-token-2)
-             (setq name-end (point))
-             (c-backward-token-2)
-             (buffer-substring-no-properties (point) name-end)))
+          ;; Objc selectors.
+          ((assq 'objc-method-intro (c-guess-basic-syntax))
+           (let ((bound (save-excursion (c-end-of-statement) (point)))
+                 (kw-re (concat "\\(?:" c-symbol-key "\\)?:"))
+                 (stretches))
+             (when (c-syntactic-re-search-forward c-symbol-key bound t t t)
+               (push (match-string-no-properties 0) stretches)
+               (while (c-syntactic-re-search-forward kw-re bound t t t)
+                 (push (match-string-no-properties 0) stretches)))
+             (apply 'concat (nreverse stretches))))
 
           (t
            ;; Normal function or initializer.