emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-24 r108076: * lisp/progmodes/cc-cmds.


From: Leo Liu
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-24 r108076: * lisp/progmodes/cc-cmds.el (c-defun-name): Handle objc selectors properly.
Date: Sat, 21 Jul 2012 05:18:52 +0800
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 108076
fixes bug: http://debbugs.gnu.org/7879
committer: Leo Liu <address@hidden>
branch nick: emacs-24
timestamp: Sat 2012-07-21 05:18:52 +0800
message:
  * lisp/progmodes/cc-cmds.el (c-defun-name): Handle objc selectors properly.
modified:
  lisp/ChangeLog
  lisp/progmodes/cc-cmds.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-07-20 19:59:49 +0000
+++ b/lisp/ChangeLog    2012-07-20 21:18:52 +0000
@@ -1,5 +1,8 @@
 2012-07-20  Leo Liu  <address@hidden>
 
+       * progmodes/cc-cmds.el (c-defun-name): Handle objc selectors properly.
+       (Bug#7879)
+
        * progmodes/cc-langs.el (c-symbol-start): Include char _ (bug#11986).
 
 2012-07-18  Stefan Monnier  <address@hidden>

=== modified file 'lisp/progmodes/cc-cmds.el'
--- a/lisp/progmodes/cc-cmds.el 2012-07-20 19:59:49 +0000
+++ b/lisp/progmodes/cc-cmds.el 2012-07-20 21:18:52 +0000
@@ -1826,14 +1826,16 @@
            ;; 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 0) stretches)
+               (while (c-syntactic-re-search-forward kw-re bound t t t)
+                 (push (match-string 0) stretches)))
+             (apply 'concat (nreverse stretches))))
 
           (t
            ;; Normal function or initializer.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]