unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#11738: 24.1.50; Regression: `modify-frame-parameters' is broken for `left' & `top'
@ 2012-06-19  2:33 Drew Adams
  2012-07-02 16:36 ` Drew Adams
  2012-07-17  2:17 ` William Crandall
  0 siblings, 2 replies; 8+ messages in thread
From: Drew Adams @ 2012-06-19  2:33 UTC (permalink / raw)
  To: 11738


Note: It still works fine in the release (24.1), but is broken in this
build.
 
emacs -Q
 
In *scratch*:
 
(setq new (- (frame-parameter nil 'left) 10))
(setq new `(left + ,new))
(modify-frame-parameters nil (list new))
 
IOW, try to set `left' or `top' to a value that is a cons whose car is
`left' or `top', whose cadr is `+' or `-', and whose caddr is some new
value.  Nothing happens.

This is a regression wrt ALL previous Emacs versions (well, ever
since we had frames).  It is important that the cons form of these
parameter values continue to be accepted, as it has always been.

See also this, which brought the bug to my attention:
http://lists.gnu.org/archive/html/help-gnu-emacs/2012-06/msg00227.html


In GNU Emacs 24.1.50.1 (i386-mingw-nt5.1.2600)
 of 2012-06-18 on MARVIN
Bzr revision: 108646 michael.albinus@gmx.de-20120617185439-jfcgwwbr97nbflkz
Windowing system distributor `Microsoft Corp.', version 5.1.2600
Configured using:
 `configure --with-gcc (4.6) --no-opt --enable-checking --cflags
 -ID:/devel/emacs/libs/libXpm-3.5.8/include
 -ID:/devel/emacs/libs/libXpm-3.5.8/src
 -ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include
 -ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include
 -ID:/devel/emacs/libs/giflib-4.1.4-1/include
 -ID:/devel/emacs/libs/jpeg-6b-4/include
 -ID:/devel/emacs/libs/tiff-3.8.2-1/include
 -ID:/devel/emacs/libs/gnutls-3.0.9/include
 -ID:/devel/emacs/libs/libiconv-1.13.1-1-dev/include
 -ID:/devel/emacs/libs/libxml2-2.7.8/include/libxml2'
 






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

* bug#11738: 24.1.50; Regression: `modify-frame-parameters' is broken for `left' & `top'
  2012-06-19  2:33 bug#11738: 24.1.50; Regression: `modify-frame-parameters' is broken for `left' & `top' Drew Adams
@ 2012-07-02 16:36 ` Drew Adams
  2012-07-07 15:34   ` Drew Adams
  2012-07-18  8:10   ` Chong Yidong
  2012-07-17  2:17 ` William Crandall
  1 sibling, 2 replies; 8+ messages in thread
From: Drew Adams @ 2012-07-02 16:36 UTC (permalink / raw)
  To: 11738

ping.

> emacs -Q
> In *scratch*:
> (setq new (- (frame-parameter nil 'left) 10))
> (setq new `(left + ,new))
> (modify-frame-parameters nil (list new))
>  
> IOW, try to set `left' or `top' to a value that is a cons whose car is
> `left' or `top', whose cadr is `+' or `-', and whose caddr is some new
> value.  Nothing happens.
> 
> This is a regression wrt ALL previous Emacs versions (well, ever
> since we had frames).  It is important that the cons form of these
> parameter values continue to be accepted, as it has always been.






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

* bug#11738: 24.1.50; Regression: `modify-frame-parameters' is broken for `left' & `top'
  2012-07-02 16:36 ` Drew Adams
@ 2012-07-07 15:34   ` Drew Adams
  2012-07-14 21:10     ` Drew Adams
  2012-07-18  8:10   ` Chong Yidong
  1 sibling, 1 reply; 8+ messages in thread
From: Drew Adams @ 2012-07-07 15:34 UTC (permalink / raw)
  To: 11738

ping.  This is a regression.

The frame position parameters (`left' and `top') are broken now.

Please restore the use of cons values, which are consistent and facilitate
programmatic manipulation of frames.

Consider also adding conversion functions such as these between the parameter
forms.  These are defined in `frame-fns.el' and have been in use for decades.

`frame-geom-spec-cons'
`frame-geom-value-cons'
`frame-geom-spec-numeric'
`frame-geom-value-numeric'

And consider adding incremental, wraparound frame movement functions such as
these, defined in `frame-cmds.el':

`move-frame-up'
`move-frame-down'
`move-frame-left'
`move-frame-right'

The definition of `*-right' or `*-down' shows the importance of supporting a
simple cons parameter value:

(defun move-frame-down (&optional increment frame)
  "Move FRAME (default: selected-frame) down by INCREMENT.
INCREMENT is in units of ten pixels.
Interactively, it is given by the prefix argument."
  (interactive "P")
  (setq increment (if increment
                      (prefix-numeric-value increment)
                    10)) ; 1 is too small
  (modify-frame-parameters
   frame
   (list (list 'top '+ (new-frame-position frame 'top increment)))))

(defun new-frame-position (frame type incr)
  "Return the new TYPE position of FRAME, incremented by INCR.
TYPE is `left' or `top'.
INCR is the increment to use when changing the position."
  (let ((new-pos
         (+ incr
            (cadr (frame-geom-value-cons 
                   type
                   (cdr (assq type (frame-parameters frame)))))))
        (display-dimension
         (if (eq 'left type)
             (available-screen-pixel-width t)
           (available-screen-pixel-height t)))
        (frame-dimension
         (if (eq 'left type)
             (frame-pixel-width frame)
           (frame-pixel-height frame))))
    (if (not move-frame-wrap-within-display-flag)
        new-pos
      (when (< new-pos (- frame-dimension))
        (setq new-pos display-dimension))
      (when (> new-pos display-dimension)
        (setq new-pos (- frame-dimension)))
      new-pos)))

http://www.emacswiki.org/emacs/download/frame-fns.el
http://www.emacswiki.org/emacs/download/frame-cmds.el


> ping.
> 
> > emacs -Q
> > In *scratch*:
> > (setq new (- (frame-parameter nil 'left) 10))
> > (setq new `(left + ,new))
> > (modify-frame-parameters nil (list new))
> >  
> > IOW, try to set `left' or `top' to a value that is a cons 
> > whose car is `left' or `top', whose cadr is `+' or `-',
> > and whose caddr is some new value.  Nothing happens.
> > 
> > This is a regression wrt ALL previous Emacs versions (well, ever
> > since we had frames).  It is important that the cons form of these
> > parameter values continue to be accepted, as it has always been.






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

* bug#11738: 24.1.50; Regression: `modify-frame-parameters' is broken for `left' & `top'
  2012-07-07 15:34   ` Drew Adams
@ 2012-07-14 21:10     ` Drew Adams
  0 siblings, 0 replies; 8+ messages in thread
From: Drew Adams @ 2012-07-14 21:10 UTC (permalink / raw)
  To: 11738

ping.  No response - it's been a month so far.

> ping.  This is a regression.






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

* bug#11738: 24.1.50; Regression: `modify-frame-parameters' is broken for `left' & `top'
  2012-06-19  2:33 bug#11738: 24.1.50; Regression: `modify-frame-parameters' is broken for `left' & `top' Drew Adams
  2012-07-02 16:36 ` Drew Adams
@ 2012-07-17  2:17 ` William Crandall
  2012-07-23 22:09   ` William Crandall
  1 sibling, 1 reply; 8+ messages in thread
From: William Crandall @ 2012-07-17  2:17 UTC (permalink / raw)
  To: 11738

Hello,

I was the one who brought issue to Drew's attention a month ago:

http://lists.gnu.org/archive/html/help-gnu-emacs/2012-06/msg00227.html


The ability to slide frames side-to-side--with the keyboard--is vital
for frame-based emacs users, like myself.

If it is not possible to fix this regression, and revivify Drew's
move-frame-[up|down|left|right], are there alternate mechanisms?

I am not aware of any other options.

So I urge you to rectify this at your earliest convenience.

Many thanks,

-BC

GNU Emacs 24.1.50.1 (i386-mingw-nt6.1.7601) of 2012-06-18 on MARVIN
Windows 7





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

* bug#11738: 24.1.50; Regression: `modify-frame-parameters' is broken for `left' & `top'
  2012-07-02 16:36 ` Drew Adams
  2012-07-07 15:34   ` Drew Adams
@ 2012-07-18  8:10   ` Chong Yidong
  2012-07-18 13:32     ` Drew Adams
  1 sibling, 1 reply; 8+ messages in thread
From: Chong Yidong @ 2012-07-18  8:10 UTC (permalink / raw)
  To: Drew Adams; +Cc: Paul Eggert, 11738

"Drew Adams" <drew.adams@oracle.com> writes:

> emacs -Q
> In *scratch*:
> (setq new (- (frame-parameter nil 'left) 10))
> (setq new `(left + ,new))
> (modify-frame-parameters nil (list new))
>  
> IOW, try to set `left' or `top' to a value that is a cons whose car is
> `left' or `top', whose cadr is `+' or `-', and whose caddr is some new
> value.  Nothing happens.

Paul Eggert's revision 108370 is responsible.  The part below was bogus;
reverted in trunk.  Paul---please be more careful when doing such
code-churning.


***************
*** 2913,2919 ****
      }
  
    /* Don't die if just one of these was set.  */
!   if (EQ (left, Qunbound))
      {
        left_no_change = 1;
        if (f->left_pos < 0)
--- 2916,2922 ----
      }
  
    /* Don't die if just one of these was set.  */
!   if (! TYPE_RANGED_INTEGERP (int, left))
      {
        left_no_change = 1;
        if (f->left_pos < 0)
***************
*** 2921,2927 ****
        else
  	XSETINT (left, f->left_pos);
      }
!   if (EQ (top, Qunbound))
      {
        top_no_change = 1;
        if (f->top_pos < 0)
--- 2924,2930 ----
        else
  	XSETINT (left, f->left_pos);
      }
!   if (! TYPE_RANGED_INTEGERP (int, top))
      {
        top_no_change = 1;
        if (f->top_pos < 0)





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

* bug#11738: 24.1.50; Regression: `modify-frame-parameters' is broken for `left' & `top'
  2012-07-18  8:10   ` Chong Yidong
@ 2012-07-18 13:32     ` Drew Adams
  0 siblings, 0 replies; 8+ messages in thread
From: Drew Adams @ 2012-07-18 13:32 UTC (permalink / raw)
  To: 'Chong Yidong'
  Cc: 'Paul Eggert', 'William Crandall', 11738

> Paul Eggert's revision 108370 is responsible.  The part below 
> was bogus; reverted in trunk.  Paul---please be more careful
> when doing such code-churning.

Thank you for fixing it - I'll check with the next Windows binary and let you
know if I see any problem.

And thanks especially to William Crandall for adding his voice to the bug
thread, without which who knows whether there would ever have been any response
from Emacs Dev.

And let me repeat that you might want to consider adding to Emacs itself the
functionality (if not the same functions) that I mentioned is provided by my
(simple) code.

That would provide a more general/systematic/abstract way of handling frame
geometric parameters.






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

* bug#11738: 24.1.50; Regression: `modify-frame-parameters' is broken for `left' & `top'
  2012-07-17  2:17 ` William Crandall
@ 2012-07-23 22:09   ` William Crandall
  0 siblings, 0 replies; 8+ messages in thread
From: William Crandall @ 2012-07-23 22:09 UTC (permalink / raw)
  To: 11738

Thanks!

Just tried the new binary: All good again.

-BC

GNU Emacs 24.1.50.1 (i386-mingw-nt6.1.7601)
 of 2012-07-22 on MARVIN

From: emacs-20120723-r109189-bin-i386.zip





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

end of thread, other threads:[~2012-07-23 22:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-19  2:33 bug#11738: 24.1.50; Regression: `modify-frame-parameters' is broken for `left' & `top' Drew Adams
2012-07-02 16:36 ` Drew Adams
2012-07-07 15:34   ` Drew Adams
2012-07-14 21:10     ` Drew Adams
2012-07-18  8:10   ` Chong Yidong
2012-07-18 13:32     ` Drew Adams
2012-07-17  2:17 ` William Crandall
2012-07-23 22:09   ` William Crandall

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