Subject: Re: bug#2588: 23.0.90; Man buffer improperly formatted - wrong width

From: Eli Zaretskii <[email-masked]>
Date: Sat, 07 Mar 2009 16:15:54 +0200

> From: "Drew Adams" <[email-masked]>
> Date: Fri, 6 Mar 2009 20:50:14 -0800
> Cc: [email-masked]
> 
> > Doing what you want is not a trivial to man.el, I think.  You 
> > can change the `Man-width' options if you want to fix the width.
> 
> What do you mean "doing what I want"? This is not an enhancement request for
> something "I want". This is a bug report. There's no way this can be defended as
> reasonable or expected behavior.
> 
> Imagine if `man' did something like that also for users who have `pop-up-frames'
> = nil. You would have heard about it on day 1. Would you tell them to go and
> customize the `Man-width' options to "fix the width" and get sane behavior?
> Preposterous.

As usual, Drew, you need to calm down.  No one is jumping you, so
please don't jump others in response.

What Yidong was trying to say is this: Emacs sets the environment
variable COLUMNS depending on the value of Man-width.  Setting that
variable to an integer value is supposed to cause `man' to format man
pages to that width.  Any other value causes the man pages to be
formatted according to the width of the current window or the
currently selected frame (depending on whether the variable is nil or
t).

The problem is, AFAICS, that with pop-up-frames `man' is run _before_
the frame to display its output is created.  To do what you want we
need to know in advance what would be the width of that frame.  Do you
have any suggestions for how to pull that trick?  Pop-up frames could
have non-default user-defined frame parameters for them, right?

One thing we could easily do is not set COLUMNS in the environment if
pop-up-frames is being used, but then you'd probably come up with
another use-case, where pop-up frames are configured to come up with a
width that is different from the default, and tell that this is a
bug...  However, as this at least restores the pre-v21 behavior, it
could be the best solution for Emacs 23.1.

Last, but not least, I recommend using WoMan on Windows in preference
to `man'.  Since it's written in Lisp, it interacts better with Emacs
features, as far as text formatting is concerned.  In particular, if
you set woman-fill-frame to t, you will get what you want, I think.

> Just look at it, to see how silly it is. I'm surprised that you would try to
> defend keeping such outlandish behavior with such a lame argument.

No one is defending this behavior.  You just have been told that
fixing it is not easy, which is a far cry.