Subject: Re: bug#10723: 24.0.93; bad pp formatting for `C-h v' with list value

From: Lars Ingebrigtsen <[email-masked]>
Date: Thu, 28 Apr 2016 15:13:22 +0200

Man, the logic in that function is weird.

Here's some of the outputs:

lala’s value is
(ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo)

Fine.

lala’s value is (ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
 (oo))

Er.

lala’s value is (oo (oo))

Fine, I guess...

lala’s value is (zot
 (bar)
 (foo)
 (zot)
 (fooooooooooooooo0000000000))

Which was your original complaint.

----
lala’s value is shown below.

Documentation:
Not documented as a variable.

Value: (zot
 (bar)
 (foo)
 (zot)
 (bar)
 (foo)
 (zot)
 (bar)
 (foo)
 (zot)
 (bar)
 (foo)
 (zot)
 (fooooooooooooooo0000000000))
----

So when it's very long it moves to a totally different format with a
"below" clause.

The uncommented "logic" here is this, mostly: 

		  (if (< (+ (length print-rep) (point) (- line-beg)) 68)
		      (insert print-rep)
		    (terpri)
		    (pp val)
		    (if (< (point) (+ 68 (line-beginning-position 0)))
			(delete-region from (1+ from))
		      (delete-region (1- from) from)))

Which means "if the final line of the pp'd expression is shorter than 68
characters, then delete the newline after 'value ', otherwise delete the
trailing space".

I think that's a slight thinko.  I'm changing it to "if the pp'd
expression is more than one line, then etc".

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no