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

From: Noam Postavsky <[email-masked]>
Date: Wed, 6 Jul 2016 16:39:15 -0400

On Thu, Jun 30, 2016 at 11:07 PM, Drew Adams <[email-masked]> wrote:
>> >> 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.

But do you know of any concrete cases where there is a difference in
behaviour? Or is this report just about code duplication (or lack
thereof)?

I found #10495 "pp-eval-last-sexp doesn't work on a `symbol' in
quotes", but that was reported against 24.0.92, so perhaps these
functions were in fact never "aligned"?