GNU bug report logs - #2588
23.0.90; Man buffer improperly formatted - wrong width

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Sat, 7 Mar 2009 00:30:02 UTC

Severity: normal

Merged with 9084, 17831

Found in version 24.0.50

Fixed in version 24.4.50

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

Full log


Message #207 received at 2588-done <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 2588-done <at> debbugs.gnu.org
Subject: Re: bug#2588: 23.0.90; Man buffer improperly formatted - wrong width
Date: Wed, 02 Jul 2014 02:57:42 +0300
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).




This bug report was last modified 11 years and 19 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.