[erlang-questions] Autosaving *.erl in emacs before compilation
Roberto Saccon
rsaccon@REDACTED
Thu Jun 14 22:06:06 CEST 2007
thanks, now it works like a charm
On 6/14/07, Bill Clementson <billclem@REDACTED> wrote:
> On 6/14/07, Roberto Saccon <rsaccon@REDACTED> wrote:
> > thanks, however I get an error when I use define-key erlang-mode-map
> > when loading emacs:
> >
> > Wrong type argument: keymap, nil
> >
> > everything works fine with global-set-key or with define-key and just
> > reloading the ermacs preferences file.
>
> Sorry - I forgot to mention that you should have the define-key inside
> of your erlang-mode hook in your .emacs file. for example:
> (add-hook 'erlang-mode-hook
> (lambda ()
> (define-key erlang-mode-map [f5]
> (lambda ()
> (interactive)
> (progn
> (save-buffer)
> (erlang-compile)
> (erl-reload-modules (erl-target-node)))))))
>
> The reason you're getting the error is that you're defining a key for
> erlang-mode-map before erlang-mode-map has been defined. By wrapping
> the key definition in the add-hook statement, you're ensuring that it
> is defined once erlang-mode has started up.
>
> --
> Bill Clementson
>
--
Roberto Saccon
More information about the erlang-questions
mailing list