unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#15233: pp-eval-expression: Signature parity with `eval-expression'
  2013-09-01 12:06 bug#15233: pp-eval-expression: Signature parity with `eval-expression' Jambunathan K
@ 2002-01-01  0:51 ` Jambunathan K
  2013-09-01 15:23 ` Drew Adams
  1 sibling, 0 replies; 8+ messages in thread
From: Jambunathan K @ 2002-01-01  0:51 UTC (permalink / raw)
  To: 15233-done


OP here.  Closing it.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#15233: pp-eval-expression: Signature parity with `eval-expression'
@ 2013-09-01 12:06 Jambunathan K
  2002-01-01  0:51 ` Jambunathan K
  2013-09-01 15:23 ` Drew Adams
  0 siblings, 2 replies; 8+ messages in thread
From: Jambunathan K @ 2013-09-01 12:06 UTC (permalink / raw)
  To: 15233


eval-expression takes INSERT-VALUE.  But `pp-eval-expression' doesn't.
But it should.

,----[ C-h f eval-expression RET ]
| eval-expression is an interactive compiled Lisp function in
| `simple.el'.
| 
| It is bound to M-ESC :.
| 
| (eval-expression EXP &optional INSERT-VALUE)
`----

,----[ C-h f pp-eval-expression RET ]
| pp-eval-expression is an interactive autoloaded compiled Lisp function
| in `pp.el'.
| 
| It is bound to M-:.
| 
| (pp-eval-expression EXPRESSION)
| 
| Evaluate EXPRESSION and pretty-print its value.
| Also add the value to the front of the list in the variable `values'.
| 
`----





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#15233: pp-eval-expression: Signature parity with `eval-expression'
  2013-09-01 12:06 bug#15233: pp-eval-expression: Signature parity with `eval-expression' Jambunathan K
  2002-01-01  0:51 ` Jambunathan K
@ 2013-09-01 15:23 ` Drew Adams
  2013-09-01 16:07   ` Jambunathan K
  2013-09-01 16:09   ` Jambunathan K
  1 sibling, 2 replies; 8+ messages in thread
From: Drew Adams @ 2013-09-01 15:23 UTC (permalink / raw)
  To: Jambunathan K, 15233

> eval-expression takes INSERT-VALUE.  But `pp-eval-expression' doesn't.
> But it should.

FWIW -

Done 5 years ago in pp+.el (and probably suggested to Emacs Dev as well).
http://www.emacswiki.org/emacs-en/download/pp%2b.el

Other pp+.el enhancements to `pp-eval-expression', which Emacs could
consider or integrate:

* Does not use 'emacs-lisp-mode-hook'.

* Fontifies the result buffer, `*Pp Eval Output*'.

* Makes several EmacsLisp keybindings available while reading the
  expression - uses a new keymap, 'pp-read-expression-map'.
  You can use: 
   'C-M-q' to indent a sexp
   'C-M-x' to eval a sexp
   'TAB' to Lisp-indent
   'M-TAB' to complete a Lisp symbol

* (With a prefix arg, inserts the pretty-printed result in the
  current buffer.)  With a negative prefix arg and a string result,
  inserts it without enclosing double-quotes (`"').

* Respects new options 'pp-eval-expression-print-length' and
  'pp-eval-expression-print-level', which control the print length
  and print level.  Respects 'eval-expression-debug-on-error'.


[FWIW2, I use (substitute-key-definition 'eval-expression
                                         'pp-eval-expression
                                         global-map).]





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#15233: pp-eval-expression: Signature parity with `eval-expression'
  2013-09-01 15:23 ` Drew Adams
@ 2013-09-01 16:07   ` Jambunathan K
  2013-09-01 16:09   ` Jambunathan K
  1 sibling, 0 replies; 8+ messages in thread
From: Jambunathan K @ 2013-09-01 16:07 UTC (permalink / raw)
  To: Drew Adams; +Cc: 15233

Drew Adams <drew.adams@oracle.com> writes:

>> eval-expression takes INSERT-VALUE.  But `pp-eval-expression' doesn't.
>> But it should.
>
> FWIW -
>
> Done 5 years ago in pp+.el (and probably suggested to Emacs Dev as well).
> http://www.emacswiki.org/emacs-en/download/pp%2b.el

I haven't used pp+.el before.  So consider two independent
upvotes... for this request.

To add to your list:

1. Undo in pp eval outputs.  (There is a separate bug for that)

2. Linkify circular references.  So that when I click on a circular
   "reference" it takes me to the "site of definition".

