Subject: bug#19362: 25.0.50; Fix `pp.el' in line with new `elisp-mode.el'

From: Drew Adams <[email-masked]>
Date: Thu, 30 Jun 2016 20:07:51 -0700 (PDT)

> >> Do you have a list of things that you think should be aligned?
> >
> > No, but diff of the source code should show it. ;-)
> 
> I tried diffing pp.el and elisp-mode.el, but it was unenlightening.
> Like this bug report.

Yes, well, it's quite difficult.  Some of the code from lisp-mode.el
was moved to elisp-mode.el.  And then it was modified, in some cases
radically.  Dunno why, except that some of the changes seem to have
involved integrating eldoc.  But most of the changes presumably do not
concern this bug, which is only about the part of lisp-mode.el that
had functions that correspond to pp.el functions.)

===> The starting point is `eval-last-sexp', which used to correspond
directly with `pp-eval-last-sexp'.  The former was (presumably)
improved, but the latter was not modified similarly.

Some functions were renamed to add the prefix `elisp-' or `elisp--'
(e.g. `elisp--preceding-sexp', `elisp--eval-last-sexp',
`elisp--eval-last-sexp-print-value', `elisp--eval-last-sexp-fake-value',
`elisp--eval-defun-1', `elisp--eval-defun'), so knowing that can help.
In some cases they were just renamed.  In other cases the code was
changed quite a bit.  But again, this bug is only about the pp-like
code.

This is not something you will understand in 5 minutes.  It likely
requires understanding the changes that were made to `eval-last-sexp'
and its supporting functions, and then doing the right thing (not
necessarily exactly the same thing) for `pp-eval-last-sexp'.  The
pp.el code was slightly different from the Emacs 24.4 (and prior)
lisp-mode.el code (different helper functions, and one does not
involve pretty-printing), but they generally mirror one another.
Using their former correspondence as a guide should help.

I cannot help more than this.  It is unfortunate that the person
who changed the non-pp version did not think to act similarly for
the pp version.  I discovered it late, myself.  Once things are
properly understood, perhaps the code fix will be minor.  Dunno.

With luck, you will find and understand the changes made to
`eval-last-sexp' as a straightforward improvement that do not
involve all of the other changes from lisp-mode.el code to
elisp-mode.el code.  With luck, perhaps the person(s) who made
the changes to the non-pp code can look at this bug.  No doubt
that would be easiest.