0

I am working on configuring ERC. As a starting point I'm copying portions of the sample configuration file. So my .ercrc.el file begins with something this (taken straight from that guide):

(global-set-key "\C-cef" (lambda () (interactive)
                           (erc :server "irc.freenode.net" :port "6667"
                                :nick "MYNICK")))

My problem is that if I change any of the parameters to erc inside the lambda, move to the end of the file, and I re-evaluate the file by pressing C-x C-e, the key still contains the old configuration values. The only way to make the change stick is to quit and open emacs again. How can I change what the C-c e f shortcut does without restarting emacs?

dzz
  • 103
  • 1

1 Answers1

1

move to the end of the file, and I re-evaluate the file by pressing C-x C-e

That's not what C-xC-e does.

C-hkC-xC-e tells you:

C-x C-e runs the command eval-last-sexp
...
Evaluate sexp before point

That's the single expression before point; definitely not "the file".

You can evaluate the whole buffer with M-x eval-buffer.

phils
  • 48,657
  • 3
  • 76
  • 115