Using a Custom Emacs mode

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Using a Custom Emacs mode

Zach Flynn
Ok, so I have an emacs mode that I'd like to use but I don't know how to
actually use it in emacs.  For some strange reason, I can't find that
explained anywhere.  Can someone tell me how to use a mode that's
written for emacs?  It's not one of those ones that emacs comes with.

-Zach
_______________________________________________
Gnu-emacs-sources mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/gnu-emacs-sources
Reply | Threaded
Open this post in threaded view
|

Re: Using a Custom Emacs mode

Kevin Rodgers
Zach Flynn wrote:
 > Ok, so I have an emacs mode that I'd like to use but I don't know how to
 > actually use it in emacs.  For some strange reason, I can't find that
 > explained anywhere.  Can someone tell me how to use a mode that's
 > written for emacs?  It's not one of those ones that emacs comes with.

Short answer:

M-x load-file RET foo.el
M-x foo-mode

Long answer:

You will make things easier on yourself by putting foo.el in the system
site-lisp directory (C-h v load-path) or in any directory of your
choosing that you add to load-path (by modifying your ~/.emacs file).

You will make things run much faster if you M-x byte-compile-file foo.el
(before loading it).

foo.el will likely contain installation instructions in the comment
block near the top of the file, which will suggest autoload commands to
add to your system's default.el file or your personal .emacs file (so
you don't have to explicitly load it).

The installation instructions will also likely show you how to add an
entry to auto-mode-alist, to invoke foo-mode automatically when editing
files with that mode's conventional name.

P.S.  Please post questions to gnu.emacs.help in the future; that's
where I've directed followups to this message.

--
Kevin Rodgers



_______________________________________________
Gnu-emacs-sources mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/gnu-emacs-sources
Reply | Threaded
Open this post in threaded view
|

Re: Using a Custom Emacs mode

Zach Flynn
In reply to this post by Zach Flynn
nvm.  The problem has been solved thanks to emacs wiki :-)

-Zach
_______________________________________________
Gnu-emacs-sources mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/gnu-emacs-sources
Reply | Threaded
Open this post in threaded view
|

Re: Using a Custom Emacs mode

Tom Breton
In reply to this post by Zach Flynn
[F'ups to gnu.emacs.help]

Zach Flynn <[hidden email]> writes:

> Ok, so I have an emacs mode that I'd like to use but I don't know how to
> actually use it in emacs.  For some strange reason, I can't find that
> explained anywhere.  Can someone tell me how to use a mode that's
> written for emacs?  It's not one of those ones that emacs comes with.
>
> -Zach

In the buffer you want to use it in, you can call it like any other
emacs command.  Like:

    M-x zachs-mode

You should also look at the Elisp docs under "Modes".  Especially read
about the variable auto-mode-alist.

--
Tom Breton, the calm-eyed visionary
_______________________________________________
Gnu-emacs-sources mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/gnu-emacs-sources