diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 87df9b17349..bb5590b1c39 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -11,6 +11,11 @@ * progmodes/cperl-mode.el (cperl-unwind-to-safe): Don't inf-loop at end of narrowed buffer (bug#11966). +2012-07-14 Jan Djärv + + * progmodes/cc-cmds.el (c-defun-name): Recognize Objective-C methods + also (Bug#7879). + 2012-07-09 Stefan Monnier * progmodes/sh-script.el (sh-syntax-propertize-function): Fix last diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index 9cf20ccb516..9c8c5633b80 100644 --- a/lisp/progmodes/cc-cmds.el +++ b/lisp/progmodes/cc-cmds.el @@ -1826,6 +1826,15 @@ 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))) + (t ;; Normal function or initializer. (when (c-syntactic-re-search-forward "[{(]" nil t)