[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Why is `C-M-x' only for top-level defuns?

From: Drew Adams
Subject: RE: Why is `C-M-x' only for top-level defuns?
Date: Thu, 12 Jan 2012 07:29:19 -0800

> With anything, you can put point in any sexp of a block an eval it.
> If needed you can edit it in minibuffer to provide a result.
> Here cursor is on the let sexp and i hit `C-u C-:' and then edit it to
> have a value for 'a' and 'b'.
> (defun foo (a b)
>   -!-(let ((c (+ a b))) (+ a b c)))

See my earlier message and my reply to Stephen T.

1. The question is not about whether there are handy ways to edit a
subexpression and evaluate it.  It's about hitting a key to redefine a face or
var, regardless of where the face or var definition is (column 0 or not). 

Mere evaluation does not _redefine_ a face or var - it does nothing to a
defface, defcustom, or defvar if the face or var has already been defined.

2. Wrt someone trying to eval (with or without redefinition) a sexp that is
incomplete because it depends on stuff outside it (e.g., `a', `b' in your
example), sure, you could edit to could complete it.

But typically for an incomplete defface, defcustom, or defvar form, the best
behavior is to let Emacs complain (error).  Typically, asking for its
eval/redefinition just represents user error.

Anyway, the question I raised is not how we might simplify editing for
evaluating a subform.  It's about having a key that redefines faces and

reply via email to

[Prev in Thread] Current Thread [Next in Thread]