unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#14032: 24.3.50; regression: `modify-frame-parameters' no longer works correctly
@ 2013-03-22 18:57 Drew Adams
  2013-03-22 20:06 ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Drew Adams @ 2013-03-22 18:57 UTC (permalink / raw)
  To: 14032

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@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'
 






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

* bug#14032: 24.3.50; regression: `modify-frame-parameters' no longer works correctly
  2013-03-22 18:57 bug#14032: 24.3.50; regression: `modify-frame-parameters' no longer works correctly Drew Adams
@ 2013-03-22 20:06 ` Eli Zaretskii
  2013-03-22 21:14   ` Drew Adams
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2013-03-22 20:06 UTC (permalink / raw)
  To: Drew Adams; +Cc: 14032

> From: "Drew Adams" <drew.adams@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?





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

* bug#14032: 24.3.50; regression: `modify-frame-parameters' no longer works correctly
  2013-03-22 20:06 ` Eli Zaretskii
@ 2013-03-22 21:14   ` Drew Adams
  2013-03-22 21:40     ` Drew Adams
  0 siblings, 1 reply; 8+ messages in thread
From: Drew Adams @ 2013-03-22 21:14 UTC (permalink / raw)
  To: 'Eli Zaretskii'; +Cc: 14032

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






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

* bug#14032: 24.3.50; regression: `modify-frame-parameters' no longer works correctly
  2013-03-22 21:14   ` Drew Adams
@ 2013-03-22 21:40     ` Drew Adams
  2013-03-23  9:07       ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Drew Adams @ 2013-03-22 21:40 UTC (permalink / raw)
  To: 'Eli Zaretskii'; +Cc: 14032

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.






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

* bug#14032: 24.3.50; regression: `modify-frame-parameters' no longer works correctly
  2013-03-22 21:40     ` Drew Adams
@ 2013-03-23  9:07       ` Eli Zaretskii
  2013-03-23 15:07         ` Drew Adams
  2013-04-10 15:43         ` Eli Zaretskii
  0 siblings, 2 replies; 8+ messages in thread
From: Eli Zaretskii @ 2013-03-23  9:07 UTC (permalink / raw)
  To: Drew Adams; +Cc: 14032

> From: "Drew Adams" <drew.adams@oracle.com>
> Cc: <14032@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.





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

* bug#14032: 24.3.50; regression: `modify-frame-parameters' no longer works correctly
  2013-03-23  9:07       ` Eli Zaretskii
@ 2013-03-23 15:07         ` Drew Adams
  2013-04-10 15:43         ` Eli Zaretskii
  1 sibling, 0 replies; 8+ messages in thread
From: Drew Adams @ 2013-03-23 15:07 UTC (permalink / raw)
  To: 'Eli Zaretskii'; +Cc: 14032

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






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

* bug#14032: 24.3.50; regression: `modify-frame-parameters' no longer works correctly
  2013-03-23  9:07       ` Eli Zaretskii
  2013-03-23 15:07         ` Drew Adams
@ 2013-04-10 15:43         ` Eli Zaretskii
  2013-04-10 20:50           ` Drew Adams
  1 sibling, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2013-04-10 15:43 UTC (permalink / raw)
  To: drew.adams; +Cc: 14032

> Date: Sat, 23 Mar 2013 11:07:12 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: 14032@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?





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

* bug#14032: 24.3.50; regression: `modify-frame-parameters' no longer works correctly
  2013-04-10 15:43         ` Eli Zaretskii
@ 2013-04-10 20:50           ` Drew Adams
  0 siblings, 0 replies; 8+ messages in thread
From: Drew Adams @ 2013-04-10 20:50 UTC (permalink / raw)
  To: 'Eli Zaretskii'; +Cc: 14032

> Can this be closed now?

Yes, thanks.  I closed it.






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

end of thread, other threads:[~2013-04-10 20:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-22 18:57 bug#14032: 24.3.50; regression: `modify-frame-parameters' no longer works correctly Drew Adams
2013-03-22 20:06 ` Eli Zaretskii
2013-03-22 21:14   ` Drew Adams
2013-03-22 21:40     ` Drew Adams
2013-03-23  9:07       ` Eli Zaretskii
2013-03-23 15:07         ` Drew Adams
2013-04-10 15:43         ` Eli Zaretskii
2013-04-10 20:50           ` Drew Adams

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