[Top][All Lists]

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

RE: pp-eval-expression enhancements

From: Drew Adams
Subject: RE: pp-eval-expression enhancements
Date: Tue, 24 Jul 2007 11:50:43 -0700

> > What about also replacing the binding of `M-:' so that it invokes
> > `pp-eval-expression'? What is the downside to that? If it's for
> > the prefix arg of `eval-expression', we could add the prefix arg to
> > `pp-eval-expression' also. If it's for `eval-expression-debug-on-error',
> > then `pp-eval-expression' could be made aware of that also.
> I never tried to use pp-eval-expression, but I'm curious
> [I use a separate minibuffer frame made of a single long
> line, so pp-eval-expression wouldn't be much use for me anyway].

I too use a separate minibuffer frame that extends all the way across my

`pp-eval-expression' uses the minibuffer only for short values. It puts a
large result in buffer *Pp Eval Ouput*. In my case and yours, that buffer is
displayed in a separate frame.

> If I try it with M-x pp-eval-expression RET '(let ((x 1)) x) RET
> it pops up a new frame showing that sexp on a few lines.

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)))

If that test is nil, it uses `message' to print the result (like

> I find this a bit inconvenient: if I want a separate frame,
> I'd rather use M-x ielm.

OK, I can see that different users might prefer different behaviors. I
wonder what most prefer.

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 `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*, and if I don't want the result that is displayed in *Pp
Eval Output* I just hit `C-x 0' to delete the frame. Would you find `C-x 0'
inconvenient? Don't you have the same problem (inconvenience) for `C-h f'?

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.

Anyway, this is a question for the benefit of others; I customized `M-:' to
`pp-eval-expression' eons ago.

reply via email to

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