bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#5953: 23.1.95; objc-mode doesn't fontify Objective-C 2.0 keywords @s


From: Leo
Subject: bug#5953: 23.1.95; objc-mode doesn't fontify Objective-C 2.0 keywords @syntesize and @property correctly
Date: Wed, 22 Aug 2012 17:39:50 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (OS X 10.8)

On 2012-08-22 11:32 +0800, Leo wrote:
> Here is a list of OjbC2.0 directives with annotations:
>
>   http://maniacdev.com/cheatsheetobjccd.pdf
>
> Leo

I have compiled a patch to improve support for Objective C.

I am not sure where to add the following keywords so they live in
c-other-decl-kwds for now. Please review the patch. Thanks.

  1. @property
     : @property (attributes) Type propertyName;
  2. @dynamic
     : @dynamic aProperty, bProperty;
  3. @synthesize
     : @synthesize aProperty, bProperty, cProperty=_ivar;
  4. @compatibility_alias
     : @compatibility_alias AliasClassName ExistingClassName;

>From 3ea4329978ebe2e5cb9d4bfd1e544277cf8e0352 Mon Sep 17 00:00:00 2001
From: Leo Liu <address@hidden>
Date: Wed, 22 Aug 2012 16:54:18 +0800
Subject: [PATCH] Add ObjC 2.0 directives support

---
 lisp/progmodes/cc-langs.el | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el
index 78be8ac2..4aed2048 100644
--- a/lisp/progmodes/cc-langs.el
+++ b/lisp/progmodes/cc-langs.el
@@ -1884,7 +1884,8 @@ (c-lang-defconst c-other-decl-kwds
 `c-<>-type-kwds', or `c-<>-arglist-kwds' then the associated clauses
 will be handled."
   t       nil
-  objc    '("@class" "@end" "@defs")
+  objc    '("@class" "@defs" "@end" "@property" "@dynamic" "@synthesize"
+           "@compatibility_alias")
   java    '("import" "package")
   pike    '("import" "inherit"))
 
@@ -2006,7 +2007,8 @@ (c-lang-defconst c-protection-kwds
   "Access protection label keywords in classes."
   t    nil
   c++  '("private" "protected" "public")
-  objc '("@private" "@protected" "@public"))
+  objc '("@private" "@protected" "@package" "@public"
+        "@required" "@optional"))
 
 (c-lang-defconst c-block-decls-with-vars
   "Keywords introducing declarations that can contain a block which
@@ -2176,7 +2178,7 @@ (c-lang-defconst c-block-stmt-1-kwds
   "Statement keywords followed directly by a substatement."
   t    '("do" "else")
   c++  '("do" "else" "try")
-  objc '("do" "else" "@finally" "@try")
+  objc '("do" "else" "@finally" "@try" "@autoreleasepool")
   java '("do" "else" "finally" "try")
   idl  nil)
 
@@ -2292,7 +2294,8 @@ (c-lang-defconst c-constant-kwds
   t       nil
   (c c++) '("NULL" ;; Not a keyword, but practically works as one.
            "false" "true")             ; Defined in C99.
-  objc    '("nil" "Nil" "YES" "NO" "NS_DURING" "NS_HANDLER" "NS_ENDHANDLER")
+  objc    '("nil" "Nil" "YES" "NO" "IBAction" "IBOutlet"
+           "NS_DURING" "NS_HANDLER" "NS_ENDHANDLER")
   idl     '("TRUE" "FALSE")
   java    '("true" "false" "null") ; technically "literals", not keywords
   pike    '("UNDEFINED")) ;; Not a keyword, but practically works as one.
-- 
1.7.12


reply via email to

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