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


View this message in rfc822 format

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

>>> What happens if you set `frame-resize-pixelwise' to nil, and create a
>>> new frame?
>>
>> frame-resize-pixelwise is set to default value i.e. nil and with this
>> when I create new a frame using make-frame-command it creates a new
>> frame with frame-width 79. Repeating this any number of times has the
>> same outcome.
>
> Sorry, I meant to set it to a non-nil value.

If I set it to "t" then my toggle function also works correctly. And the
new frames are launched with frame-width 80. Here is my slightly updated
lisp,

--8<---------------cut here---------------start------------->8---
(custom-set-variables
 '(frame-resize-pixelwise t))

(defun my/cycle-frame-width ()
  "Cycle \"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/cycle-frame-width)
--8<---------------cut here---------------end--------------->8---

The only issue now is that, the "(message..." statement prints width as
83. I don't know why. If I evaluate (frame-width), it shows 80.




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

Previous Next


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