emacs-devel
[Top][All Lists]
Advanced

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

RE: C-x C-e with prefix arg


From: Drew Adams
Subject: RE: C-x C-e with prefix arg
Date: Sun, 5 May 2013 07:23:05 -0700

> Why a numeric prefix arg?  A numeric prefix usually defines 
> countable elements,

No.

And even if you actually checked all the source code and counted and proved
that, yes, it is used to define countable elements more than 50% of the time,
I'd say "So what?".  An Emacs prefix arg can be used to do anything we want.

We should pick the most appropriate, most useful prefix-arg behavior _for the
particular command_.  Argue for a different, better behavior wrt this command,
if you like.  But "usually" doesn't, by itself, convince me (for one) when it
comes to prefix arg behavior.

> e.g. for this case it could define the number of values to 
> insert to the buffer or the depth of list nesting to print.

It could, but it doesn't.  If you want to propose either of those, go for it.

* Negative in this case is mnemonic for "less".  It hints at the
elision/abbreviation.

* Plain C-u, which is probably what most people who have been using a prefix arg
for this command have been using, now prints the full value, which is the most
useful behavior most of the time, I think.

Those were the two reasons behind the behavior I proposed.  Likewise wrt a
negative prefix arg for `eval-print-last-sexp'.

> Otherwise, a better prefix to toggle would be `C-u' or `M-0'.

Toggle?  What do you want to toggle here?  I would not want any prefix arg here
to toggle, so that every other time it had some opposite behavior.  What for?

> Consider the prefixes of the related commands that
> 
> 1. insert to the buffer
>    C-u M-x shell-command RET
>    C-u M-x eval-last-sexp RET
>    M-x eval-print-last-sexp RET
> 
> 2. print full information
>    C-u M-x what-cursor-position RET
>    M-0 M-x dired-copy-filename-as-kill RET
>    M-0 M-x Info-copy-current-node-name RET
>    M-x eval-last-sexp RET M-x eval-last-sexp RET
>    M-x eval-expression RET
> 
> Perhaps `M-0' is more suitable than `C-u' to print full 
> information (or the full value) where the mnemonics of
> `M-0' could be "Reset `eval-expression-print-length'
> to nil".

If you want to propose something different, please go for it.  Send a patch or
whatever.

But be prepared for someone like Juri L. to reply that `M-0' is "usually" for
counting and should mean only zero inserts or zeroth print level, not print full
information. ;-)

IMHO, the proposal I made is better, but I really don't care.  I never use
either `eval-last-sexp' or `eval-print-last-sexp', personally.  I use
`pp-eval-last-sexp' instead (and my own version of it), and I use *scratch* in
Emacs-Lisp mode (so C-j is not `eval-print-last-sexp').

BTW, for my patch, and something perhaps to keep in mind for yours as well:
(emacs) `Lisp Eval' should be updated to remove this sentence: "The argument's
value does not matter."

I believe that is the only doc change needed, but I could be wrong.  I searched
only the Emacs and Elisp manuals, and only for `C-x C-e', `M-:', and `C-j'.




reply via email to

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