Created
January 29, 2009 16:31
-
-
Save rubyist/54609 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; My conventions for Cocoa are Foo.h - but the auto-mode-alist | |
;; searches with sensitivity based on case-fold-search, this function | |
;; will check for that and set Foo.h to objc-mode while keeping foo.h | |
;; in c-mode. | |
(defun determine-header-objc-ness () | |
(let (sensitivity) | |
(setq sensitivity case-fold-search) | |
(setq case-fold-search nil) | |
(if (string-match "^[A-Z].*\\.h$" (buffer-name)) | |
(objc-mode) | |
(c-mode)) | |
(setq case-fold-search sensitivity))) | |
(add-to-list 'auto-mode-alist '("\\.h$" . determine-header-objc-ness)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment