GNU bug report logs - #56457
29.0.50; set-frame-width and frame-width are not exactly complimentary

Previous Next

Package: emacs;

Reported by: Pankaj Jangid <pankaj <at> codeisgreat.org>

Date: Sat, 9 Jul 2022 03:29:02 UTC

Severity: normal

Found in version 29.0.50

Full log


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

From: Po Lu <luangruo <at> yahoo.com>
To: Pankaj Jangid <pankaj <at> codeisgreat.org>
Cc: 56457 <at> debbugs.gnu.org
Subject: Re: bug#56457: 29.0.50; set-frame-width and frame-width are not
 exactly complimentary
Date: Sat, 09 Jul 2022 12:56:44 +0800
Pankaj Jangid <pankaj <at> codeisgreat.org> writes:

> I have written a small lisp function to toggle width of frame to twice
> and half. This is not behaving as desired. Here is my lisp.
>
> (defun my/toggle-frame-width ()
>   "Toggle \"frame-width\"."
>   (interactive)
>   
>   (let ((width (frame-width)))
> 	(if (and (> width 75) (< width 85))
> 		(set-frame-width nil (* width 2))
> 	  (set-frame-width nil (/ width 2))
> 	(message "Frame size: %sx%s" (frame-width) (frame-height)))))
> (global-set-key (kbd "<f9>") 'my/toggle-frame-width)
>
> Steps:
> 1. emacs -Q
> 2. Evaluate above lisp. (WARN) This binds <f9> also.
> 3. Pres <f9> a couple of times 
>
> Result:
> After a couple of iterations. The frame-width is getting smaller and
> smaller.
>
> Desired behaviour:
> It should only toggle the width to double and half alternately.

What happens if you set `frame-resize-pixelwise' to nil, and create a
new frame?




This bug report was last modified 2 years and 342 days ago.

Previous Next


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