GNU bug report logs -
#18789
24.4; Can't resize frame pixelwise on w32, causing partial columns when using non-standard font
Previous Next
Reported by: Anders Lindgren <andlind <at> gmail.com>
Date: Wed, 22 Oct 2014 09:04:01 UTC
Severity: normal
Found in version 24.4
Done: martin rudalics <rudalics <at> gmx.at>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 18789 in the body.
You can then email your comments to 18789 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#18789
; Package
emacs
.
(Wed, 22 Oct 2014 09:04:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Anders Lindgren <andlind <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Wed, 22 Oct 2014 09:04:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hi!
Under MS-Windows, it appears that the width of the frame only can be a
multiple of the character width. Unfortunately, the width of the fringes
and scrollbars used by side-by-side windows does not always add up to full
characters -- if you use a font other than the default. The effect is that
when using side-by-side windows, you could get a partial column. (Partial
columns are not desirable, for example, they work differently when you
place the cursor on the end of a full line.)
Steps to repeat 1:
emacs -q
Switch to *scratch*: C-x b RET
Evaluate:
(set-default-font
(create-fontset-from-ascii-font
"-raster-Terminal-bold-r-normal-normal-8-60-96-96-c-*-ms-oemlatin"))
Split the window using: C-x 3
Insert a long line: C-u 37 x
Here, the cursor is at the end of the line in the left window, it is
rendered in the right fringe. (OK)
Go to the other window: C-x o
Place the cursor at the end: C-x >
Here, the cursor is visible in the partially visible column. (NOT OK)
Steps to repeat 2:
emacs -q
Evaluate the following:
(set-frame-width (selected-frame) 607 nil t)
(frame-pixel-width)
Here, 632 is returned.
(set-frame-width (selected-frame) 608 nil t)
(frame-pixel-width)
Here, 640 is returned. Clearly, the width of the frame is always a
multiple of the character width.
See also my package https://github.com/Lindydancer/multicolumn -- I use it
to set up six side-by-side windows. (Note: As this writing, it is not
updated to work-around the above problems.)
Sincerely,
Anders Lindgren (Long time Emacs contributor)
In GNU Emacs 24.4.1 (x86_64-w64-mingw32)
of 2014-10-21 on KAEL
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
`configure --prefix=/z/emacs --host=x86_64-w64-mingw32
--target=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --with-wide-int
--with-jpeg --with-xpm --with-png --with-tiff --with-rsvg --with-xml2
--with-gnutls --with-xft --with-sound=yes --with-file-notification=yes
--without-dbus --without-imagemagick 'CFLAGS=-Ofast
-fomit-frame-pointer -funroll-loops -g0 -pipe' 'CPPFLAGS=-DNDEBUG
-DDBUS_STATIC_BUILD' 'LDFLAGS=-static-libgcc -static-libstdc++ -static
-s -Wl,-s''
Important settings:
value of $LANG: SVE
locale-coding-system: cp1252
Major mode: Fundamental
Minor modes in effect:
tooltip-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
blink-cursor-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
buffer-read-only: t
line-number-mode: t
transient-mark-mode: t
Recent input:
<escape> x r e p o <tab> r <tab> <return>
Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Making completion list...
Load-path shadows:
None found.
Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
help-fns mail-prsvr mail-utils help-mode easymenu time-date tooltip
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel dos-w32
ls-lisp w32-common-fns disp-table w32-win w32-vars tool-bar dnd fontset
image regexp-opt fringe tabulated-list newcomment lisp-mode prog-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 nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
w32notify w32 multi-tty emacs)
Memory information:
((conses 16 75502 7207)
(symbols 56 17532 0)
(miscs 48 78 127)
(strings 32 11014 5137)
(string-bytes 1 283940)
(vectors 16 9121)
(vector-slots 8 376122 15963)
(floats 8 55 70)
(intervals 56 298 0)
(buffers 960 14))
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#18789
; Package
emacs
.
(Wed, 22 Oct 2014 13:44:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 18789 <at> debbugs.gnu.org (full text, mbox):
> Under MS-Windows, it appears that the width of the frame only can be a
> multiple of the character width. Unfortunately, the width of the fringes
> and scrollbars used by side-by-side windows does not always add up to full
> characters -- if you use a font other than the default. The effect is that
> when using side-by-side windows, you could get a partial column. (Partial
> columns are not desirable, for example, they work differently when you
> place the cursor on the end of a full line.)
In order to obtain pixelwise resizing you have to set
`frame-resize-pixelwise' to a non-nil-value. Please do that.
> Steps to repeat 1:
> emacs -q
>
> Switch to *scratch*: C-x b RET
>
> Evaluate:
> (set-default-font
> (create-fontset-from-ascii-font
> "-raster-Terminal-bold-r-normal-normal-8-60-96-96-c-*-ms-oemlatin"))
>
> Split the window using: C-x 3
>
> Insert a long line: C-u 37 x
>
> Here, the cursor is at the end of the line in the left window, it is
> rendered in the right fringe. (OK)
>
> Go to the other window: C-x o
>
> Place the cursor at the end: C-x >
>
> Here, the cursor is visible in the partially visible column. (NOT OK)
Sorry. Such problems can't be avoided, even without fringes and scroll
bars, when the window size is not a multiple of the size of the default
font. However, you can always calculate your "ideal" frame size based
on the number of side-by-side windows and the widths of the font, the
scroll bars and the fringes. Provided `frame-resize-pixelwise' is
non-nil, `set-frame-width' should then make the frame fit this size.
> Steps to repeat 2:
>
> emacs -q
>
> Evaluate the following:
>
> (set-frame-width (selected-frame) 607 nil t)
> (frame-pixel-width)
>
> Here, 632 is returned.
>
> (set-frame-width (selected-frame) 608 nil t)
> (frame-pixel-width)
>
> Here, 640 is returned. Clearly, the width of the frame is always a
> multiple of the character width.
Here on windows XP doing
(setq frame-resize-pixelwise t)
(set-frame-width (selected-frame) 607 nil t)
(frame-text-width)
yields 607 and
(setq frame-resize-pixelwise t)
(set-frame-width (selected-frame) 608 nil t)
(frame-text-width)
yields 608, as expected.
martin
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#18789
; Package
emacs
.
(Wed, 22 Oct 2014 15:00:03 GMT)
Full text and
rfc822 format available.
Message #11 received at 18789 <at> debbugs.gnu.org (full text, mbox):
> Date: Wed, 22 Oct 2014 15:43:01 +0200
> From: martin rudalics <rudalics <at> gmx.at>
>
> > emacs -q
> >
> > Switch to *scratch*: C-x b RET
> >
> > Evaluate:
> > (set-default-font
> > (create-fontset-from-ascii-font
> > "-raster-Terminal-bold-r-normal-normal-8-60-96-96-c-*-ms-oemlatin"))
> >
> > Split the window using: C-x 3
> >
> > Insert a long line: C-u 37 x
> >
> > Here, the cursor is at the end of the line in the left window, it is
> > rendered in the right fringe. (OK)
> >
> > Go to the other window: C-x o
> >
> > Place the cursor at the end: C-x >
> >
> > Here, the cursor is visible in the partially visible column. (NOT OK)
>
> Sorry. Such problems can't be avoided, even without fringes and scroll
> bars, when the window size is not a multiple of the size of the default
> font.
Moreover, the frame size after evaluating the
create-fontset-from-ascii-font form is odd, so "C-x 3" cannot possibly
create 2 windows of the same width. And that is what you see: one
window has one pixel more in its width, so we show the corresponding
part of the cursor. I don't see anything wrong with that.
Reply sent
to
martin rudalics <rudalics <at> gmx.at>
:
You have taken responsibility.
(Sun, 04 Jan 2015 18:11:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Anders Lindgren <andlind <at> gmail.com>
:
bug acknowledged by developer.
(Sun, 04 Jan 2015 18:11:03 GMT)
Full text and
rfc822 format available.
Message #16 received at 18789-done <at> debbugs.gnu.org (full text, mbox):
> In order to obtain pixelwise resizing you have to set
>> `frame-resize-pixelwise' to a non-nil-value. Please do that.
>>
>
> Thanks! That solved my problem!
I've updated the docs for set-frame-size/-height-/width appropriately.
Closing this bug.
Thanks, martin
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Mon, 02 Feb 2015 12:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 10 years and 137 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.