tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: emacs using /usr/share/misc/NetBSD.el



On 12.02.2009, Roy Marples wrote:
> 1) What's the best way to actually use it?
> Currently I have (load "/usr/share/misc/NetBSD.el") in ~/.emacs
> Is there someway of autoloading it so I can do this instead
> (setq c-default-style "netbsd-knf")
> or similar?

One way to do that:

(add-hook 'c-mode-common-hook 'netbsd-knf-c-mode-hook)

To make life easier, you could also do something like:

(setq auto-mode-alist
      (append '(("\\.c$"   . c-mode))
              '(("\\.h$"   . c-mode))
              '(("\\.cc$"  . c++-mode))
              '(("\\.cpp$" . c++-mode))
              '(("\\.erl$" . erlang-mode))
              '(("\\.hsk$" . haskell-mode))
              '(("\\.tex$" . tex-mode))
              '(("\\.bib$" . bibtex-mode))
              '(("\\.py$"  . python-mode))
              '(("\\.ac$"  . autoconf-mode))
              '(("\\.in$"  . autoconf-mode))
              auto-mode-alist))
> 
> 2) is (brace-list-entry . 8) correct as it formats
> static const int foo[] = {
>       ONE,
>       TWO,
>       THREE
> };
> 
> as
> 
> static const int foo[] = {
>       ONE,
>               TWO,
>               THREE
> };

I have noticed the same thing. I think this is broken in NetBSD.el.

- Jukka.


Home | Main Index | Thread Index | Old Index