aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Liu2012-07-21 05:18:52 +0800
committerLeo Liu2012-07-21 05:18:52 +0800
commit3646bcd6b8d321bbcf08bf8204ad92bdd3f1f0da (patch)
treef303c6c51e10128fed2cf2d8df6b9e6f45fe26be
parentfe1a523fd9cecbaabc3215b030848f25f15a9c20 (diff)
downloademacs-3646bcd6b8d321bbcf08bf8204ad92bdd3f1f0da.tar.gz
emacs-3646bcd6b8d321bbcf08bf8204ad92bdd3f1f0da.zip
* lisp/progmodes/cc-cmds.el (c-defun-name): Handle objc selectors properly.
Fixes: debbugs:7879
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/progmodes/cc-cmds.el18
2 files changed, 13 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index bb5590b1c39..f305d971a0f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
12012-07-20 Leo Liu <sdl.web@gmail.com> 12012-07-20 Leo Liu <sdl.web@gmail.com>
2 2
3 * progmodes/cc-cmds.el (c-defun-name): Handle objc selectors properly.
4 (Bug#7879)
5
3 * progmodes/cc-langs.el (c-symbol-start): Include char _ (bug#11986). 6 * progmodes/cc-langs.el (c-symbol-start): Include char _ (bug#11986).
4 7
52012-07-18 Stefan Monnier <monnier@iro.umontreal.ca> 82012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el
index 9c8c5633b80..3ec7386ece0 100644
--- a/lisp/progmodes/cc-cmds.el
+++ b/lisp/progmodes/cc-cmds.el
@@ -1826,14 +1826,16 @@ with a brace block."
1826 ;; DEFFLAGSET(syslog_opt_flags,LOG_PID ...) ==> syslog_opt_flags 1826 ;; DEFFLAGSET(syslog_opt_flags,LOG_PID ...) ==> syslog_opt_flags
1827 (match-string-no-properties 1)) 1827 (match-string-no-properties 1))
1828 1828
1829 ;; Objective-C method starting with + or -. 1829 ;; Objc selectors.
1830 ((and (derived-mode-p 'objc-mode) 1830 ((assq 'objc-method-intro (c-guess-basic-syntax))
1831 (looking-at "[-+]\s*(")) 1831 (let ((bound (save-excursion (c-end-of-statement) (point)))
1832 (when (c-syntactic-re-search-forward ")\s*" nil t) 1832 (kw-re (concat "\\(?:" c-symbol-key "\\)?:"))
1833 (c-forward-token-2) 1833 (stretches))
1834 (setq name-end (point)) 1834 (when (c-syntactic-re-search-forward c-symbol-key bound t t t)
1835 (c-backward-token-2) 1835 (push (match-string 0) stretches)
1836 (buffer-substring-no-properties (point) name-end))) 1836 (while (c-syntactic-re-search-forward kw-re bound t t t)
1837 (push (match-string 0) stretches)))
1838 (apply 'concat (nreverse stretches))))
1837 1839
1838 (t 1840 (t
1839 ;; Normal function or initializer. 1841 ;; Normal function or initializer.