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

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

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


From: Lars Ingebrigtsen
Subject: bug#10723: 24.0.93; bad pp formatting for `C-h v' with list value
Date: Thu, 28 Apr 2016 15:13:22 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

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






reply via email to

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