all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "Stefan Monnier" <monnier@iro.umontreal.ca>
Cc: rms@gnu.org, emacs-devel@gnu.org
Subject: RE: pp-eval-expression enhancements
Date: Tue, 24 Jul 2007 11:50:43 -0700	[thread overview]
Message-ID: <BNELLINCGFJLDJIKDGACMEOLCAAA.drew.adams@oracle.com> (raw)
In-Reply-To: <jwvd4yh1xhx.fsf-monnier+emacs@gnu.org>

> > 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
display.

`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
`eval-expression').

> 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	other threads:[~2007-07-24 18:50 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-10 22:54 pp-eval-expression enhancements Drew Adams
2007-07-22 23:42 ` Drew Adams
2007-07-23 18:06   ` Richard Stallman
2007-07-23 20:54     ` Drew Adams
2007-07-24 16:45       ` Richard Stallman
2007-07-24 17:18         ` Drew Adams
2007-07-24 18:17           ` Stefan Monnier
2007-07-24 18:50             ` Drew Adams [this message]
2007-07-24 19:24               ` Stefan Monnier
2007-07-24 20:23                 ` Drew Adams
2007-07-24 22:02                   ` Stefan Monnier
2007-07-25 21:40                   ` Juri Linkov
2007-07-26  0:49                     ` Stefan Monnier
2007-07-26  8:48                       ` Juri Linkov
2007-07-26 19:12                         ` Stefan Monnier
2007-08-04 23:42                     ` T. V. Raman
2007-07-25 15:02           ` Richard Stallman
2007-07-25 15:02           ` Richard Stallman
2007-08-02 15:45           ` Richard Stallman
2007-08-03  3:26             ` Glenn Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BNELLINCGFJLDJIKDGACMEOLCAAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.