help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: How to load a lisp file automatically


From: Joakim Hove
Subject: Re: How to load a lisp file automatically
Date: Fri, 12 Dec 2003 13:47:43 +0100
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux)

Kin Cho <address@hidden> writes:

>> (setq load-path (cons "~/" load-path))
>> (require 'setnu)
>> (add-hook 'text-mode-hook 'turn-on-setnu-mode)
>
> Try adding to the bottom of setnu.el (and byte-compile it again):
>
> (provide 'setnu)

An another solution (it is always a good idea to (provide
'your-lisp)), but instead of (require 'setnu) you could use:

  (autoload 'turn-on-setnu-mode "setnu" "Automatically load file setnu" 't)

The purpose of this is to setup a connection between a function
(turn-on-setnu-mode), and a file ("setnu.el(c)") which contains an
implementation of that function.

HTH - Joakim

-- 
  /--------------------------------------------------------------------\
 / Joakim Hove  / address@hidden  /  (55 5) 84076       |                 \
 | Unifob AS, Avdeling for Beregningsvitenskap (BCCS) | Stabburveien 18 |
 | CMU                                                | 5231 Paradis    |
 \ Thormøhlensgt.55, 5020 Bergen.                     | 55 91 28 18     /
  \--------------------------------------------------------------------/


reply via email to

[Prev in Thread] Current Thread [Next in Thread]