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

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

bug#21480: 25.0.50; Frame width gets set to 16 pixels wider than the pro


From: Kaushal Modi
Subject: bug#21480: 25.0.50; Frame width gets set to 16 pixels wider than the provided width in the args
Date: Tue, 15 Sep 2015 13:39:19 +0000

Hi Martin,

This was a great "today-I-learned" thread.

Both of your suggested solutions work:
- Using frame-text-width/height instead of frame-pixel-width/height is the right thing to do. I misunderstood frame-text-* fns to return the parameters in text char widths and frame-pixel-* fns to return the parameters in pixels.
- In emacs 25+, frame-inhibit-implied-resize can be set to '(menu-bar-lines) to prevent frame resize when toggling the menu bar.

Thank you!

On Tue, Sep 15, 2015 at 4:33 AM martin rudalics <rudalics@gmx.at> wrote:
 >    (set-frame-width nil width nil t)
 >    (message "%s" (cons width (frame-text-width))))

Sorry.  Without the ‘sit-for’ this is confusing.  So this

(let ((width (frame-pixel-width)))
   (setq frame-resize-pixelwise t)
   (set-frame-width nil (+ width 20) nil t)
   (sit-for 2)
   (set-frame-width nil width nil t)
   (sit-for 2)
   (message "%s" (cons width (frame-pixel-width))))

is bad while this

(let ((width (frame-text-width)))
   (setq frame-resize-pixelwise t)
   (set-frame-width nil (+ width 20) nil t)
   (sit-for 2)
   (set-frame-width nil width nil t)
   (sit-for 2)
   (message "%s" (cons width (frame-text-width))))

should do what you want.

martin


reply via email to

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