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

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

[debbugs-tracker] bug#9084: closed (24.0.50; displaying man pages splits


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#9084: closed (24.0.50; displaying man pages splits the window and formats the text for the full width of the whole frame rather than for the width of the window the text is displayed in, which is only 1/2 the width of the frame)
Date: Wed, 02 Jul 2014 00:19:05 +0000

Your message dated Wed, 02 Jul 2014 02:57:42 +0300
with message-id <address@hidden>
and subject line Re: bug#2588: 23.0.90; Man buffer improperly formatted - wrong 
width
has caused the debbugs.gnu.org bug report #2588,
regarding 24.0.50; displaying man pages splits the window and formats the text 
for the full width of the whole frame rather than for the width of the window 
the text is displayed in, which is only 1/2 the width of the frame
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
2588: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=2588
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 24.0.50; displaying man pages splits the window and formats the text for the full width of the whole frame rather than for the width of the window the text is displayed in, which is only 1/2 the width of the frame Date: Thu, 14 Jul 2011 23:07:35 +0200 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)
Well, the lengthy subject pretty much says it :)  When I have an emacs
frame the size of the full screen (like 231 characters, 68 lines at
1920x1200 pixels) displaying a single window (buffer) and do "M-x man"
to display a manual page, emacs splits the window horizontally (as in
`split-window-horizontally`) and displays the manual page in one of the
windows within the frame.  That's great, only the man page is then
difficult to read because it's formatted for the width of the whole
frame (231 characters/line) and not for the width of the frame it is
displayed in.

Since emacs automatically splits the frame, wouldn't it make more sense
to format the manual page to the width of the frame it is displayed in
(unless the frame is unreasonably narrow)?  Lines that are 231
characters long aren't so nice for reading, anyway ...

When I first M-x split-window-horizontally and then M-x man, the manual
page is formatted for the width of the window it's displayed in.  So
this might be as simple as reversing the order in which things happen:
first splitting the frame automatically and then formatting the manual
page vs. formatting the manual page first and then splitting the frame.



In GNU Emacs 24.0.50.1 (x86_64-unknown-linux-gnu, X toolkit)
 of 2011-07-13 on yun
Windowing system distributor `The X.Org Foundation', version 11.0.11002000
configured using `configure  '--with-x-toolkit=lucid''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: de_DE.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Man

Minor modes in effect:
  desktop-save-mode: t
  shell-dirtrack-mode: t
  highlight-changes-visible-mode: t
  global-hl-line-mode: t
  show-paren-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  size-indication-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
r d SPC f o r SPC a n SPC e n t r y SPC t e l l i n 
g <backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <left> <left> <left> <left> 
<left> <left> <left> <backspace> <backspace> s o m 
e <end> <home> <up> f r o m SPC <escape> q <down> <down> 
<left> SPC s p e c i f y i n g SPC w h e t h e r SPC 
t o SPC t r <backspace> u r n SPC o n SPC N u , <backspace> 
m L o c k SPC o r SPC n o t SPC a n d SPC t u r n SPC 
i t SPC o n SPC o r SPC n o t SPC f r o m SPC h t <backspace> 
<backspace> t h e r e SPC . . . <right> <right> <left> 
<left> SPC SPC O r SPC y o u SPC c o u l d SPC m a 
k e SPC y o u r SPC o w n SPC s t a r t u p SPC s c 
r i p t SPC t h a t SPC c h e c k s SPC / e t c / d 
e f a u l t / k e y b o a r d SPC . . . <right> <right> 
<left> <right> <up> <return> <escape> x m a n <return> 
s e t l e d s <return> <C-tab> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <up> 
<left> <right> <f7> <escape> x e m a <tab> b u <tab> 
<tab> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> r e 
p o <tab> r <tab> <return>

Recent messages:
Note: file is write protected
Setting up indent for shell type sh
setting up indent stuff
Indentation variables are now local.
Indentation setup for shell type sh
Auto-saving...done
Invoking man setleds in the background
Please wait: formatting the setleds man page...
setleds man page formatted
Making completion list...

Load-path shadows:
None found.

Features:
(shadow emacsbug org-colview cal-move cal-iso conf-mode flow-fill
browse-url gnus-dup newcomment gnus-dired desktop org-wl org-w3m org-vm
org-rmail org-mhe org-mew org-irc org-jsinfo org-infojs org-html org-exp
ob-exp org-exp-blocks org-agenda org-info org-gnus org-docview
org-bibtex org-bbdb info gnus-eform skeleton sh-script executable
flyspell ispell bookmark multi-isearch tabify shell mule-util sort
smiley ansi-color gnus-cite gnus-async gnus-bcklg shadowfile ange-ftp
woman man speedbar sb-image ezimage dframe rst compile rcirc proced
hilit-chg hi-lock dired cwarn cc-mode cc-fonts cc-guess cc-menus cc-cmds
cc-styles cc-align cc-engine cc-vars cc-defs ebnf2ps ps-print ps-def lpr
cus-edit help-mode view debug qp gnus-ml nndraft nnmh nndoc nnmaildir
parse-time rot13 disp-table netrc gnutls network-stream auth-source
eieio assoc starttls tls nnfolder bbdb-gnus bbdb-snarf mail-extr
bbdb-com cl nnml gnus-agent gnus-srvr gnus-score score-mode nnvirtual
gnus-msg nntp gnus-cache gnus-diary gnus-art mm-uu mml2015 epg-config
mm-view mml-smime smime password-cache dig mailcap nndiary nnir gnus-sum
gnus-group gnus-undo nnmail mail-source nnoo gnus-start gnus-spec
gnus-int gnus-range message sendmail rfc822 mml mml-sec mm-decode
mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums
mailabbrev gmm-utils mailheader gnus-win gnus gnus-ems nnheader
gnus-util mail-utils mm-util mail-prsvr wid-edit jka-compr server
cal-china lunar solar cal-dst cal-bahai cal-islam cal-hebrew holidays
hol-loaddefs appt diary-lib diary-loaddefs remember org-remember
org-datetree org byte-opt warnings bytecomp byte-compile cconv macroexp
advice help-fns advice-preload ob-emacs-lisp ob-tangle ob-ref ob-lob
ob-table org-footnote org-src ob-comint comint ob-keys ob ob-eval
org-complete pcomplete org-list org-faces org-compat org-entities
org-macs noutline outline easy-mmode cal-menu easymenu calendar
cal-loaddefs ring erc-goodies erc erc-backend erc-compat format-spec
thingatpt pp bbdb-autoloads bbdb regexp-opt timezone hl-line saveplace
time-date paren cus-start cus-load boxquote rect tooltip ediff-hook
vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image
fringe lisp-mode register page menu-bar rfn-eshadow timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese hebrew greek romanian slovak czech european ethiopic
indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple
abbrev minibuffer loaddefs button faces cus-face files text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind
dynamic-setting system-font-setting font-render-setting x-toolkit x
multi-tty emacs)



--- End Message ---
--- Begin Message --- Subject: Re: bug#2588: 23.0.90; Man buffer improperly formatted - wrong width Date: Wed, 02 Jul 2014 02:57:42 +0300 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu)
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).


--- End Message ---

reply via email to

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