[PLUG] Emacs modes.

Jeme A Brelin jeme at brelin.net
Mon May 20 15:50:48 UTC 2002


On Mon, 20 May 2002, Galen Seitz wrote:
> Emacs doesn't automatically scan or load the files in
> /usr/share/emacs/site-lisp, so it doesn't know where to find the function
> called lilypond-mode.  Try adding this line to your .emacs.
> 
> (autoload 'lilypond-mode "lilypond-mode" "LilyPond major mode." t)
> 
> This will cause emacs to load lilypond-mode.el or .elc when the 
> lilypond-mode function is executed.  Once the file is loaded, all of the
> emacs lilypond functions will be available.
> 
> Alternatively, you add this to /usr/share/emacs/site-lisp/site-start.el.
> This eliminates the need to modify the individual ~/.emacs files.

Awesome, Galen.  Thanks.  Not only did you answer the question with enough
information to make sense, you anticipated my next question (about
site-wide configuration) and answered that, too.

Thanks heaps.

> You will probably still want to add a line like this:
> 
> (setq auto-mode-alist (cons '("\\.ly$" . lilypond-mode) auto-mode-alist))

Right.  I did that much.

> If you add the autoload line from above, you will be able to enter
> lilypond-mode from an empty buffer by typing M-x lilypond-mode.  However,
> I would suggest a slightly different approach.  I rarely if ever start
> editing in an empty buffer.  I usually do a C-x C-f to start editing a
> new file.  By doing it this way the buffer is automatically put into
> the mode indicated by the filename extension.  For instance, if I do
> C-x C-f new.c, I get a new buffer named new.c that is in C-mode.  If
> you changed your mind about the file name, you can just write the buffer
> out to a different name with C-x C-w.

This approach made sense to me as soon as I opened emacs and wanted a new,
empty buffer.  After following the tutorial, the only way I knew to do
such a thing was to create a new, empty file.

Understand that my initial reluctance to just follow the information given
in the instructions that came with lilypond was based entirely on the fact
that it meant changing only my local .emacs file and didn't help with
site-wide configuration.

Thanks heaps.
J.
-- 
   -----------------
     Jeme A Brelin
    jeme at brelin.net
   -----------------
 [cc] counter-copyright
 http://www.openlaw.org





More information about the PLUG mailing list