Weird emacs autoload question
emacs seems to be having trouble loading a BibTeX file _only_ after
loading a LaTeX file. for example, I have three files in my home
directory, test.f, test.tex, and test.bib. The autoload commands I have in
my .emacs file are listed below (the whole .emacs file is there for
reference). If I load just one of these files, the particular mode(ie
bibtex-mode), font-lock-mode and auto-fill-mode start up successfully. If
I load the fortran file and then the BibTeX file, then fortran-mode,
font-lock mode, auto-fill mode, and bibtex-mode all get properly loaded.
However, if I first load the latex file, and then load the bibtex file,
bibtex-mode is successfully loaded, but font-lock-mode and
auto-fill-mode are not. The *messages* buffer gives me the following:
Loading bibtex...
Loading bibtex...done
File mode specification error: (invalid-function (macro . #[(&rest cdr)
"\300\301BD\207" [function lambda cdr] 3 758067]))
(I had to type the \300\301 \207 in myself, must be control chars and cut
and paste wouldn't handle them).
Any idea what is wrong? I am running hamm and
ii tetex-base 0.4pl6-5 teTeX library files
ii tetex-bin 0.4pl6-8 teTeX binary files
ii tetex-dev 0.4pl6-8 kpathsea.a and include files for teTeX
ii tetex-doc 0.4pl6-1 teTeX documentation
ii tetex-extra 0.4pl6-4 teTeX library files
Below is my .emacs file. Any help is gratefully appreciated. Cheers,
Colin.
----------------------begin
;; Colin Telmer, telmerco@qed.econ.queensu.ca
;; .emacs customization file
;; Directory for personal elisp code.
(setq load-path (append load-path (list "/usr/lib/emacs/site-lisp")))
;; Key mappings
(global-set-key [mouse-3] 'find-tag)
;; Make backup files
(setq make-backup-files t)
;; Turn on column number mode
(setq column-number-mode 1)
;; Parentheses matching
(require 'paren)
;; Set the line length before it wraps - Change it locally with [C-x f]
(setq-default fill-column 77)
;; Make the RETURN key behave as the LFD key
(defun RET-behaves-as-LFD ()
(let ((x (key-binding "\C-j")))
(local-set-key "\C-m" x)))
;; Set up emacs to recognize certain files types and load the
;; major mode associated with the type.
(setq auto-mode-alist (mapcar 'purecopy
'(("\\.bib$" . bibtex-mode)
("\\.a$" . c-mode)
("\\.c$" . c-mode)
("changelog" . debian-changelog-mode)
("\\.h$" . c-mode)
("\\.el$" . emacs-lisp-mode)
("\\.emacs" . emacs-lisp-mode)
("\\.f$" . fortran-mode)
("\\.m90$" . f90-mode)
("\\.f90$" . f90-mode)
("\\.html$" . html-mode)
("Makefile" . makefile-mode)
("\\.m$" . octave-mode)
("\\.octaverc" . octave-mode)
("\\.tex$" . TeX-mode)
("\\.txi$" . Texinfo-mode))))
;;;;;;;;;;;;;;;;;;;;;;;; Mode Definitions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; BiBTeX mode
(setq bibtex-mode-hook
'(lambda ()
(auto-fill-mode 1)
(if (eq window-system 'x)
(font-lock-mode 1))
))
;; Debian-changelog-mode
(autoload 'debian-changelog-mode "debian-changelog-mode" nil t)
(add-hook 'debian-changelog-mode
(lambda ()
(if (eq window-system 'x)
(font-lock-mode 1))
))
;; Elisp mode
(setq emacs-lisp-mode-hook
'(lambda ()
(if (eq window-system 'x)
(font-lock-mode 1))
))
;; F77 mode
(setq fortran-mode-hook
'(lambda ()
(auto-fill-mode 1)
(if (eq window-system 'x)
(font-lock-mode 1))
))
;; F90 mode
(setq f90-mode-hook
'(lambda ()
(setq f90-do-indent 3
f90-if-indent 3
f90-type-indent 3
f90-program-indent 2
f90-continuation-indent 5
f90-comment-region "!!$"
f90-directive-comment-re "!hpf\\$"
f90-indented-comment-re "!"
f90-break-delimiters "[-+\\*/,><=% \t]"
f90-break-before-delimiters t
f90-beginning-ampersand t
f90-smart-end 'blink
f90-auto-keyword-case 'upcase-word
f90-leave-line-no nil
f90-startup-message t
indent-tabs-mode nil
fill-column 80)
;;The rest is not default.
(abbrev-mode 1) ; turn on abbreviation mode
(f90-auto-fill-mode 1) ; turn on auto-filling
(column-number-mode 1) ; turn on column number mode
(if (eq window-system 'x)
(font-lock-mode 1)) ; for highlighting
(if f90-auto-keyword-case ; change case of all keywords on startup
(f90-change-keywords f90-auto-keyword-case))
))
;; Fundamental mode
(setq fundamental-mode-hook
'(lambda ()
(turn-on-auto-fill)
))
;; HTML mode
(setq html-mode-hook
'(lambda ()
(if (eq window-system 'x)
(font-lock-mode 1))
))
(setq sgml-mode-hook
'(lambda ()
(if (eq window-system 'x)
(font-lock-mode 1))
))
;; Makefile mode
(setq makefile-mode-hook
'(lambda ()
(if (eq window-system 'x)
(font-lock-mode 1))
))
;; Octave mode
(autoload 'octave-mode "octave-mod" nil t)
(autoload 'run-octave "octave-inf" nil t)
(add-hook 'octave-mode-hook
(lambda ()
(setq octave-send-echo-input nil)
(abbrev-mode 1)
(auto-fill-mode 1)
(RET-behaves-as-LFD)
(if (eq window-system 'x)
(font-lock-mode 1))
))
(add-hook 'inferior-octave-mode-hook
(lambda ()
(turn-on-font-lock)
(define-key inferior-octave-mode-map [up]
'comint-previous-input)
(define-key inferior-octave-mode-map [down]
'comint-next-input)
))
;; TeX/LaTeX
(setq TeX-mode-hook
'(lambda ()
(if (eq window-system 'x)
(font-lock-mode 1))
))
;; Text mode
(setq text-mode-hook
'(lambda ()
(turn-on-auto-fill)
))
-------------------end
--
Colin R. Telmer, Institute of Intergovernmental Relations
School of Policy Studies, Queen's University
Kingston, Ontario, Canada, K7L-3N6
(613)545-6000x4219 telmerco@qed.econ.queensu.ca
PGP Fingerprint = 09 E9 DA 66 9C EE 33 DC B8 3B 97 0E 01 BC EC 0B
PGP Public Key at <URL:http://terrapin.econ.queensu.ca>
--
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: