Roland Stigge <[EMAIL PROTECTED]> wrote: > On Wed, 2003-08-13 at 17:24, Roland Stigge wrote: > > +(eval-after-load "latex" > > + (add-to-list 'after-load-alist > > + '("latex" (define-key LaTeX-mode-map > > + (kbd "C-c C-c h") > > + 'hyperlatex-format-buffer))) > > + (define-key LaTeX-mode-map > > + (kbd "C-c C-c h") > > + 'hyperlatex-format-buffer)) > > ====================================================================== > > Or even better: > > ====================================================================== > --- debian/42hyperlatex.el 2003-05-19 15:25:18.000000000 +0200 > +++ debian/42hyperlatex.el.new 2003-08-10 18:14:08.000000000 +0200 > @@ -5,4 +5,11 @@ > (parse-colon-path (getenv "HYPERLATEX_DIR")))) > (autoload 'hyperlatex-format-buffer "hyperlatex/hyperlatex" > "Process the current buffer as hyperlatex code, into a Html > document." t) > -(global-set-key "\C-ch" 'hyperlatex-format-buffer) > +(eval-after-load "latex" > + '(add-to-list 'after-load-alist > + '("latex" (define-key LaTeX-mode-map > + (kbd "C-c C-c h") > + 'hyperlatex-format-buffer))) > + (define-key LaTeX-mode-map > + (kbd "C-c C-c h") > + 'hyperlatex-format-buffer)) > ====================================================================== > > :) > > ?
No, not really. `eval-after-load' will by itself hack the after-load-list or run the code now if the file is already loaded. So something like: (eval-after-load "latex" '(define-key LaTeX-mode-map "\C-c\C-ch" 'hyperlatex-format-buffer)) But use a different key again. C-c C-c is already used in AUC-TeX's LaTeX-mode-map: C-c C-c runs the command TeX-command-master Peter