[Top][All Lists]

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

bug#4118: 23.1; eval-last-sexp-print-value is inconvenient

From: Eli Barzilay
Subject: bug#4118: 23.1; eval-last-sexp-print-value is inconvenient
Date: Thu, 13 Aug 2009 21:25:17 -0400

On Aug 14, Juri Linkov wrote:
> >> But it inserts other representations only when you type `C-x C-e' twice.
> >> Do you mean you don't want this after the second `C-x C-e' key press?
> >
> > Hmm, I see that the reason for what I've seen is that I'm using it
> > indirectly through my own function, and for some reason
> > `eval-expression-print-format' decides whether to do its thing based
> > on the current command.  This looks like an odd interface...  A better
> > and more consistent interface seems to me to always print the extra
> > information unless it goes into a buffer -- something like:
> >
> >   (defun eval-expression-print-format (value)
> >     ...
> >     (if (and (integerp value) (not (bufferp standard-output)))
> >         ...))
> The reason not to print the extra information on the first
> invocation of `eval-last-sexp' is the following.  Most often users
> want to see the integer result of the evaluated expression, but the
> extra information also contains a character representation of this
> integer that might print some unrelated character that might load
> some weird fonts the user doesn't want to load.

In that case the obvious way to do this is to not print the character
form if it requires such a font.  If this is not easy to do, then
making it work only for ASCII seems better than the current weird
behavior.  (The reason I consider it weird is that I managed to use
Emacs for more than 15 years without noticing it.)

> > But you seem to suggest that there are practical uses to get that
> > extra stuff into the buffer?  I don't see any occasion that would
> > make it desirable...
> When the current buffer contains an integer, typing `C-x C-e' twice
> inserts it to the same buffer as a character.  However, this is not
> too convenient, so I'd like to improve this interface.

The main point (IMO) of making it consistent is keyboard macros, and
in that case, if you want the character, then it's easy to just wrap
an (insert ...) around the expression.  Using it to insert the
character and then removing all the preceding text is much more
difficult for that.

          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!

reply via email to

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