From: Juri Linkov <juri@jurta.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 2588-done@debbugs.gnu.org
Subject: bug#2588: 23.0.90; Man buffer improperly formatted - wrong width
Date: Wed, 02 Jul 2014 02:57:42 +0300 [thread overview]
Message-ID: <87y4wdo9ml.fsf@mail.jurta.org> (raw)
In-Reply-To: <jwvtz64sluj.fsf-monnier+emacsbugreports@gnu.org> (Stefan Monnier's message of "Sat, 07 Mar 2009 23:05:08 -0500")
Version: 24.4.50
>> 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
>
> We could try to fix this: I think it would actually be desirable to pop
> up the frame immediately and then asynchronously fill it as man's output
> comes in.
Now this is implemented in bug#17831 merged with bug#2588, but to fix
the original issue of running `man' with pop-up-frames in a frame that
is 30 chars wide, required an additional change (now installed as well)
to select the window after popping up the frame to get its real width
(since display-buffer in Man-notify method `friendly' doesn't select
the window):
=== modified file 'lisp/man.el'
--- lisp/man.el 2014-05-09 07:02:00 +0000
+++ lisp/man.el 2014-07-01 23:54:32 +0000
@@ -1030,15 +1030,22 @@ (defmacro Man-start-calling (&rest body)
;; ther is available).
(when (or window-system
(not (or (getenv "MANWIDTH") (getenv "COLUMNS"))))
- ;; This isn't strictly correct, since we don't know how
- ;; the page will actually be displayed, but it seems
- ;; reasonable.
+ ;; Since the page buffer is displayed beforehand,
+ ;; we can select its window and get the window/frame width.
(setenv "COLUMNS" (number-to-string
(cond
((and (integerp Man-width) (> Man-width 0))
Man-width)
- (Man-width (frame-width))
- ((window-width))))))
+ (Man-width
+ (if (window-live-p (get-buffer-window (current-buffer) t))
+ (with-selected-window (get-buffer-window (current-buffer) t)
+ (frame-width))
+ (frame-width)))
+ (t
+ (if (window-live-p (get-buffer-window (current-buffer) t))
+ (with-selected-window (get-buffer-window (current-buffer) t)
+ (window-width))
+ (window-width)))))))
;; Since man-db 2.4.3-1, man writes plain text with no escape
;; sequences when stdout is not a tty. In 2.5.0, the following
;; env-var was added to allow control of this (see Debian Bug#340673).
next prev parent reply other threads:[~2014-07-01 23:57 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-07 4:22 bug#2588: 23.0.90; Man buffer improperly formatted - wrong width Chong Yidong
2009-03-07 4:50 ` Drew Adams
2009-03-07 14:15 ` Eli Zaretskii
2009-03-07 16:20 ` Drew Adams
2009-03-07 19:27 ` Eli Zaretskii
2009-03-07 19:43 ` Chong Yidong
2009-03-07 19:45 ` Drew Adams
2009-03-07 20:07 ` Eli Zaretskii
2009-03-08 16:08 ` Chong Yidong
2009-03-08 16:23 ` Drew Adams
2009-03-08 19:06 ` Chong Yidong
2009-03-08 19:23 ` Eli Zaretskii
2009-03-08 19:40 ` Chong Yidong
2009-03-08 20:01 ` Eli Zaretskii
2009-03-08 20:17 ` Drew Adams
2009-03-09 4:05 ` Eli Zaretskii
2009-03-09 5:33 ` Drew Adams
2009-03-09 3:27 ` Stefan Monnier
2009-03-09 3:38 ` Chong Yidong
2009-03-09 13:28 ` Stefan Monnier
2009-03-08 20:16 ` Drew Adams
2009-03-09 4:03 ` Eli Zaretskii
2009-03-09 5:33 ` Drew Adams
2012-01-10 18:38 ` Glenn Morris
2012-01-10 18:39 ` Glenn Morris
2009-03-08 19:04 ` Eli Zaretskii
2009-03-08 19:45 ` Stefan Monnier
2009-03-08 20:04 ` Eli Zaretskii
2011-09-11 21:51 ` Lars Magne Ingebrigtsen
2011-09-15 18:45 ` Juri Linkov
2011-09-17 5:22 ` Lars Magne Ingebrigtsen
2011-10-06 22:02 ` Lars Magne Ingebrigtsen
2011-10-07 0:34 ` Juri Linkov
2009-03-08 4:05 ` Stefan Monnier
2009-03-08 15:45 ` Chong Yidong
2009-03-08 15:57 ` Drew Adams
2009-03-08 19:43 ` Stefan Monnier
2009-03-08 20:03 ` Eli Zaretskii
2009-03-08 20:17 ` Drew Adams
2014-07-01 23:57 ` Juri Linkov [this message]
-- strict thread matches above, loose matches on Subject: below --
2009-03-06 20:51 Drew Adams
2009-03-07 13:58 ` Eli Zaretskii
2009-03-07 16:20 ` Drew Adams
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y4wdo9ml.fsf@mail.jurta.org \
--to=juri@jurta.org \
--cc=2588-done@debbugs.gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).