bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#56457: 29.0.50; set-frame-width and frame-width are not exactly comp


From: Po Lu
Subject: bug#56457: 29.0.50; set-frame-width and frame-width are not exactly complimentary
Date: Sat, 09 Jul 2022 12:56:44 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux)

Pankaj Jangid <pankaj@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?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]