unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Mysterious frame widening
@ 2016-07-05  9:27 Stephen Berman
  2016-07-05 11:53 ` martin rudalics
  2016-07-07 12:39 ` Vivek Dasmohapatra
  0 siblings, 2 replies; 9+ messages in thread
From: Stephen Berman @ 2016-07-05  9:27 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 4458 bytes --]

I'm seeing the Emacs frame widen under peculiar but reliably
reproducible conditions on my machine (running Gnu/Linux) with builds of
Emacs from both the master and emacs-25 branches as well as with Emacs
24.5.  The conditions involve a combination of particular default face
settings (font family and size), loading the Hyperbole package and Gnus.
Since I only noticed this issue after installing Hyperbole, I filed a
bug against that package (#23880 on debbugs.gnu.org), but Hyperbole's
author, Bob Weiner, was unable to reproduce the problem on his system (a
Mac), so I'm hoping someone here can reproduce it and has some idea
about how to debug it; I'm completely at a loss as to how to proceed.  

I can provide a step-by-step recipe, but it's easier to see the issue by
evaluating the attached Lisp sexp.  Before doing that it's necessary to
install Hyperbole; the current version (5.14) can be installed from the
Emacs package manager after adding this repository:

  (add-to-list 'package-archives
               '("RSW-Packages" . "http://www.plasmas.biz/rswe/") t)

When Hyperbole is installed, start Emacs with -Q, copy the attached sexp
into *scratch*, adjust the load-path addition for Hyperbole as
appropriate, and evaluate the sexp.  (I also tried putting the sexp in a
file and loading that file by starting Emacs with -Q -l, but then the
widening does not happen.)  When I do this, the following lines appear
in *Messages*:

   Emacs started; frame width: 80
   Gnus started; frame width: 80
   Entered Summary buffer; frame width: 80
   Entered Article buffer; frame width: 86
   Point moved to a button; frame width: 86
   Back to Summary buffer; frame width: 88
   Back to button in Article buffer; frame width: 97

The widening in the last step only happens when point is moved to
buttonized text in the Gnus Article buffer (all the lines in the Gnus
Summary buffer are also buttonized).  If I subsequently make the frame
width less than 88, then on making the Gnus Summary buffer current it
widens to 88, and on making the Article buffer current (as long as point
is on a button in that buffer) the frame widens to 97.  (If the frame
width is already wider than 88 or 97, respectively, then making those
buffers current does not shrink the frame's width.)

These results are with the font DejaVu Sans Mono, pixel size 12 (which I
use for the default face in my Emacs).  I tried this test with several
other fonts, and I get the same pattern as the above with the fonts
commented out in the sexp above the dashed line.  With the fonts below
the dashed line, the pattern is different.  With Latin Modern Mono size
12 *Messages* contains these lines:

   Emacs started; frame width: 80
   Gnus started; frame width: 80
   Entered Summary buffer; frame width: 80
   Entered Article buffer; frame width: 100
   Point moved to a button; frame width: 100
   Back to Summary buffer; frame width: 103
   Back to button in Article buffer; frame width: 113

When I set the font to either of the listed DEC Terminal or Sony Fixed
fonts (with size 12), the actually used fonts have pixel size 14 and 16,
respectively, and the frame widens only at the last step (back to button
in Article buffer), to 85.  I also see this pattern with the fonts above
the dashed line when the pixel size is 13 instead of 12; but with Latin
Modern Mono size 13, the pattern is the first one above (i.e., the same
as with size 12 for the fonts above the dashed line).

When I set the font to Misc Fixed size 12, the actually used font has
pixel size 15 and there is no frame widening.  The same holds for the
fonts above the dashed line with pixel size 15: no frame widening.

I also tried the test loading only individual Hyperbole files instead of
the entire package; in three cases (the commented out require lines in
the sexp), this showed frame widening with yet another pattern: here
too, the frame widens only at the last step (back to button in Article
buffer), but to 86 (not 85 as above).

Finally, when I conducted the test manually (which I only did with Deja
Vu Sans Mono size 12 and requiring the entire Hyperbole package),
i.e. stepwise invoking commands to set the font, require the packages,
move between the Gnus buffers, and at each step invoke (frame-width),
the pattern of frame widening was slightly different from the first one
above: 80, 80, 80, 88, 88, 88, 97.

I'd be grateful for any suggestions about how to debug this issue.

Steve Berman


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: bug23880.el --]
[-- Type: text/x-emacs-lisp, Size: 2896 bytes --]

(let ((testfile "~/bug23880"))
  (with-temp-file testfile
    (insert "From nobody Fri Jul  1 15:51:20 CEST 2016
To: stephen.berman@gmx.net
Subject: test for bug#2388
From: Stephen Berman <stephen.berman@gmx.net>
Date: Fri Jul  1 15:51:20 CEST 2016
Message-ID: <87twg9y16a.fsf@gmx.net>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Lines: 1

test
"))
  (set-default-font
   "-unknown-DejaVu Sans Mono-normal-normal-normal-*-12-*-*-*-m-0-iso10646-1")
   ;; "-ibm-Courier-normal-normal-normal-*-12-*-*-*-m-0-iso10646-1")
   ;; "-bitstream-Bera Sans Mono-normal-normal-normal-*-12-*-*-*-m-0-iso10646-1")
   ;; "-B&H-B&H LucidaTypewriter-normal-normal-normal-Sans-12-*-*-*-m-70-iso10646-1")
   ;; "-unknown-Droid Sans Mono-normal-normal-normal-*-12-*-*-*-m-0-iso10646-1")
   ;; "-unknown-Liberation Mono-normal-normal-normal-*-12-*-*-*-m-0-iso10646-1")
   ;; "-urw-Nimbus Mono L-normal-normal-normal-*-12-*-*-*-m-0-iso10646-1")
   ;; ---------------------------------------------------------------------------
   ;; "-unknown-Latin Modern Mono-normal-normal-normal-*-13-*-*-*-*-0-iso10646-1")
   ;; "-DEC-DEC Terminal-normal-normal-normal-*-12-*-*-*-c-80-iso10646-1")
   ;; "-Sony-Sony Fixed-normal-normal-normal-*-12-*-*-*-c-80-iso10646-1")
   ;; "-Misc-Misc Fixed-normal-normal-normal-*-12-*-*-*-c-90-iso10646-1")
  (add-to-list 'load-path "/home/steve/.emacs.d/elpa/hyperbole-5.14")
  (require 'hyperbole)
  ;; (require 'hui-select)
  ;; (require 'hycontrol)
  ;; (require 'wconfig)
  (message "Emacs started; frame width: %d" (frame-width))
  (require 'gnus)
  (let ((gnus-select-method '(nnnil "")))
    (message "Gnus started; frame width: %d" (frame-width))
    (gnus-1)
    (gnus-group-make-doc-group testfile 'mbox)
    (gnus-group-select-group)
    (gnus-summary-scroll-up 1)
    (message "Entered Summary buffer; frame width: %d" (frame-width))
    (gnus-summary-select-article-buffer)
    (sit-for 0)
    (message "Entered Article buffer; frame width: %d" (frame-width))
    (widget-backward 1)  
    (sit-for 0)
    (message "Point moved to a button; frame width: %d" (frame-width))
    (gnus-article-show-summary)
    (sit-for 0)
    (message "Back to Summary buffer; frame width: %d" (frame-width))
    (gnus-summary-select-article-buffer)
    (sit-for 0)
    (message "Back to button in Article buffer; frame width: %d" (frame-width)))
  ;; Suppress further messages and clean up in order to repeat the test by
  ;; simply restarting Emacs with -Q and evaluating this sexp.
  (let (message-log-max)
    (gnus-summary-exit-no-update t)
    (goto-char (point-min))
    (gnus-group-kill-group)
    (let ((gnus-expert-user t))
      (gnus-group-quit))
    (delete-file testfile)
    (when (file-exists-p (gnus-dribble-file-name))
      (delete-file (gnus-dribble-file-name))))
  (switch-to-buffer "*Messages*"))

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-07-07 16:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-05  9:27 Mysterious frame widening Stephen Berman
2016-07-05 11:53 ` martin rudalics
2016-07-05 12:39   ` Stephen Berman
2016-07-05 13:09     ` Robert Weiner
2016-07-05 14:53   ` Eli Zaretskii
2016-07-06  8:01     ` martin rudalics
2016-07-06 14:55       ` Eli Zaretskii
2016-07-07 12:39 ` Vivek Dasmohapatra
2016-07-07 16:17   ` martin rudalics

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).