Skip to content

Instantly share code, notes, and snippets.

@legumbre
Created March 23, 2012 23:16
Show Gist options
  • Save legumbre/2176240 to your computer and use it in GitHub Desktop.
Save legumbre/2176240 to your computer and use it in GitHub Desktop.
magic-mode-alist and cc-other-file-list
;; load objc-mode for objective-C header files
(add-to-list 'magic-mode-alist
'((lambda ()
(and (string= (file-name-extension buffer-file-name) "h")
(re-search-forward "@\\<interface\\>" magic-mode-regexp-match-limit t)))
. objc-mode))
;;set .m <-> .h correspondence for ff-find-other-file
(add-hook 'objc-mode-hook
(lambda ()
(set (make-local-variable 'cc-other-file-alist) '(("\\.m\\'" (".h")) ("\\.h\\'" (".m" ".c" ".cpp"))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment