home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / Apps / EmacsTeX / emacs-patches / lisp / objc-mode-no-untabify.elc < prev    next >
Encoding:
Text File  |  1992-03-16  |  29.3 KB  |  510 lines

  1.  
  2. (provide (quote objective-C-mode))
  3.  
  4. (defun objective-C-mode-version nil "\
  5. 3.03a" (byte-code "¹Ç" [nil] 1))
  6.  
  7. (defun echo-objective-C-mode-version nil (interactive) (byte-code "ˋÈ´ˆ˜¯ ˘˙%!Ç" [mode-name nil message concat "Version " objective-C-mode-version " of " " mode."] 8))
  8.  
  9. (defvar objective-C-interface-file-dir nil "\
  10. The directory where to put generated interface files")
  11.  
  12. (defvar objective-C-document-file-dir nil "\
  13. The directory where to put generated document files")
  14.  
  15. (defvar objective-C-mode-map nil "\
  16. *Keymap used in objective-C mode.")
  17.  
  18. (if objective-C-mode-map nil (let ((map (make-sparse-keymap))) (define-key map "c" (quote objective-C-mfile-header)) (define-key map "h" (quote objective-C-hfile-header)) (define-key map "p" (quote objective-C-protocol)) (define-key map "f" (quote objective-C-factory-method)) (define-key map "m" (quote objective-C-instance-method)) (define-key map "l" (quote objective-C-codelimit)) (define-key map "
  19. " (quote objective-C-method-comment)) (define-key map "d" (quote generate-Objective-C-documentation)) (define-key map "h" (quote generate-Objective-C-hfile)) (define-key map "?" (quote describe-objective-C-mode)) (define-key map "i" (quote indent-region)) (define-key map "a" (quote add-user-sign)) (define-key map "v" (quote echo-objective-C-mode-version)) (define-key map "{" (quote electric-objective-C-brace)) (define-key map "}" (quote electric-objective-C-brace)) (define-key map ":" (quote electric-objective-C-keyword-match)) (define-key map "" (quote backward-delete-char)) (define-key map "    " (quote objective-C-indent-command)) (setq objective-C-mode-map map)))
  20.  
  21. (define-abbrev-table (quote objective-C-mode-abbrev-table) nil)
  22.  
  23. (defvar objective-C-mode-abbrev-table nil "\
  24. abbrevations to use in objective-c")
  25.  
  26. (defvar objective-C-mode-syntax-table nil "\
  27. Syntax table in use in Objective-C-Mode buffers.")
  28.  
  29. (if objective-C-mode-syntax-table nil (setq objective-C-mode-syntax-table (make-syntax-table)) (modify-syntax-entry 92 "\\" objective-C-mode-syntax-table) (modify-syntax-entry 47 ". 14" objective-C-mode-syntax-table) (modify-syntax-entry 42 ". 23" objective-C-mode-syntax-table) (modify-syntax-entry 43 "." objective-C-mode-syntax-table) (modify-syntax-entry 45 "." objective-C-mode-syntax-table) (modify-syntax-entry 61 "." objective-C-mode-syntax-table) (modify-syntax-entry 37 "." objective-C-mode-syntax-table) (modify-syntax-entry 60 "." objective-C-mode-syntax-table) (modify-syntax-entry 62 "." objective-C-mode-syntax-table) (modify-syntax-entry 38 "." objective-C-mode-syntax-table) (modify-syntax-entry 124 "." objective-C-mode-syntax-table) (modify-syntax-entry 39 "\"" objective-C-mode-syntax-table) (modify-syntax-entry 58 "_" objective-C-mode-syntax-table))
  30.  
  31. (defconst objective-C-indent-level 2 "\
  32. *Indentation of C statements with respect to containing block.")
  33.  
  34. (defconst objective-C-brace-imaginary-offset 0 "\
  35. *Imagined indentation of a C open brace that actually follows a statement.")
  36.  
  37. (defconst objective-C-brace-offset -2 "\
  38. *Extra indentation for braces, compared with other text in same context.")
  39.  
  40. (defconst objective-C-argdecl-indent 5 "\
  41. *Indentation level of declarations of C function arguments.")
  42.  
  43. (defconst objective-C-label-offset -2 "\
  44. *Offset of C label lines and case statements relative to usual indentation.")
  45.  
  46. (defconst objective-C-continued-statement-offset 2 "\
  47. *Extra indent for lines not starting new statements.")
  48.  
  49. (defconst objective-C-auto-newline nil "\
  50. *Non-nil means automatically newline before and after braces,
  51. and after colons and semicolons, inserted in C code.")
  52.  
  53. (defconst objective-C-tab-always-indent t "\
  54. *Non-nil means TAB in C mode should always reindent the current line,
  55. regardless of where in the line point is when the TAB command is used.")
  56.  
  57. (defun objective-C-mode nil "\
  58.   A major mode for the Objective-C language.
  59. Commands:
  60.   Expression and list commands understand all Objective-C brackets.
  61.   Tab anywhere on a line indents it according to Objective-C
  62.   conventions. LF does a CR and then an indentation like above.
  63.   Comments are delimited with /* ... */ or // to cr.
  64.   Paragraphs are separated by blank lines only.
  65.   Delete converts tabs to spaces as it moves back.
  66. \\{objective-C-mode-map}
  67.  
  68. Variables controlling indentation style:
  69.   objective-C-indent-level
  70.     Indentation of C statements within surrounding block.
  71.     The surrounding block's indentation is the indentation
  72.     of the line on which the open-brace appears.
  73.  
  74. Variables controlling directories of generated files:
  75.     objective-C-interface-file-dir
  76.       If non nil generated interface files will be put into
  77.       this directory. The default is current directory.
  78.     objective-C-document-file-dir
  79.       If non nil generated dokument files will be put into
  80.       this directory. The default is current directory.
  81.  
  82. Skeletons of the major Objective-C constructs are inserted with:
  83.   C-c c class header    C-c m instanceMethod     C-c f factoryMethod
  84.   C-c p protocol        C-c l limiter            C-c h header in h file
  85.   C-c <RET> method comment
  86.  
  87. Other useful stuff
  88.   C-c ? Describe objective-C mode
  89.   C-c a Add signature to use in comments
  90.   C-c v Return the version of this mode
  91.   C-c C-c h Generate an interface file from the implementation file
  92.   C-c C-c d Generate an documentation file from the implementation file
  93.  
  94. Abbreviations:
  95.   ry   & ryes  = return YES
  96.   rn   & rno   = return NO
  97.   rs   & rself = return self
  98.   rnil         = return nil
  99.   imp          = @implementation
  100.   intf         = @interface
  101.   st           = STR
  102.   bo           = BOOL
  103.  
  104. Turning on Objective-C mode calls the value of the variable
  105. objective-C-mode-hook with abbrevs, if that value is non-nil." (interactive) (byte-code "˛Èá Èâ!ÈãÉÈäÉÈ ÉÈå
  106. !Èç˘!ÈèPÉÈç¨!ÈÉÈç²!ÈéÉ    Èç˚!ȸÉ
  107. Èç³!ÈêÉ Èç˝!È˛É
  108. Èçˇ!ÈëÉÈç—!ÈìÉÈç±!ÈÆÉÈç¼!ÈíÉÈç½!ȸÉȪÉÈçà!È˛ÉÈîï!Ç" [objective-C-mode-map major-mode mode-name local-abbrev-table objective-C-mode-abbrev-table objective-C-mode-syntax-table paragraph-start page-delimiter paragraph-separate indent-line-function require-final-newline t comment-start signatures nil comment-end comment-column comment-start-skip comment-indent-hook parse-sexp-ignore-comments objective-C-line-length super-filename kill-all-local-variables use-local-map objective-C-mode "Objective-C" set-syntax-table make-local-variable "^$\\|" objective-C-indent-line "/* " " */" 32 "/\\*+ *" objective-C-comment-indent 70 run-hooks objective-C-mode-hook] 17))
  109.  
  110. (defun eb-day (aString) (byte-code "´    ˆ\"A@?    Á)Ç" [a aString assoc ((" 1" "01") (" 2" "02") (" 3" "03") (" 4" "04") (" 5" "05") (" 6" "06") (" 7" "07") (" 8" "08") (" 9" "09"))] 3))
  111.  
  112. (defun eb-month (aString) (byte-code "´    ˆ\"A@?    Á)Ç" [a aString assoc (("JAN" "01") ("FEB" "02") ("MAR" "03") ("APR" "04") ("MAY" "05") ("JUN" "06") ("JUL" "07") ("AUG" "08") ("SEP" "09") ("OCT" "10") ("NOV" "11") ("DEC" "12"))] 3))
  113.  
  114. (defun eb-date nil "\
  115. Return the current date in an EB Signal standard form" (byte-code "ˋ´ ˆ¹O˜¯´ ˘˙O!˜¨´ ²˚O!%Ç" [nil concat current-time-string -4 "-" eb-month 4 7 eb-day 8 10] 13))
  116.  
  117. (defun file-type (&optional name) (byte-code "?Â
  118. ´ Á ˆˋOÇ" [name nil m-filename -2] 4))
  119.  
  120. (defun m-filename nil (byte-code "ˋ´!!Ç" [buffer-file-name file-name-nondirectory file-name-sans-versions] 3))
  121.  
  122. (defun is-m-file (&optional name) (byte-code "ˋ´ˆ!\"Ç" [name string-equal ".m" file-type] 4))
  123.  
  124. (defun h-filename nil (byte-code "¹ ˋ´OˆPÇ" [m-filename 0 -2 ".h"] 4))
  125.  
  126. (defun h-file-dir nil (byte-code "?    ˋÁ
  127. Ç" [objective-C-interface-file-dir ""] 1))
  128.  
  129. (defun is-h-file (&optional name) (byte-code "ˋ´ˆ!\"Ç" [name string-equal ".h" file-type] 4))
  130.  
  131. (defun doc-filename nil (byte-code "¹ ˋ´OˆPÇ" [m-filename 0 -2 ".txt"] 4))
  132.  
  133. (defun doc-dir nil (byte-code "?    ˋÁ
  134. Ç" [objective-C-document-file-dir ""] 1))
  135.  
  136. (defun class-from-filename (&optional name) (byte-code "?Â
  137. ˋ Á ´ˆ˜?Âˋ Á\"OÇ" [name m-filename 0 string-match "\\.\\([0-9]*\\.\\)?\\(m\\|h\\|txt\\)"] 7))
  138.  
  139. (defun number-from-filename (&optional name) (byte-code "    ?Â
  140. ´ Á     ˆ˜\"G¯ZO)Ç" [m-file name m-filename string-match "\\([0-9]*\\)?\\.\\(m\\|h\\)" 2] 6))
  141.  
  142. (defun super-class nil (byte-code "˘˙¨ ²˚²%¸P³˝ \"˛ˇ!D³    ˝ \"˛ˇ!D
  143. @?Â+˜Á? @?Â5˜Á?—±
  144. !T± !T\",Ç" [row row2 a-list b-list nil t concat "@implementation " class-from-filename "\\( \\|    \\|
  145. \\)*" ":" "[a-zA-Z][a-zA-Z0-9$_]*" string-match buffer-string match-end 0 buffer-substring cadr] 13))
  146.  
  147. (defun super-class-number nil (byte-code "ˆ ´?˜Á&¯˘ˆ ˙Q!ÉȨ²    \"Â#    Á&˚    P*Ç" [sc no nil super-class "NO_SUPER_CLASS_FOUND" read-string "Class number for superclass " ": " string-equal "" "."] 6))
  148.  
  149. (defun super-hfilename (&optional number) (byte-code "ˆ 
  150. ? ˜ Á
  151. ?¯Á    ˘Q*Ç" [sc no number super-class super-class-number "NO_SUPER_CLASS_FOUND" ".h"] 5))
  152.  
  153. (defun user-sign nil (byte-code "ˋ´ \"A@Ç" [signatures assoc user-login-name] 4))
  154.  
  155. (defun cadr (l) (byte-code "A@Ç" [l] 1))
  156.  
  157. (defun odd (e) "\
  158. True if it's argument is odd." (byte-code "ˋ´\"ˆ=Ç" [e % 2 1] 3))
  159.  
  160. (defun e-empty-line-p nil "\
  161. True if current line is empty." (byte-code "ʹ Èˋ´!)Ç" [beginning-of-line looking-at "^[ \\t]*$"] 3))
  162.  
  163. (defun insert-right (name diff &optional c) (byte-code "˘    
  164. G #˙
  165. !Â
  166. Á¨²!˚ \"È
  167. c*Ç" [u objective-C-line-length name diff fillChar c - char-or-string-p string-to-char " " insert-char] 6))
  168.  
  169. (defun insert-centered (name diff &optional c) "\
  170. Inserts the name centered in the Objective-C environment
  171. diff is a number that tells how many positions that already
  172. are used on the line (/*     */ = 4) and the optional c
  173. character is used to fill white space with." (byte-code "˙    
  174. G #¨²\"˚!ÂÁ¸³!˝
  175. \"È
  176. cÈ˝
  177. ˛!Â1 TÁ2 \"+Ç" [toshare objective-C-line-length name diff u fillChar c - / 2 char-or-string-p string-to-char " " insert-char odd] 9))
  178.  
  179. (defun add-user-sign nil (interactive) (byte-code "ˆÈ˜ ¯˘˙Q!    D
  180. BÉ*Ç" [name sign signatures nil user-login-name read-string "Signature for " ": "] 5))
  181.  
  182. (defun classes-used nil "\
  183. Extract the used classes from the file" (byte-code "Êˋ´ Èˆ˜!ȯ˘!È˙ Ä¯˘!ÈÁȨ Èm?Ä,˙ ?Ä,²˚!ÄA¸ ³QÉȯ˘!Ȩ ÈÁÈ))Ç" [aString "" beginning-of-buffer re-search-forward "Classes used" forward-line 1 e-empty-line-p beginning-of-line looking-at "#import" grep-class-from-line " "] 13))
  184.  
  185. (defun beginning-of-line-point (&optional aBool) (byte-code "Êˋ ÈÄ ´ˆ!È`)Ç" [aBool beginning-of-line skip-chars-forward "     */"] 3))
  186.  
  187. (defun end-of-line-point (&optional aBool) (byte-code "Êˋ ÈÄ ´ˆ!È`)Ç" [aBool end-of-line skip-chars-backward "     */"] 3))
  188.  
  189. (defun grep-class-from-line nil (byte-code "´ ˆ ˜¯\\    ˘Z\"*Ç" [bp ep beginning-of-line-point end-of-line-point buffer-substring 9 3] 6))
  190.  
  191. (defun start-of-instance-point nil (byte-code "ʹ Èˋ´!Ȉ˜!ȯ Å˘˙!Ä!ˆ˜!Ȩ ÈÁ È`)Ç" [beginning-of-buffer search-forward "@implementation" forward-line 1 e-empty-line-p looking-at "{" beginning-of-line] 9))
  192.  
  193. (defun end-of-instance-point nil (byte-code "ʹ Èˋ´!Èˋˆ!Ș¯!È˘ Ä˜¯!ÈÁÈ˙ È`)Ç" [beginning-of-buffer search-forward "@implementation" "}" forward-line -1 e-empty-line-p end-of-line] 8))
  194.  
  195. (defun have-instance-variables nil (byte-code "ʹ Èˋ´!Ȉ˜!ȯ Äˆ˜!ÈÁ È˘˙!Ȩ²!)Ç" [beginning-of-buffer search-forward "@implementation" forward-line 1 e-empty-line-p skip-chars-forward "     " looking-at "{"] 8))
  196.  
  197. (defun instance-variables nil (byte-code "ˋ Â´ˆ ˜ \"Á¯Ç" [t have-instance-variables buffer-substring start-of-instance-point end-of-instance-point "     // none"] 6))
  198.  
  199. (defun start-of-intro-point nil (byte-code "Êˋ È´ˆ˜ ¹#?¯Á'˘¯!È˙ Ä\"˘¯!ÈÁȨ È`)Ç" [t beginning-of-buffer search-forward "Introduction" start-of-instance-point 1 forward-line e-empty-line-p beginning-of-line] 8))
  200.  
  201. (defun end-of-intro-point nil (byte-code "Êˋ È´ˆ˜ ¹#?¯Á'˘˙!Ȩ Ä\"˘˙!ÈÁȲ È`)Ç" [t beginning-of-buffer search-forward "Revision History" start-of-instance-point 1 forward-line -1 e-empty-line-p end-of-line] 8))
  202.  
  203. (defun class-intro nil (byte-code "´ ˆ     UŘUÅ    ˜U¯Á ˘    \"*Ç" [si ei start-of-intro-point end-of-intro-point 1 "    Can't extract the class description since the strings
  204.     Introduction and/or Revision History are missing in the source code." buffer-substring] 5))
  205.  
  206. (defun find-next-protocol-or-method nil (byte-code "¹ Èm?Äˋ´!?Äˋˆ!?Äˋ˜!?Ä'¯˘!ȹ ÈÁÈˋ´!Ä4¯˘!ȹ Èm?Ç" [beginning-of-line looking-at "/\\*=====" "+[a-zA-Z( ]" "-[a-zA-Z( ]" forward-line 1] 10))
  207.  
  208. (defun line-is-method nil (byte-code "ʹ Èˋ´!Å
  209. ˋˆ!)Ç" [beginning-of-line looking-at "+[a-zA-Z( ]" "-[a-zA-Z( ]"] 4))
  210.  
  211. (defun line-is-protocol nil (byte-code "ʹˋ!È´ Èˆ˜!)Ç" [forward-line -1 beginning-of-line looking-at "/\\*====="] 4))
  212.  
  213. (defun is-gps-comment nil (byte-code "Êˋ ´ Èˆ˜!Ä))Ç" [ordinary is-ordinary-comment beginning-of-line looking-at "---------"] 4))
  214.  
  215. (defun is-ordinary-comment nil (byte-code "ʹˋ`´Zf\"Ĺˆ`˜Zf\"Ĺ¯˘ f\"?)Ç" [char-equal 42 2 47 1 61 beginning-of-line-point] 6))
  216.  
  217. (defun is-date-entry nil (byte-code "ˋ´¹!´ ZWÇ" [t 50 beginning-of-line-point] 5))
  218.  
  219. (defun is-method-name-entry nil (byte-code "ˋ´ˆ¹!f\"Äˋ´˜¹!¯Zf\"Ç" [t char-equal 124 beginning-of-line-point end-of-line-point 1] 7))
  220.  
  221. (defun is-empty-line-info nil (byte-code "ˋ´ˆ˜¹!¯ \"\"Ç" [t string-equal "" buffer-substring beginning-of-line-point end-of-line-point] 7))
  222.  
  223. (defun is-not-crap-line nil (byte-code "¹ ?Äˋ ?Ä´ ?Ç" [is-date-entry is-method-name-entry is-empty-line-info] 4))
  224.  
  225. (defun look-for-comment-at-previous-line nil (byte-code "ʹˋ!È´ Èˆ˜!ȯ˘`f\"į˙`¨\\f\")Ç" [forward-line -1 beginning-of-line skip-chars-forward "     " char-equal 47 42 1] 8))
  226.  
  227. (defun is-still-comment nil (byte-code "Êˋ È´ˆ!Ș¯`f\"ʢ`˙\\f\"¨ Á ¹)Ç" [t beginning-of-line skip-chars-forward "     " char-equal 47 42 1 look-for-comment-at-previous-line] 7))
  228.  
  229. (defun is-objc-comment nil (byte-code "ʹ Èˋ´!)Ç" [beginning-of-line looking-at "//"] 3))
  230.  
  231. (defun gps-comment nil (byte-code "¹ Ç" [ordinary-comment] 2))
  232.  
  233. (defun ordinary-comment nil (byte-code "´ˆ˜!ȯ Ä*˘ È˙¨!Ȳ Ä\"˚`¸ˋ!\"³QÉȈ˜!ÈÁÈ)Ç" [aStr t "" forward-line -1 is-still-comment beginning-of-line skip-chars-forward "     */" is-not-crap-line buffer-substring end-of-line-point "
  234. "] 11))
  235.  
  236. (defun objc-comment nil (byte-code "´ˆ Ä&˜ È¯˘!È˙ Ä¨`²ˋ!\"˚QÉȸ³!ÈÁÈ)Ç" [aStr t "" is-objc-comment beginning-of-line skip-chars-forward "/ " is-not-crap-line buffer-substring end-of-line-point "
  237. " forward-line -1] 10))
  238.  
  239. (defun no-comment nil "\
  240. This method has not been documented in the source code." (byte-code "¹Ç" [nil] 1))
  241.  
  242. (defun line-as-doc-file-delimiter nil (byte-code "Êˋ È´ˆ!È`ÉȘ È¯ˆ!È˘˙`\"˘Q)Ç" [start beginning-of-line skip-chars-forward "     " end-of-line skip-chars-backward "
  243. " buffer-substring] 8))
  244.  
  245. (defun line-as-inteface-file-delimiter nil (byte-code "ʘ È¯˘!È`ÉÈ˙ È¨˘!Ȳ`\"ÉÈ˚     G¸#Éȳ˝˛ˇ
  246. —\"±\"¼²`\"¼˛½
  247. !ÂBˇ
  248. —\"¾\\ÁFˇ
  249. —\"±\"à&)Ç" [start name toshare objective-C-line-length beginning-of-line skip-chars-forward "     " end-of-line skip-chars-backward buffer-substring - 8 concat "
  250. /* " make-string / 2 45 " " odd 1 " */"] 21))
  251.  
  252. (defun skip-comment (str) (byte-code "ˆ˜    \"?    Á    ¯O)Ç" [p str t string-match "//" 0] 4))
  253.  
  254. (defun line-as-inteface-file-method nil (byte-code "Êˋ È´ˆ!È`ÉȘ¯!È˘˙!Ȩ²!È˚¸`\"!³P)Ç" [start beginning-of-line skip-chars-forward "     " re-search-forward "{" backward-char 1 skip-chars-backward "     
  255. " skip-comment buffer-substring ";"] 9))
  256.  
  257. (defun extract-method-comment nil (byte-code "ˋ´!Ȉ Äˋ´!ÈÁȘ È¯˘!È˙ Â\"¨ Á8² Â,˚ Á8¸ Â6³ Á8˝ Ç" [t forward-line -1 e-empty-line-p end-of-line skip-chars-backward "     " is-gps-comment gps-comment is-ordinary-comment ordinary-comment is-objc-comment objc-comment no-comment] 13))
  258.  
  259. (defun method-description (method-name start-point) (byte-code "ÊbÈ    ´ˆ Q)Ç" [start-point method-name "
  260. " extract-method-comment] 4))
  261.  
  262. (defun line-as-doc-file-method nil (byte-code "Êˋ È´ˆ!È`ÉȘ¯!È˘˙!Ȩ²!È˚¸³`\"¸Q\")Ç" [start beginning-of-line skip-chars-forward "     " re-search-forward "{" backward-char 1 skip-chars-backward "     
  263. " method-description "|" buffer-substring] 10))
  264.  
  265. (defun class-as-short nil (byte-code "Ê´ˆ È˜¯!Èm?Ģ Ä5˙ Â¨ Á*² Â)˚ Á*´¸QÉȳ ÈÁ
  266. È))Ç" [aString t "" beginning-of-buffer re-search-forward "@implementation" find-next-protocol-or-method line-is-protocol line-as-doc-file-delimiter line-is-method line-as-doc-file-method "
  267. " forward-line] 11))
  268.  
  269. (defun class-as-short-no-comments nil (byte-code "Ê´ˆ È˜¯!Èm?Ģ Ä5˙ Â¨ Á*² Â)˚ Á*´¸QÉȳ ÈÁ
  270. È))Ç" [aString t "" beginning-of-buffer re-search-forward "@implementation" find-next-protocol-or-method line-is-protocol line-as-inteface-file-delimiter line-is-method line-as-inteface-file-method "
  271. " forward-line] 11))
  272.  
  273. (defun describe-objective-C-mode nil (interactive) (byte-code "¹Èˋ Ç" [nil describe-mode] 2))
  274.  
  275. (defun objective-C-mfile-header nil "\
  276. Build a class skeleton prompting for class name." (interactive) (byte-code "˘È˙ ?¨²!Á    ˚ ¸ ³ ˝˛    \"˝ˇ!— ?Ä+± È¼ È½jȾcÈàá
  277. âZ\"ÈãcÈäcÈåç ã#Èåèé ê˘Oë#ÈìcÈÆcÈåíª î#ÈïcÈåðñ Ł#ÈØ ½\"ÈãcÈŒcȺcÈòcÈãcÈåóª ôñ º%ÈõcÈãcÈàá
  278. âZ\"ÈöcÈæù!ÈúcÈæû!ÈıcÈæü!ÈãcÈæý!ÈãcÈæł!ÈãcÈøœ P!Èåß½þOÿP#Èå À@ ÀA%ÈøÀB!ÈãcÈøÀC!ÈãcÈøÀD!ÈãcÈÀEc-ÈÀFÀG!ÈÀHÀI!ÈÀJ Ç" [file class nr cname super objective-C-line-length nil is-m-file message "This is not an implementation file (.m)!" m-filename class-from-filename number-from-filename read-string "Class: " "Super: " e-empty-line-p end-of-line newline 0 "/* " insert-char 45 3 "
  279.  
  280. " "    RDR, Inc. 
  281.  
  282. " insert "    Objective-C source file for the class " "    COPYRIGHT (C), " current-time-string -4 ", RDR, Inc.
  283. " "    ALL RIGHTS RESERVED.
  284.  
  285. " "    Responsible:            Approved:
  286. " "    RDR:" user-full-name "        
  287.  
  288. " "    Date:                Rev:
  289. " "    " eb-date "            ___
  290.  
  291. " insert-centered "    1. Introduction" "
  292.  
  293.  
  294. " "    2. Revision History" "    ___    The starting point.            " "/" "    3. Source Code" " */
  295.  
  296. " comment-line "Import files" "#import <appkit/appkit.h>
  297.  
  298. " " Classes used " "#import \"foo.h\"
  299.  
  300. " " Externals " " Defines " " Class variables " comment-box "Implementation of class " "#import \"" -1 "h" "\"
  301.  
  302. " "@implementation " " : " "
  303. {
  304.  
  305. }
  306.  
  307. " "Instance Creation" "Initialize" "Free" "@end
  308. " re-search-backward "@implementation" next-line 2 objective-C-indent-line] 38))
  309.  
  310. (defun objective-C-hfile-header (&optional classname super-filename) "\
  311. Gives an interface file sceleton." (interactive) (byte-code "˙Ȩ ?²˚!ÁÓ    ?¸ Á    ³˝\"˛ 
  312. ?Â/³ˇ!—PÁ0
  313. ±cȼ½¾Z\"ÈàcÈácÈâã
  314. à#Èâäå ç˙Oè#ÈécÈêcÈâëì Æ#ÈícÈâªî ï#ÈðcÈñcÈŁØ
  315. P!È⌠º#Èâò
  316. ó¸ !ô%Èõc,Èöæ!Èùú!Èû Ç" [class classname cname nr super super-filename objective-C-line-length nil is-h-file message "This is not an interface file (.h)!" class-from-filename read-string "Class: " number-from-filename "Super: " ".h" "/* " insert-char 45 3 "
  317.  
  318. " "    RDR, Inc. 
  319.  
  320. " insert "    Objective-C interface file for the class " "    COPYRIGHT (C), " current-time-string -4 ", RDR, Inc.
  321. " "    ALL RIGHTS RESERVED.
  322.  
  323. " "    Responsible:            Approved:
  324. " "    RDR:" user-full-name "        
  325.  
  326. " "    Date:                Rev:
  327. " "    " eb-date "            ___
  328.  
  329. " "    Reference:            Document no:
  330. " " */
  331.  
  332. " comment-box "Interface of class " "#import \"" "\"
  333.  
  334. " "@interface " " : " "
  335. {
  336.  
  337. }
  338.  
  339. " "@end
  340. " re-search-backward "@interface" next-line 2 objective-C-indent-line] 23))
  341.  
  342. (defun generate-Objective-C-hfile nil "\
  343. Generate the interface file for the current implementation file." (interactive) (byte-code "¨È²˚¸ ³ P\"˝!˛ ˇ — ± ¼     qȽ!ȾcÈàáâZ\"ÈãcÈäcÈåç
  344. ã#Èåèé ê¨Oë#ÈìcÈÆcÈåíª î#ÈïcÈåðñ Ł#ÈØcÈŒcȺò
  345. P!Èåóô#Èåõ
  346. ö˛!æ%È cÈùcÈ
  347. cÈúcÈû Èı    !.Ç" [file-name buf class no instance short super objective-C-line-length nil read-string "Interface file name: " h-file-dir h-filename create-file-buffer class-from-filename number-from-filename instance-variables class-as-short-no-comments super-hfilename set-visited-file-name "/* " insert-char 45 3 "
  348.  
  349. " "    RDR, Inc. 
  350.  
  351. " insert "    Objective-C interface file for the class " "    COPYRIGHT (C), " current-time-string -4 ", RDR, Inc.
  352. " "    ALL RIGHTS RESERVED.
  353.  
  354. " "    Responsible:            Approved:
  355. " "    RDR:" user-full-name "        
  356.  
  357. " "    Date:                Rev:
  358. " "    " eb-date "            ___
  359.  
  360. " "    Reference:            Document no:
  361. " " */
  362.  
  363. " comment-box "Interface of class " "#import \"" "\"
  364.  
  365. " "@interface " " : " "
  366. {
  367. " "
  368. }
  369. " "
  370. @end
  371. " beginning-of-buffer display-buffer] 27))
  372.  
  373. (defun generate-Objective-C-documentation nil "\
  374. Open a new buffer and write the documentation there." (interactive) (byte-code "˚ȸ³˝ ˛ P\"ˇ!— ± ¼ ½ ¾ à á     qÈâ!ÈãjÈäå    \"ÈçcÈècÈéê ë#ÈéìÆ í˚Oª#ÈîcÈéïð ñ#ÈŁcÈéØŒ º#ÈòcÈócÈô ã\"Èéõ ç#Èéö
  375. ç#Èéæ ù
  376. úç&Èéû ù
  377. ıó&Èôüã\"ÈçcÈcÈçcÈôýã\"ÈçcÈcÈçcÈôłã\"ÈëcÈcÈøcÈœ Èß    !.    Ç" [file-name buf used class super no instance short intro objective-C-line-length nil read-string "Documentation file name: " doc-dir doc-filename create-file-buffer classes-used class-from-filename super-class number-from-filename instance-variables class-as-short class-intro set-visited-file-name 0 insert-char 45 "
  378.  
  379. " "    RDR, Inc. 
  380.  
  381. " insert "    Objective-C documentation file for the class " "
  382. " "    COPYRIGHT (C), " current-time-string -4 ", RDR, Inc.
  383.  
  384. " "    Responsible:            Approved:
  385. " "    RDR:" user-full-name "        
  386.  
  387. " "    Date:                Rev:
  388. " "    " eb-date "            ___
  389.  
  390. " "    Reference:            Document no:
  391. " "
  392.  
  393.  
  394. " insert-centered "
  395.  
  396.  
  397.     Inherits from:        " "    Classes used:        " "    Interface file:        " "." ".h" "    Implementation file:    " ".m" "Introduction" "Instance Variables" "Methods" "
  398. End
  399. " beginning-of-buffer display-buffer] 31))
  400.  
  401. (defun comment-box (name) "\
  402. Print name in an comment-box" (byte-code "ˋ ?Ä ´ Èˆ È˜cȯ˘˙¨#Ȳcȯ˚¸³!#Ȳcȯ˘˙¨#È˝cÇ" [name e-empty-line-p end-of-line newline "/*" insert-centered "" 2 61 "
  403. " 0 string-to-char " " "*/
  404. "] 10))
  405.  
  406. (defun comment-line (name) "\
  407. Print name in an comment-line" (byte-code "ˋ ?Ä ´ Èˆ È˜cȯ˘˘Q˙¨#ȲcÇ" [name e-empty-line-p end-of-line newline "/* " insert-centered " " 6 45 " */
  408. "] 7))
  409.  
  410. (defun point-bol nil "\
  411. Returns the value of the point at the beginning of the current line." (byte-code "ʹ È`)Ç" [beginning-of-line] 2))
  412.  
  413. (defun within-string-p (point1 point2) "\
  414. Returns true if number of double quotes between two points is odd." (byte-code "ˆ    
  415. \"˜¯˘˙\"¨\"!?)Ç" [s point1 point2 buffer-substring zerop mod count-char-in-string 34 2] 6))
  416.  
  417. (defun count-char-in-string (c s) (byte-code "˜˜    
  418. GWÄ%
  419.     H U¯Á˜\\ÉÈ    TÉÈÁÈ*Ç" [count pos s c 0 1] 4))
  420.  
  421. (defun objective-C-protocol nil "\
  422. Build a protocol skeleton prompting for protocol name." (interactive) (byte-code "¹Èˋ´ˆ!!Ç" [nil comment-box read-string "Protocol name: "] 3))
  423.  
  424. (defun objective-C-codelimit nil "\
  425. Print name on a centered line." (interactive) (byte-code "¹Èˋ´ˆ!!Ç" [nil comment-line read-string "Centered text: "] 3))
  426.  
  427. (defun objective-C-method (prefix name) (byte-code "ˆjȘcȯ˘˙¨#ȲcÈ˚¸    ³˝˛\"¡Á ²%È—± ¼½ Qˆ\"Ȳcȯ˘˙¨#ȾcÈ˚    ²#ÈàcÈ
  428. jÈ˝á\"ÂPâcÁR²cÈ
  429. jÈãcÈäcÈåç!Ç" [prefix name objective-C-indent-level 0 "/*" insert-centered "" 2 45 "
  430. " insert "|" "| 
  431. " string-equal "-" "Return self.
  432. " insert-right user-full-name "/" eb-date "*/
  433. " "{
  434. " "+" "self = [super new];
  435. " "return self;
  436. " "}
  437.  
  438. " next-line -4] 11))
  439.  
  440. (defun objective-C-method-comment nil "\
  441. Insert a comment according to the style used with methods in GPS" (interactive) (byte-code "¹ÈˋjÈ´cȈ˜¯˘#È˙cȨ² ˚¸ Qˋ\"ȳcȈ˜¯˘#È˝cÇ" [nil 0 "/*" insert-centered "" 2 45 "
  442.  
  443.  
  444. " insert-right user-full-name "/" eb-date "
  445. " "*/
  446. "] 8))
  447.  
  448. (defun objective-C-instance-method nil "\
  449. Build a routine skeleton prompting for method name." (interactive) (byte-code "¹Èˋ ?Ä
  450. ´ Èˆ È˜¯˘˙!\"Ç" [nil e-empty-line-p end-of-line newline objective-C-method "-" read-string "Instance method name: "] 7))
  451.  
  452. (defun objective-C-factory-method nil "\
  453. Build a routine skeleton prompting for method name." (interactive) (byte-code "¹Èˋ ?Ä
  454. ´ Èˆ È˜¯˘˙!\"Ç" [nil e-empty-line-p end-of-line newline objective-C-method "+" read-string "Factory method name: "] 7))
  455.  
  456. (defun objective-C-comment-indent nil (byte-code "ˋ´!Â
  457. ˆÁʘ¯!ÈiT])Ç" [comment-column looking-at "^\\(/\\*\\|//\\)" 0 skip-chars-backward "     "] 4))
  458.  
  459. (defun electric-objective-C-keyword-match nil "\
  460. Match two following lines with keyword arguments" (interactive) (byte-code "¹ÈˋcÇ" [nil ":"] 1))
  461.  
  462. (defun electric-objective-C-brace (arg) "\
  463. Insert character and correct line's indentation." (interactive "P") (byte-code "˜È˜    ?Ä&lÄ&Ê˘˙!Èn)Å&
  464. Â%¨ È² ÈˆÁ&˜ÄK
  465. cȨ È
  466. Ä=`SÉȲ È¨ ÈÊÄFTbÈ˚¸!)ÈÂ]Êbȳ˝    !!)Áb³˝    !!)Ç" [insertpos arg objective-C-auto-newline t nil last-command-char skip-chars-backward "     " objective-C-indent-line newline delete-char -1 self-insert-command prefix-numeric-value] 12))
  467.  
  468. (defun electric-objective-C-semi (arg) "\
  469. Insert character and correct line's indentation." (interactive "P") (byte-code "´È ˆ    !Á˜¯    !!Ç" [objective-C-auto-newline arg nil electric-objective-C-terminator self-insert-command prefix-numeric-value] 4))
  470.  
  471. (defun electric-objective-C-terminator (arg) "\
  472. Insert character and correct line's indentation." (interactive "P") (byte-code "˘È˘`
  473. ?ÄPlÄPÊ˙ È¨²!Èg˚UÅN ¸=Ä3³˝!?Ä3Ê˛ˇ!È`    X)ÅN— È±`    \"¼ 8ÅM½ 8ÅM¾ 8))?Ä{ cÈà È
  474. Ämá ?Äm`SÉÈâ Èà ÈÊÄvTbÈãä!)ÈÂÍÊbÈåç
  475. !!)ÁÒåç
  476. !!*Ç" [insertpos end arg last-command-char pps objective-C-auto-newline nil beginning-of-line skip-chars-forward "     " 35 58 looking-at "case" forward-word 2 beginning-of-defun parse-partial-sexp 3 4 5 objective-C-indent-line objective-C-inside-parens-p newline delete-char -1 self-insert-command prefix-numeric-value] 16))
  477.  
  478. (defun objective-C-inside-parens-p nil (byte-code "¹ˋ´ÏÇ" [nil (byte-code "Ê̹`ˋ È`\"ÈdbÈ´`ˆ˜#Åef¯U))Ç" [narrow-to-region beginning-of-defun scan-lists -1 1 40] 6) ((error (byte-code "¹Ç" [nil] 1)))] 3))
  479.  
  480. (defun objective-C-indent-command (&optional whole-exp) (interactive "P") (byte-code "¯È˘ÈÂ?˙ ¯¯Ê Ĩ È`ÉȲ˚!È`ÉÈ
  481. bȸ˚!È`É)È
  482. VÄ;³
  483.     ˝$+ÁV ?ÄLÊ˛ˇ!Èn?)ÂT— ÁV˙ Ç" [whole-exp shift-amt beg end objective-C-tab-always-indent nil "Indent current line as C code, or in some cases insert a tab character.
  484. If objective-C-tab-always-indent is non-nil (the default), always indent current line.
  485. Otherwise, indent the current line only if point is at the left margin
  486. or in the line's indentation; otherwise insert a tab.
  487.  
  488. A numeric argument, regardless of its value,
  489. means indent rigidly all the lines of the expression starting after point
  490. so that this line becomes properly indented.
  491. The relative indentation among the lines of the expression are preserved." objective-C-indent-line beginning-of-line forward-sexp 1 forward-line indent-code-rigidly "#" skip-chars-backward "     " insert-tab] 9))
  492.  
  493. (defun objective-C-indent-line nil "\
  494. Indent current line as C code.
  495. Return the amount the indentation changed by." (byte-code "˚ˋ!ˋˋˋd`Z¸ È`ÉÈˋ=Â\"³ ÉÁ…˘=Â/˝ ÉÁ…˛ˇ!Â;—ÉÁ…±¼!È<ÄH@ÉÈ˛½!ÅR˛¾!Â`à\\]ÉÁ…˛á!ÄoÊâà!È˛ã!)ÂÈÊäå!Èçã!ÄÃâå!ÈiÉ)Á…˛è!ÄÒ˛é!?¡Êê È³ )ÉÁ…gëU®ZÉÁ…gìUÄ…    \\Éȱ¼!ÈiZÉÈÆ !Âèd
  496. Z`VÄäd
  497. ZbÁöí
  498. `\"ÈjÈd
  499. Z`VÄöd
  500. ZbÈ -Ç" [indent nil beg shift-amt case-fold-search pos t objective-C-label-offset objective-C-indent-level objective-C-brace-offset calculate-objective-C-indent beginning-of-line current-indentation calculate-objective-C-indent-within-comment looking-at "[     ]*#" 0 skip-chars-forward "     " "case\\b" "default:" 1 "[A-Za-z]" forward-sexp ":" forward-line -1 search-forward "else\\b" "else\\s_" objective-C-backward-to-start-of-if 125 123 zerop delete-region] 23))
  501.  
  502. (defun calculate-objective-C-indent (&optional parse-start) "\
  503. Return appropriate indentation for current line as C code.
  504. In usual case returns an integer: the column to indent to.
  505. Returns nil if line starts inside a string, t if in a comment." (byte-code "Êˇ È`´´´
  506. Â
  507. bÁ— È`WÄ3`Éȱ`¼#ÉÈ A@ÉÈÁȽ 8Å=¾ 8ÂF¾ 8ÁÞ ?›bÈàá!ÈgâUÂ\\¼Á“ã
  508. Åbe!ÈÊäå´ç#Èèé!ÄËèê!ÄËë¼!SbÈìÆ!È`WÄËgí>?ÂÓÁÔ¼)oÅ©hª>§¼Á¤¼\\)ÁÞî fâ\"‰ TbÈiÁÞbÈã !Èhï=ÅÆhð=ÄÆ`ñZfŁ=ÅÆØ`ñZf!Œ>Äłhï=Äóº !Èˇ Èã !ÈÁ˜Èhò>? º !È    i\\ÁÞ bÈÊóÆ!ȼ
  509. àô!Èèõ!ÄOgöUÂ,æÆ!ÁKgùUÂ>óñ!Èúû´ç#ÁKÊı È`É
  510. )Èúü!ÈÁÈ`WÄf
  511. `VÂeý  ZÁfi))ÅÞłnÄtø !Â
  512.     \\ÁÀ œá!ÈnÂͼÁÏhß=ÄÚìþ!Èý #,)Ç" [indent-point case-fold-search nil state containing-sexp parse-start basic-indent objective-C-argdecl-indent t objective-C-continued-statement-offset colon-line-end objective-C-label-offset objective-C-indent-level objective-C-brace-offset objective-C-brace-imaginary-offset beginning-of-line beginning-of-defun parse-partial-sexp 0 3 4 skip-chars-forward "     " 123 objective-C-backward-to-noncomment re-search-backward "^[^      
  513. #]" move looking-at "\\sw\\|\\s_" ".*(" match-end forward-sexp 1 (44 59) (41 59 125) /= 44 58 2 39 char-syntax (119 95) objective-C-backward-to-start-of-continued-exp (nil 44 59 125 123) forward-char "     
  514. " "#\\|/\\*\\|case[     
  515. ].*:\\|[a-zA-Z0-9_$]*:" 35 forward-line 47 search-forward "*/" end-of-line ":" current-indentation + zerop skip-chars-backward 41 -1] 34))
  516.  
  517. (defun calculate-objective-C-indent-within-comment nil "\
  518. Return the indentation amount for line, assuming that
  519. the current line is to be regarded as part of a block comment." (byte-code "ˆˆʘ È¯˘!Èg˙UÉȨ²!È`ÉȘ È¯˘!È˚¸´#Ä2    Ä2³˝!TbÈi)*Ç" [end star-start t nil beginning-of-line skip-chars-forward "     " 42 skip-chars-backward "     
  520. " re-search-forward "/\\*[     ]*" match-beginning 0] 9))
  521.  
  522. (defun objective-C-backward-to-noncomment (lim) (byte-code "˜˜    ?Ä`¯˘
  523. \"È`ÉÈ`˙
  524. \\YÄ#ʨ²!È˚¸!)Â.³˝
  525. ˛#Á\\³ˇ— 
  526. ]˛#Ä>±`\"?Å\\¼ È½¾!È˚à!ÂV`
  527. XÉÁ\\ˆÉÈbÈÁ*Ç" [opoint stop lim t nil skip-chars-backward "     
  528. " 2 forward-char -2 looking-at "\\*/" search-backward "/*" move "//" point-bol within-string-p beginning-of-line skip-chars-forward "     " "#"] 13))
  529.  
  530. (defun objective-C-backward-to-start-of-continued-exp (lim) (byte-code "hˋUÄ    ´ˆ!Ș È`XÄTbȯ˘!Ç" [lim 41 forward-sexp -1 beginning-of-line skip-chars-forward "     "] 4))
  531.  
  532. (defun objective-C-backward-to-start-of-if (&optional limit) "\
  533. Move to the start of the last ``unbalanced'' if." (byte-code "Šʘ È`)Éȯˆ˘    !?ÄF˙¯!Ȩ²!Â)    TÉÁB¨˚!Â6    SÉÁB`WÄB¸ÉÈbÈÁ*Ç" [limit if-level case-fold-search nil beginning-of-defun 1 zerop backward-sexp looking-at "else\\b" "if\\b" 0] 8))
  534.  
  535. (defun mark-objective-C-function nil "\
  536. Put mark at end of C function, point at beginning." (interactive) (byte-code "¹Èˋ`!È´ Èˋ`!Ȉ È˜ Ç" [nil push-mark end-of-defun beginning-of-defun backward-paragraph] 6))
  537.