all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Change the default binding of C-x C-e ?
@ 2008-01-06 11:41 Mike Mattie
  2008-01-06 14:59 ` Leo
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Mike Mattie @ 2008-01-06 11:41 UTC (permalink / raw)
  To: emacs developers


[-- Attachment #1.1: Type: text/plain, Size: 690 bytes --]

Hello,

I think it is a good idea to change the default key-binding of C-x C-e to eval-defun. From a reading of the Elisp
Intro I became used to using the usual binding which is eval-last-sexp. Things worked fine until I progressed
in elisp to where I wanted to use defvar. As the informed have probably surmised I was baffled by the results
because repeated evaluation did not affect the default value.

While reading through the manuals I stumbled across eval-defun and realized what was going on. AFAICT they
are effectively the same in use, however eval-defun does not have suprising corner cases like defvar default
values.

FWIW it may help others to change this binding.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: Change the default binding of C-x C-e ?
@ 2008-01-06 17:21 Robert J. Chassell
  2008-01-06 19:45 ` Tom Tromey
  0 siblings, 1 reply; 10+ messages in thread
From: Robert J. Chassell @ 2008-01-06 17:21 UTC (permalink / raw)
  To: emacs-devel

    Things worked fine until I progressed in elisp to where I wanted
    to use defvar.

(info "(eintr)defvar")
says

       The `defvar' special form ... only sets the value of the
    variable if the variable does not already have a value.

I just checked this:  I can use C-x C-e (eval-last-sexp) to set the
value of a variable with `defvar' for the first time.  As described in
the Introduction, I cannot change the value a second time with
`defvar' and `eval-last-sexp'; for that, I must use `setq'.

Today's GNU Emacs CVS snapshot, Sun, 2008 Jan  6  11:10 UTC
GNU Emacs 23.0.50.21 (i686-pc-linux-gnu, GTK+ Version 2.12.1)

--
    Robert J. Chassell                          GnuPG Key ID: 004B4AC8
    bob@rattlesnake.com                         bob@gnu.org
    http://www.rattlesnake.com                  http://www.teak.cc

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-01-07  6:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-06 11:41 Change the default binding of C-x C-e ? Mike Mattie
2008-01-06 14:59 ` Leo
2008-01-06 15:14   ` Mike Mattie
2008-01-06 15:17 ` Alan Mackenzie
2008-01-06 20:35   ` Stefan Monnier
2008-01-07  6:53     ` Andreas Röhler
2008-01-07  4:18 ` Richard Stallman
  -- strict thread matches above, loose matches on Subject: below --
2008-01-06 17:21 Robert J. Chassell
2008-01-06 19:45 ` Tom Tromey
2008-01-07  0:15   ` Stephen J. Turnbull

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.