----------------------------------------------------------------

The above two requests are not hypothetical requests.  

The new `org-element.el' library lispifies an Org buffer and it uses
`:parent' pointers to boot.  So, for complex outlines and for operations
that non-trivially manipulate the lisp tree, examining, manipulating and
persisting a lisp tree is a REAL need.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#15233: pp-eval-expression: Signature parity with `eval-expression'
  2013-09-01 15:23 ` Drew Adams
  2013-09-01 16:07   ` Jambunathan K
@ 2013-09-01 16:09   ` Jambunathan K
  2013-09-03  1:44     ` Stefan Monnier
  1 sibling, 1 reply; 8+ messages in thread
From: Jambunathan K @ 2013-09-01 16:09 UTC (permalink / raw)
  To: Drew Adams; +Cc: 15233

Drew Adams <drew.adams@oracle.com> writes:

> [FWIW2, I use (substitute-key-definition 'eval-expression
>                                          'pp-eval-expression
>                                          global-map).]

Same here.  I have this:

    (global-set-key "\272" (quote pp-eval-expression)) ; M-:

which is but the same thing but expressed differently.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#15233: pp-eval-expression: Signature parity with `eval-expression'
  2013-09-01 16:09   ` Jambunathan K
@ 2013-09-03  1:44     ` Stefan Monnier
  2013-09-03  2:20       ` Jambunathan K
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2013-09-03  1:44 UTC (permalink / raw)
  To: Jambunathan K; +Cc: 15233

>     (global-set-key "\272" (quote pp-eval-expression)) ; M-:

Please don't: "\272" is not M-: (except back in the world as it existed
20 years ago, maybe).  Use [?\M-:] instead (M-: is not a plain
character, so it can't really be stored in a string).


        Stefan





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#15233: pp-eval-expression: Signature parity with `eval-expression'
  2013-09-03  1:44     ` Stefan Monnier
@ 2013-09-03  2:20       ` Jambunathan K
  2013-09-04 15:47         ` Josh
  0 siblings, 1 reply; 8+ messages in thread
From: Jambunathan K @ 2013-09-03  2:20 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 15233

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>>     (global-set-key "\272" (quote pp-eval-expression)) ; M-:
>
> Please don't: 

Don't blame me, I didn't do it, Emacs did it.

I have a simple recipe for producing keybindings.

  M-x global-set-key
  M-x list-command-history
  Copy and Paste

The above recipe works flawlessly.  It is the most easiest way to
produce keybindings that I have known.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#15233: pp-eval-expression: Signature parity with `eval-expression'
  2013-09-03  2:20       ` Jambunathan K
@ 2013-09-04 15:47         ` Josh
  0 siblings, 0 replies; 8+ messages in thread
From: Josh @ 2013-09-04 15:47 UTC (permalink / raw)
  To: Jambunathan K; +Cc: 15233

I prefer to use the `kbd' notation, e.g.

  (global-set-key (kbd "M-:") 'pp-eval-expression)

because it's clear, regular, and doesn't require me to remember
that keys are internally represented as vectors, how to quote
modifiers, etc.  If I'm not sure of the canonical representation of
something (e.g. "M-H-x or H-M-x?") I can easily check visually
with C-h c, or something like this to kill the correct form for me
(this quick version performs key translations, which isn't optimal):

  (defun describe-key-name (key)
    (interactive "kGenerate and kill `kbd' form for key: ")
    (kill-new
     (message "(kbd \"%s\")"
                      (help-key-description key nil))))

Josh

On Mon, Sep 2, 2013 at 7:20 PM, Jambunathan K <kjambunathan@gmail.com> wrote:
> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
>>>     (global-set-key "\272" (quote pp-eval-expression)) ; M-:
>>
>> Please don't:
>
> Don't blame me, I didn't do it, Emacs did it.
>
> I have a simple recipe for producing keybindings.
>
>   M-x global-set-key
>   M-x list-command-history
>   Copy and Paste
>
> The above recipe works flawlessly.  It is the most easiest way to
> produce keybindings that I have known.
>
>
>





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-09-04 15:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-01 12:06 bug#15233: pp-eval-expression: Signature parity with `eval-expression' Jambunathan K
2002-01-01  0:51 ` Jambunathan K
2013-09-01 15:23 ` Drew Adams
2013-09-01 16:07   ` Jambunathan K
2013-09-01 16:09   ` Jambunathan K
2013-09-03  1:44     ` Stefan Monnier
2013-09-03  2:20       ` Jambunathan K
2013-09-04 15:47         ` Josh

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).