Newbie: Help with elisp, please
Hello,
I'm relatively new to *customizing* emacs. I've been using emacs for
a while, though not efficiently. I would like to learn how to do
things more effectively and efficiently. To start with, I'm trying
to setup some LaTeX keyboard mappings that *I* want. I have setup a
few function definitions in a file called latex.el which has a
general form similar to the following:
<snip>
(setq latex-skel-file '"~//TeX//skeleton.tex")
(defun skel ()
"Read in LaTeX Document Skeleton"
(interactive)
(insert-file latex-skel-file)
)
(defun prit ()
(interactive)
(set 'str "\\prit{}")
(insert str)
(backward-char 1)
)
(defun prbf ()
(interactive)
(set 'str "\\prbf{}")
(insert str)
(backward-char 1)
)
(define-key latex-mode-map "\C-cb" 'prbf)
(define-key latex-mode-map "\C-ci" 'prit)
(define-key latex-mode-map [f5] 'skel)
</snip>
Now, whenever I try to byte-compile this code, I get the message:
<snip>
Compiling file /home/frodo/emacs/latex.el at Wed Apr 28 13:00:35 2004
** assignment to free variable latex-skel-file
** assignment to free variable str
** reference to free variable latex-skel-file
While compiling prit:
** reference to free variable str
While compiling prbf:
** reference to free variable str
</snip>
I have also had messages telling me that the value of the variable
latex-mode-map is void. I don't understand how to deal with this. I
have been trying to read through the emacs manual and reference
guides available online, but there is no reference to dealing with
such problems.
Could someone please help me? I know that there are pre-defined
key-bindings for latex-mode, but I'd rather setup my own that I know
work the way I want them to.
I would very much appreciate any help.
Thanks in advance,
(PS: Please do not CC me in your reply; I read the list)
--
+--------------------------+-------------------------------+
|Brad Camroux | === http://www.debian.org === |
|Student | ============================= |
|Geophysics & Applied Math | Proud admin and user of Debian|
|University of Calgary | since 2003... because Red Hat |
|Calgary, AB, Canada | just didn't cut it |
+--------------------------+-------------------------------+
Reply to: