]> git.eshelyaron.com Git - emacs.git/commitdiff
Backport: Recognize Objective-C methods also in c-defun-name
authorJan Djärv <jan.h.d@swipnet.se>
Fri, 20 Jul 2012 19:59:49 +0000 (03:59 +0800)
committerLeo Liu <sdl.web@gmail.com>
Fri, 20 Jul 2012 19:59:49 +0000 (03:59 +0800)
Fixes: debbugs:7879
lisp/ChangeLog
lisp/progmodes/cc-cmds.el

index 87df9b173490043843b10e14dbf65fd51c6f7cef..bb5590b1c39b3a5350a7f8314f4279fc2eb0aa54 100644 (file)
        * 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  <jan.h.d@swipnet.se>
+
+       * progmodes/cc-cmds.el (c-defun-name): Recognize Objective-C methods
+       also (Bug#7879).
+
 2012-07-09  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * progmodes/sh-script.el (sh-syntax-propertize-function): Fix last
index 9cf20ccb516c441a5bbbf582a6c25c6ea565d880..9c8c5633b801ae31a8f5df59925a41cf30f04654 100644 (file)
@@ -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)