emacs-devel
[Top][All Lists]
Advanced

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

Re: pp-eval-expression enhancements


From: Stefan Monnier
Subject: Re: pp-eval-expression enhancements
Date: Tue, 24 Jul 2007 15:24:22 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

> Yes, it considers the result to be large, not small. It uses this test,
> where the cursor is after the printed result:

>   (or (< (1+ (point)) (point-max))
>       (>= (- (point) (point-min)) (frame-width)))

That's odd, I just tried it in a "normal" Emacs session (no separate
minibuffer frame) and it also pops up a separate window rather than display
it in the echo area, even tho '(let ((x 1)) x) isn't nearly as long as my
frame's width (80 columns).  Looking at the code, I see the above check is
made after pp and the first part checks whether the output uses a single
line or not, and of course my `let' expression uses 3 lines.

With setups different from mine where the echo area can grow to several
lines, it would make sense to change the logic so as to allow the use of the
echo-area even if the output spans more than one line.

In any case, I'm not sure if pp-eval-expression's behavior would really be
worse than M-: even for me.  It's probably a question of habit.

> I don't use `ielm' much, but I suppose that if you know ahead of time that
> the result will be something that you want to manipulate (e.g. edit) then
> you might want to use `ielm'.  It seems like overkill for this, but yes,
> that's one option.  Do you have `ielm' on a key? `M-:'? Do you use
> `eval-expression' much?

I use M-: extensively.  And I use ielm on a regular basis.  I don't have any
special binding for it: M-x ielm RET is quick enough.  As for overkill,
I actually find it pretty lightweight, so I'd disagree.  The only problem
with `ielm' is that I have to `C-c b' to the proper buffer before being able
to do what I want.

> I use `pp-eval-expression' because it decides pretty well, IMO: if the
> result is more than it would make sense to show in the echo area, then it's
> likely that I want to do something with the result, so it puts it in a
> separate buffer, in the right mode.

> I find the heuristic is uses pretty handy. I never need to fish the result
> out of *Messages*

I never need such fishing, I always use the C-u prefix arg for that.

> Would you find `C-x 0' inconvenient? Don't you have the same problem
> (inconvenience) for `C-h f'?

It's probably a question of habit.

> I find it much more inconvenient that `M-:' currently prints a nice result
> (though it is difficult to read, because it is not pretty-printed and it is
> crammed into the echo area), but I can't get to that result to do anything
> with it, without going to buffer *Messages* and fishing it out.

Yes, pretty printing is good.  I think your idea is right, but it needs
tweaking so as to use the echo-area more often (always?).


        Stefan




reply via email to

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