help-gnu-emacs
[Top][All Lists]
Advanced

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

RE: How the backquote and the comma really work?


From: Drew Adams
Subject: RE: How the backquote and the comma really work?
Date: Thu, 25 Jun 2015 13:37:31 -0700 (PDT)

> >> pp binds `print-quoted' unconditionally to t when printing.
> 
> That's a pity.  Not Emacs-y way of doing things, I guess; IMHO, the
> Emacs-y way would be to bind print-quoted to pp-default-print-
> quoted, set to t by default;-).

Just `pp-print-quoted' - and yes, agreed; such a variable could
have been provided and used.

This is, for example, why library `pp+.el' offers the following
options, as distinct from the ones that lack prefix `pp-':

  `pp-eval-expression-print-length'
  `pp-eval-expression-print-level'

And it is why it uses `pp-read-expression-map' instead of
`read-expression-map' (similar, but `pp-*' uses some Emacs-Lisp
key bindings).  Evaluating with pretty printing is generally a
different use case from `eval-expression'.

But I didn't think to provide a  variable `pp-print-quoted' (or
`pp-eval-expression-print-quoted').  It's not a common use case,
but anyway, now you know.  `eval-expression' and
`pp-eval-expression' are just commands - nothing special.

(The real gotcha comes when people mistakenly think that using
them is tantamount to evaluating normally in all cases.  These
commands do more than just evaluate, including reading the sexp
to evaluate and printing the result.)




reply via email to

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