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

Weird emacs autoload question



>>>>> "Colin" == Colin Telmer <telmerco@qed.econ.queensu.ca> writes:

Colin> ... However, if I first load the latex file, and then load the
Colin> bibtex file, bibtex-mode is successfully loaded, but
Colin> font-lock-mode and auto-fill-mode are not. The *messages*
Colin> buffer gives me the following:

Colin> Loading bibtex...  
Colin> Loading bibtex...done 
Colin> File mode
Colin> specification error: (invalid-function (macro . #[(&rest cdr)
Colin> "\300\301BD\207" [function lambda cdr] 3 758067]))

The first thing to try, is to run without your .emacs (for instance by
starting emacs as "emacs -q" doing the necessary mode changes by
hand). If the problem disappears, you are doing something wrong, and
can start outcommenting thing in .emacs to see where the problem is.

If that does not help, there is little left than to debug the darn
thing, for instance by evaluating something like this:

	(progn (debug) (find-file "test.tex") (find-file "test.bib"))

and singlestep you through the latter `find-file'.

I can't off hand see any problems with your .emacs, though I'm a
little unsure on your hook settings. You should consider using
`add-hook' (rather than `setq') which works as follows:

    add-hook: a compiled Lisp function.
    (add-hook HOOK FUNCTION &optional APPEND LOCAL)

    Add to the value of HOOK the function FUNCTION.
    FUNCTION is not added if already present.
    FUNCTION is added (if necessary) at the beginning of the hook list
    unless the optional argument APPEND is non-nil, in which case
    FUNCTION is added at the end.

    The optional fourth argument, LOCAL, if non-nil, says to modify
    the hook's buffer-local value rather than its default value.
    This makes no difference if the hook is not buffer-local.
    To make a hook variable buffer-local, always use
    `make-local-hook', not `make-local-variable'.

    HOOK should be a symbol, and FUNCTION may be any valid function.  If
    HOOK is void, it is first set to nil.  If HOOK's value is a single
    function, it is changed to a list of functions.

One difference is that add-hook maintain the hook as a list, whereas
your hooks are lambda values, at least in some cases. That could make
a difference to BibTeX-mode.

Hope it helps.


---------------------------+--------------------------------------------------
Christian Lynbech          | Computer Science Department, University of Aarhus
Office: R0.32              | Ny Munkegade, Building 540, DK-8000 Aarhus C
Phone: +45 8942 3218       | lynbech@daimi.aau.dk -- www.daimi.aau.dk/~lynbech
---------------------------+--------------------------------------------------
Hit the philistines three times over the head with the Elisp reference manual.
                                        - petonic@hal.com (Michael A. Petonic)


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: