Skip to content

Commit

Permalink
Recognize Objective C files (extensions .m and .h) by their content.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidswelt committed Aug 15, 2009
1 parent 1e9fd20 commit 5e3bf43
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 4 deletions.
37 changes: 33 additions & 4 deletions aquamacs/doc/latex/changelog.tex
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,26 @@ \subsection{Changes--- 2.0preview1}
\end{itemize}
\subsection{Changes--- 1.8dev}
\subsection{Changes--- 1.9}
\emph{Interested in trying out the Emacs 23 Cocoa version of Aquamacs? As of Spring 2008, we're still working \emph{on} it, but we're also already working \emph{with} it.
\url{http://aquamacs.org/nightlies.shtml}}
\begin{itemize}
\item Copy (Command-c) works again reliably for text selected by mouse. However, the previous improvement avoiding duplicate entries in the kill ring has been reverted.
Reported by Tom van Vleck.
\item Jumping to a LaTeX error after compilation works more reliably now. The LaTeX-command setting has been changed to include `file-line-error' style.
Suggested by Enrico Franconi.
\item Recognize Objective C files (extensions .m and .h) by their content.
Patch by Kendall Gelner and D.R.
\end{itemize}
\subsection{Changes--- 1.8c}
\begin{itemize}
Expand All @@ -62,9 +81,15 @@ \subsection{Changes--- 1.8dev}
\item The mark is now deactivated when point is restored while switching tabs (in transient-mark-mode, which is on by default).
\item Command-C (clipboard-kill-ring-save) will take care not to create duplicate entries in the kill ring.
Reported by Konrad Podczeck.
\item Fixed a rare failure of dired to view directories.
Reported by Uwe Pieczynski.
\item Fixed a startup failure when environment variables with values where used that could no be encoded with the coding system assigned to the system's ``input source'' language. (`locale-coding-system' is now set according to the locale in the default login shell.)
Reported by André Berg.
\item Fixed an error when deleting the whole buffer contents while smart-spacing-mode was on.
Patch by Jon Shea.
Expand All @@ -74,9 +99,9 @@ \subsection{Changes--- 1.8dev}
\item `LaTex-mode-hook' can now be customized and saved through the
customization interface.
Reported by Bruno Cadonna.
\item ESS (R-mode) will now retain an active mark (and region) after evaluating code, e.g. with C-c C-r.
\item ESS (R-mode) will now retain an active mark (and region) after evaluating code, e.g. with C-c C-r.
\item In the keyboard emulation modes that allow the mac-native use of Option on various keyboard layouts, while retaining Option as Meta key for Emacs, ESC key sequences always act as Meta sequences. For instance, with the German layout, ESC-l acts as `downcase-word' (the original M-l binding), while Option-l inserts the @ sign.
\item Adopting fonts as default fonts for frames: keep frames inside screen.
Expand All @@ -92,9 +117,13 @@ \subsection{Changes--- 1.8dev}
\item Version 1.8b: Avoid hang during startup when remote, now inaccessible files were edited during a previous session.
Reported by Christopher Menzel.
\item Version 1.8b: org-mode is now used automatically for all {\tt .org} files.
\item Version 1.8c: AUCTeX is used again as latex-mode
Reported by Herbert Korté.
\end{itemize}
\subsection{Changes--- 1.7}
\begin{itemize}
Expand Down
15 changes: 15 additions & 0 deletions aquamacs/src/site-lisp/aquamacs-mode-defaults.el
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,25 @@
;; we don't have a REALBasic mode yet
(autoload 'rails-minor-mode "rails.el" "Enter Ruby on Rails mode" 'interactive nil)

;; Matlab
(autoload 'matlab-mode "matlab" "Enter MATLAB mode." t)
(autoload 'matlab-shell "matlab" "Interactive MATLAB mode." t)
(assq-set-equal "\\.m$" 'matlab-mode 'auto-mode-alist)

;; Objective C

(defun objc-mode-buffer-check ()
(if (string-match "\\.m$" buffer-file-name)
(save-restriction
(narrow-to-region (point-min)
(min (point-max)
(+ (point-min) magic-mode-regexp-match-limit)))
(looking-at "\\(.\\|\n\\)*#\\(include\\|define\\)"))))

(setq magic-mode-alist
(append '(("\\(.\\|\n\\)*\n@\\(implementation\\|interface\\|protocol\\)" . objc-mode)
(objc-mode-buffer-check . objc-mode))
magic-mode-alist))

;; ---------------------------------------------------------
;; PERL EDITING
Expand Down

0 comments on commit 5e3bf43

Please sign in to comment.