GNU bug report logs - #14032
24.3.50; regression: `modify-frame-parameters' no longer works correctly

Previous Next

Package: emacs;

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

Date: Fri, 22 Mar 2013 19:00:02 UTC

Severity: normal

Found in version 24.3.50

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

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 14032 in the body.
You can then email your comments to 14032 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#14032; Package emacs. (Fri, 22 Mar 2013 19:00:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Drew Adams" <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 22 Mar 2013 19:00:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: <bug-gnu-emacs <at> gnu.org>
Subject: 24.3.50;
	regression: `modify-frame-parameters' no longer works correctly
Date: Fri, 22 Mar 2013 11:57:17 -0700
I have tried to debug this by walking through the debugger.  When I do
that step by step I cannot repro the problem.  The debugger is in a
separate frame on my setup, and no doubt that interferes with
reproducing the problem.  If I hit `c' in the debugger for the
`modify-frame-parameters' step then the problem appears.  If I hit
`d' instead (so I step through) then the problem does not show.
 
The problem is that `modify-frame-parameters', given an alist with
explicit `height' and `width' values, ignores these and seems to instead
apply the height and width of `default-frame-alist' (that's a guess).
 
Here is the value of (frame-parameters) after `m-f-p' has incorrectly
changed the size:
 
((top . 0)
 (left . 0)
 (buried-buffer-list #<buffer *Backtrace*>)
 (buffer-list #<buffer frame-fns.el> #<buffer  *Minibuf-1*> #<buffer *Pp Ev=
al Output*> #<buffer BEFORE-modify> #<buffer drews-lisp-20>)
 (width . 80)
 (height . 37) ; <========================== WRONG
 (tool-bar-position . top)
 (parent-id)
 (explicit-name . t)
 (display . "w32")
 (visibility . t)
 (icon-name)
 (window-id . "14026254")
 (unsplittable)
 (minibuffer)
 (modeline . t)
 (name . "frame-fns.el")
 (cursor-color . "Red")
 (background-mode . light)
 (display-type . color)
 (fringe . 0)
 (alpha)
 (scroll-bar-width . 19)
 (cursor-type . bar)
 (auto-lower)
 (auto-raise)
 (icon-type)
 (fullscreen)
 (title)
 (buffer-predicate)
 (tool-bar-lines . 0)
 (menu-bar-lines . 1)
 (right-fringe . 0)
 (left-fringe . 0)
 (line-spacing)
 (screen-gamma)
 (border-color . "black")
 (mouse-color . "Red")
 (background-color . "LightBlue")
 (foreground-color . "Black")
 (vertical-scroll-bars . right)
 (internal-border-width . 0)
 (border-width . 2)
 (font . "-outline-Lucida Console-normal-normal-normal-mono-14-*-*-*-c-*-is=
o8859-1")
 (font-parameter . "-*-Lucida Console-normal-r-*-*-14-112-96-96-c-*-iso8859=
-1")
 (font-backend uniscribe gdi))
 
And here is the backtrace at the point where `m-f-p' has finished.=20=20
You can see the parameter values that *should* have been set, and
contrast them with those shown above, which are the values that were
actually set.  Note, for example, that the height was set to 37 and not
to 57 as was requested.
 
Debugger entered--returning value: nil
  modify-frame-parameters(#<frame frame-fns.el 066262C0> ((top . 0) (left .=
 0) (buried-buffer-list #<buffer *Backtrace*>) (buffer-list #<buffer frame-=
fns.el> #<buffer *Pp Eval Output*> #<buffer  *Minibuf-1*> #<buffer BEFORE-m=
odify> #<buffer drews-lisp-20>) (width . 80) (height . 57) (tool-bar-positi=
on . top) (parent-id) (explicit-name . t) (display . "w32") (visibility . t=
) (icon-name) (window-id . "14026254") (unsplittable) (minibuffer) (modelin=
e . t) (name . "frame-fns.el") (cursor-color . "Red") (background-mode . li=
ght) (display-type . color) (fringe . 0) (alpha) (scroll-bar-width . 19) (c=
ursor-type . bar) (auto-lower) (auto-raise) (icon-type) (fullscreen) (title=
) (buffer-predicate) (tool-bar-lines . 0) (menu-bar-lines . 1) (right-fring=
e . 0) (left-fringe . 0) (line-spacing) (screen-gamma) (border-color . "bla=
ck") (mouse-color . "Red") (background-color . "LightBlue") (foreground-col=
or . "Black") (vertical-scroll-bars . right) (internal-border-width . 0) (b=
order-width . 2) (font . "-outline-Lucida Console-normal-normal-normal-mono=
-14-*-*-*-c-*-iso8859-1") (font-parameter . "-*-Lucida Console-normal-r-*-*=
-14-112-96-96-c-*-iso8859-1") (font-backend uniscribe gdi)))
* (progn (enlarge-font thumfr-font-difference frame) (modify-frame-paramete=
rs frame non-tf-params))
* (condition-case thumfr-dethumbify-frame (progn (enlarge-font thumfr-font-=
difference frame) (modify-frame-parameters frame non-tf-params)) (error (if=
 fr+non-tf-params (progn (add-to-list (quote thumfr-thumbnail-frames) fr+no=
n-tf-params))) (setq thumfr-non-thumbnail-frames (delq fr+tf-params thumfr-=
non-thumbnail-frames)) (error (error-message-string thumfr-dethumbify-frame=
))))
* (progn (add-to-list (quote thumfr-non-thumbnail-frames) fr+tf-params) (se=
tq thumfr-thumbnail-frames (delq fr+non-tf-params thumfr-thumbnail-frames))=
 (condition-case thumfr-dethumbify-frame (progn (enlarge-font thumfr-font-d=
ifference frame) (modify-frame-parameters frame non-tf-params)) (error (if =
fr+non-tf-params (progn (add-to-list (quote thumfr-thumbnail-frames) fr+non=
-tf-params))) (setq thumfr-non-thumbnail-frames (delq fr+tf-params thumfr-n=
on-thumbnail-frames)) (error (error-message-string thumfr-dethumbify-frame)=
))) (select-frame-set-input-focus frame) (thumfr-only-raise-frame frame))
* (if fr+non-tf-params (progn (add-to-list (quote thumfr-non-thumbnail-fram=
es) fr+tf-params) (setq thumfr-thumbnail-frames (delq fr+non-tf-params thum=
fr-thumbnail-frames)) (condition-case thumfr-dethumbify-frame (progn (enlar=
ge-font thumfr-font-difference frame) (modify-frame-parameters frame non-tf=
-params)) (error (if fr+non-tf-params (progn (add-to-list (quote thumfr-thu=
mbnail-frames) fr+non-tf-params))) (setq thumfr-non-thumbnail-frames (delq =
fr+tf-params thumfr-non-thumbnail-frames)) (error (error-message-string thu=
mfr-dethumbify-frame)))) (select-frame-set-input-focus frame) (thumfr-only-=
raise-frame frame)))
* (let* ((fr+non-tf-params (assoc frame thumfr-thumbnail-frames)) (non-tf-p=
arams (cdr fr+non-tf-params)) (tf-params (frame-parameters frame)) (fr+tf-p=
arams (cons frame tf-params))) (if fr+non-tf-params (progn (add-to-list (qu=
ote thumfr-non-thumbnail-frames) fr+tf-params) (setq thumfr-thumbnail-frame=
s (delq fr+non-tf-params thumfr-thumbnail-frames)) (condition-case thumfr-d=
ethumbify-frame (progn (enlarge-font thumfr-font-difference frame) (modify-=
frame-parameters frame non-tf-params)) (error (if fr+non-tf-params (progn (=
add-to-list ... fr+non-tf-params))) (setq thumfr-non-thumbnail-frames (delq=
 fr+tf-params thumfr-non-thumbnail-frames)) (error (error-message-string th=
umfr-dethumbify-frame)))) (select-frame-set-input-focus frame) (thumfr-only=
-raise-frame frame))))
* (lambda (&optional frame) "Restore thumbnail FRAME to original size (defa=
ult: selected frame)." (interactive) (setq frame (or frame (selected-frame)=
)) (let* ((fr+non-tf-params (assoc frame thumfr-thumbnail-frames)) (non-tf-=
params (cdr fr+non-tf-params)) (tf-params (frame-parameters frame)) (fr+tf-=
params (cons frame tf-params))) (if fr+non-tf-params (progn (add-to-list (q=
uote thumfr-non-thumbnail-frames) fr+tf-params) (setq thumfr-thumbnail-fram=
es (delq fr+non-tf-params thumfr-thumbnail-frames)) (condition-case thumfr-=
dethumbify-frame (progn (enlarge-font thumfr-font-difference frame) (modify=
-frame-parameters frame non-tf-params)) (error (if fr+non-tf-params (progn =
...)) (setq thumfr-non-thumbnail-frames (delq fr+tf-params thumfr-non-thumb=
nail-frames)) (error (error-message-string thumfr-dethumbify-frame)))) (sel=
ect-frame-set-input-focus frame) (thumfr-only-raise-frame frame)))))(#<fram=
e frame-fns.el 066262C0>)
* apply((lambda (&optional frame) "Restore thumbnail FRAME to original size=
 (default: selected frame)." (interactive) (setq frame (or frame (selected-=
frame))) (let* ((fr+non-tf-params (assoc frame thumfr-thumbnail-frames)) (n=
on-tf-params (cdr fr+non-tf-params)) (tf-params (frame-parameters frame)) (=
fr+tf-params (cons frame tf-params))) (if fr+non-tf-params (progn (add-to-l=
ist (quote thumfr-non-thumbnail-frames) fr+tf-params) (setq thumfr-thumbnai=
l-frames (delq fr+non-tf-params thumfr-thumbnail-frames)) (condition-case t=
humfr-dethumbify-frame (progn (enlarge-font thumfr-font-difference frame) (=
modify-frame-parameters frame non-tf-params)) (error (if fr+non-tf-params (=
progn ...)) (setq thumfr-non-thumbnail-frames (delq fr+tf-params thumfr-non=
-thumbnail-frames)) (error (error-message-string thumfr-dethumbify-frame)))=
) (select-frame-set-input-focus frame) (thumfr-only-raise-frame frame))))) =
#<frame frame-fns.el 066262C0>)
* thumfr-dethumbify-frame(#<frame frame-fns.el 066262C0>)
  (if (assoc frame thumfr-thumbnail-frames) (thumfr-dethumbify-frame frame)=
 (thumfr-thumbify-frame frame))
  thumfr-toggle-thumbnail-frame()
  ad-Advice-iconify-or-deiconify-frame(#[nil "..." [visibility frame-parame=
ters t iconify-frame make-frame-visible] 2 897398 nil])
  apply(ad-Advice-iconify-or-deiconify-frame #[nil "..." [visibility frame-=
parameters t iconify-frame make-frame-visible] 2 897398 nil] nil)
  iconify-or-deiconify-frame()
  (if iconify-all (iconify-everything) (if rename-frame-when-iconify-flag (=
progn (rename-non-minibuffer-frame))) (iconify-or-deiconify-frame))
  iconify/map-frame(nil)
  call-interactively(iconify/map-frame nil nil)
  command-execute(iconify/map-frame) 
 
In GNU Emacs 24.3.50.1 (i386-mingw-nt5.1.2600)
 of 2013-03-17 on ODIEONE
Bzr revision: 112068 michael.albinus <at> gmx.de-20130317173046-sgy1bmmkkizorqby
Windowing system distributor `Microsoft Corp.', version 5.1.2600
Configured using:
 `configure --with-gcc (4.7) --no-opt --enable-checking --cflags
 -IC:/Devel/emacs/build/include --ldflags -LC:/Devel/emacs/build/lib'
 





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14032; Package emacs. (Fri, 22 Mar 2013 20:09:02 GMT) Full text and rfc822 format available.

Message #8 received at 14032 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 14032 <at> debbugs.gnu.org
Subject: Re: bug#14032: 24.3.50;
	regression: `modify-frame-parameters' no longer works correctly
Date: Fri, 22 Mar 2013 22:06:07 +0200
> From: "Drew Adams" <drew.adams <at> oracle.com>
> Date: Fri, 22 Mar 2013 11:57:17 -0700
> 
> The problem is that `modify-frame-parameters', given an alist with
> explicit `height' and `width' values, ignores these and seems to instead
> apply the height and width of `default-frame-alist' (that's a guess).

I cannot reproduce this, but since you didn't give a recipe, I'm
probably doing something different from you.  When I evaluate

  (modify-frame-parameters nil '((width . 60) (height . 50)))

in "emacs -Q", the frame is resized according to the parameters I
give.  Isn't that what you said didn't work?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14032; Package emacs. (Fri, 22 Mar 2013 21:17:03 GMT) Full text and rfc822 format available.

Message #11 received at 14032 <at> debbugs.gnu.org (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'Eli Zaretskii'" <eliz <at> gnu.org>
Cc: 14032 <at> debbugs.gnu.org
Subject: RE: bug#14032: 24.3.50;
	regression: `modify-frame-parameters' no longer works correctly
Date: Fri, 22 Mar 2013 14:14:26 -0700
> I cannot reproduce this, but since you didn't give a recipe, I'm
> probably doing something different from you.  When I evaluate
> 
>   (modify-frame-parameters nil '((width . 60) (height . 50)))
> 
> in "emacs -Q", the frame is resized according to the parameters I
> give.  Isn't that what you said didn't work?

No, of course not.  If it had been so simple to diagnose I would have sent your
trivial recipe.  And I would not have spent time trying to follow what was
happening in the debugger (to no avail).

There is a bug, and there was no such bug before.  I described the symptoms I
see.  I included printouts showing those symptoms: a backtrace showing the call
to `modify-frame-parameters' and the eval of (frame-parameters) showing that the
result does not correspond to the alist passed to `m-f-p'.

How is it possible that `m-f-p' produces parameters that conflict with those it
is passed?  Answer that and perhaps you will find the culprit code change.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14032; Package emacs. (Fri, 22 Mar 2013 21:44:02 GMT) Full text and rfc822 format available.

Message #14 received at 14032 <at> debbugs.gnu.org (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'Eli Zaretskii'" <eliz <at> gnu.org>
Cc: 14032 <at> debbugs.gnu.org
Subject: RE: bug#14032: 24.3.50;
	regression: `modify-frame-parameters' no longer works correctly
Date: Fri, 22 Mar 2013 14:40:52 -0700
OK, here is a recipe from emacs -Q:

Load these three source files, in order: frame-fns.el, frame-cmds.el,
thumb-frm.el.  They are available here:
http://www.emacswiki.org/emacs/?action=elisp-area;context=0

Visit a lisp file in a separate frame (e.g. C-x 5 f).

Manually resize the lisp-file frame to be wider and taller than the default
size, enough so you will notice the difference (quite large, if you want).

C-z to thumbify the frame.  C-z to dethumbify it.  It should be as it was before
thumbification: same position, height, and width.  It is not - it seems to be
the default frame size.

That's the regression.

It's as if some parameters from `default-frame-alist' were being substituted for
some of the parameters provided explicitly to `modify-frame-parameters'.  ("It's
as if..." - I don't say that that is what is actually happening.)

The frame parameters before thumbifying are recorded on list
`thumfr-thumbnail-frames': there is an alist entry for each thumbnail frame; the
cdr is the list of frame parameters before that frame was thumbified.

It is those pre-thumbification parameters that are passed to
`modify-frame-parameters' when you hit C-z the second time (command
`iconify-or-deiconify-frame', which calls `thumfr-toggle-thumbnail-frame', which
calls `thumfr-dethumbify-frame', which calls (modify-frame-parameters frame
non-tf-params), where FRAME is the selected frame and NON-TF-PARAMS is the list
of frame parameters recorded before thumbification.

If you prefer, select the name "thumfr-dethumbify-frame", then thumbify, then
M-x C-y RET to call `thumfr-dethumbify-frame' directly.  Same wrong size
restored.

HTH.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14032; Package emacs. (Sat, 23 Mar 2013 09:10:02 GMT) Full text and rfc822 format available.

Message #17 received at 14032 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 14032 <at> debbugs.gnu.org
Subject: Re: bug#14032: 24.3.50;
	regression: `modify-frame-parameters' no longer works correctly
Date: Sat, 23 Mar 2013 11:07:12 +0200
> From: "Drew Adams" <drew.adams <at> oracle.com>
> Cc: <14032 <at> debbugs.gnu.org>
> Date: Fri, 22 Mar 2013 14:40:52 -0700
> 
> OK, here is a recipe from emacs -Q:
> 
> Load these three source files, in order: frame-fns.el, frame-cmds.el,
> thumb-frm.el.  They are available here:
> http://www.emacswiki.org/emacs/?action=elisp-area;context=0
> 
> Visit a lisp file in a separate frame (e.g. C-x 5 f).
> 
> Manually resize the lisp-file frame to be wider and taller than the default
> size, enough so you will notice the difference (quite large, if you want).
> 
> C-z to thumbify the frame.  C-z to dethumbify it.  It should be as it was before
> thumbification: same position, height, and width.  It is not - it seems to be
> the default frame size.
> 
> That's the regression.

Thanks.  For the record, here's a much easier way of reproducing the
bug:

  emacs -Q
  Resize the frame by dragging one of its edges with the mouse
  M-: (modify-frame-parameters nil '((fullscreen))) RET

IOW, the problem was that when 'fullscreen' was present in the frame
parameters with a nil value, the frame dimensions were reset to the
"original" size, which was recorded only during startup, and thus
disregarded later changes of the frame dimensions.

I think I fixed this in revision 112114 on the trunk.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14032; Package emacs. (Sat, 23 Mar 2013 15:10:01 GMT) Full text and rfc822 format available.

Message #20 received at 14032 <at> debbugs.gnu.org (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'Eli Zaretskii'" <eliz <at> gnu.org>
Cc: 14032 <at> debbugs.gnu.org
Subject: RE: bug#14032: 24.3.50;
	regression: `modify-frame-parameters' no longer works correctly
Date: Sat, 23 Mar 2013 08:07:00 -0700
> Thanks.  For the record, here's a much easier way of reproducing
> the bug:
>   emacs -Q
>   Resize the frame by dragging one of its edges with the mouse
>   M-: (modify-frame-parameters nil '((fullscreen))) RET
> 
> IOW, the problem was that when 'fullscreen' was present in the frame
> parameters with a nil value, the frame dimensions were reset to the
> "original" size, which was recorded only during startup, and thus
> disregarded later changes of the frame dimensions.
> 
> I think I fixed this in revision 112114 on the trunk.

Thanks very much for persisting on this, Eli, including finding the simple
recipe.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14032; Package emacs. (Wed, 10 Apr 2013 15:48:01 GMT) Full text and rfc822 format available.

Message #23 received at 14032 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: drew.adams <at> oracle.com
Cc: 14032 <at> debbugs.gnu.org
Subject: Re: bug#14032: 24.3.50;
	regression: `modify-frame-parameters' no longer works correctly
Date: Wed, 10 Apr 2013 18:43:31 +0300
> Date: Sat, 23 Mar 2013 11:07:12 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 14032 <at> debbugs.gnu.org
> 
>   emacs -Q
>   Resize the frame by dragging one of its edges with the mouse
>   M-: (modify-frame-parameters nil '((fullscreen))) RET
> 
> IOW, the problem was that when 'fullscreen' was present in the frame
> parameters with a nil value, the frame dimensions were reset to the
> "original" size, which was recorded only during startup, and thus
> disregarded later changes of the frame dimensions.
> 
> I think I fixed this in revision 112114 on the trunk.

Can this be closed now?




bug closed, send any further explanations to 14032 <at> debbugs.gnu.org and "Drew Adams" <drew.adams <at> oracle.com> Request was from "Drew Adams" <drew.adams <at> oracle.com> to control <at> debbugs.gnu.org. (Wed, 10 Apr 2013 20:54:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14032; Package emacs. (Wed, 10 Apr 2013 20:55:02 GMT) Full text and rfc822 format available.

Message #28 received at 14032 <at> debbugs.gnu.org (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'Eli Zaretskii'" <eliz <at> gnu.org>
Cc: 14032 <at> debbugs.gnu.org
Subject: RE: bug#14032: 24.3.50;
	regression: `modify-frame-parameters' no longer works correctly
Date: Wed, 10 Apr 2013 13:50:59 -0700
> Can this be closed now?

Yes, thanks.  I closed it.





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 09 May 2013 11:24:03 GMT) Full text and rfc822 format available.

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

Previous Next


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