Subject: Re: standard .el file to setup styles?
From: Aaron Lehmann (aaronl@vitelus.com)
Date: Sat Jan 27 2001 - 15:22:37 CST
On Sat, Jan 27, 2001 at 08:09:13AM +0100, Jesper Skov wrote:
> >>>>> "Sam" == Sam TH <sam@uchicago.edu> writes:
> Sam> tabs). Then, we add the following at the end of all the source
> Sam> files:
>
> I like the idea of an emacs spec file in the repo.
>
> I don't like cluttering all the files with the reference to it though.
> Rather we do it like:
Good idea.
> abiword.el:
> ---------------------------------------------------------------
> (defun abi-c-mode ()
> "C mode with adjusted defaults for use with the AbiWord sources."
> (interactive)
> (c++-mode)
> (c-set-style "K&R")
> (setq c-basic-offset 4)
> (setq indent-tabs-mode t)
> (show-paren-mode 1)
> (setq tab-width 4)
>
> (setq auto-mode-alist
> (cons '(".*/abiword/.*\\.[ch].*$" . abi-c-mode)
> auto-mode-alist))
Since a regexp matches any part of a string, not the whole string, the
.*'s in the beginning and end are repetitive and slow it down. Try:
"/abi/.*\\.\\(c\\(pp\\)?\\|h\\)$"
That should be somewhat more efficent and more specific.
Also it matches /abi/ rather than /abiword/, since abi is the default
top-level directory name.
This archive was generated by hypermail 2b25 : Sat Jan 27 2001 - 15:22:43 CST