From: Pankaj Jangid <pankaj@codeisgreat.org>
To: 56457@debbugs.gnu.org
Subject: bug#56457: 29.0.50; set-frame-width and frame-width are not exactly complimentary
Date: Sat, 09 Jul 2022 08:58:46 +0530 [thread overview]
Message-ID: <87bktzvua9.fsf@codeisgreat.org> (raw)
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.
--8<---------------cut here---------------start------------->8---
(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)
--8<---------------cut here---------------end--------------->8---
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.
In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0)
of 2022-07-09 built on anant
Repository revision: 29c8866c7fcd325995c6fc9b2b18537855fee52c
Repository branch: master
System Description: Debian GNU/Linux 11 (bullseye)
Configured using:
'configure --prefix=/home/pankaj/.local --with-pgtk'
Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY
PDUMPER PGTK PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS XIM
GTK3 ZLIB
Important settings:
value of $LANG: en_IN.UTF-8
value of $XMODIFIERS: @im=ibus
locale-coding-system: utf-8-unix
Major mode: Group
Minor modes in effect:
gnus-undo-mode: t
winner-mode: t
windmove-mode: t
editorconfig-mode: t
marginalia-mode: t
which-key-mode: t
hl-line-mode: t
savehist-mode: t
tooltip-mode: t
global-eldoc-mode: t
show-paren-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
buffer-read-only: t
column-number-mode: t
line-number-mode: t
indent-tabs-mode: t
transient-mark-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
Load-path shadows:
None found.
Features:
(shadow sort vc-hg vc-git diff-mode vc-bzr vc-src vc-sccs vc-svn vc-cvs
vc-rcs log-view pcvs-util vc vc-dispatcher mail-extr emacsbug gnus-async
gnus-ml disp-table nndraft nnmh utf-7 nnml nnfolder cl-extra epa-file
network-stream nsm gnus-agent gnus-srvr gnus-score score-mode nnvirtual
gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime gnutls dig nntp
gnus-cache gnus-sum shr pixel-fill kinsoku url-file url-dired svg dom
gnus-group gnus-undo .gnus gnus-start gnus-dbus dbus xml gnus-cloud
nnimap nnmail mail-source utf7 netrc nnoo parse-time gnus-spec gnus-int
gnus-range message sendmail yank-media puny dired dired-loaddefs rfc822
mml mml-sec epa derived epg rfc6068 epg-config mm-decode mm-bodies
mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev
gmm-utils mailheader gnus-win gnus nnheader gnus-util mail-utils range
mm-util mail-prsvr wid-edit checkdoc lisp-mnt corfu init my-init
org-element avl-tree generator org org-macro org-footnote org-pcomplete
pcomplete org-list org-faces org-entities noutline outline easy-mmode
org-version ob-plantuml ob-sql ob-css ob-js ob-java ob-C cc-mode
cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars
cc-defs ob-python python ob-R ob ob-tangle org-src ob-ref ob-lob
ob-table ob-exp ob-comint ob-emacs-lisp ob-core ob-eval org-table
oc-basic bibtex iso8601 time-date ol org-keys oc org-compat advice
org-macs org-loaddefs format-spec cal-menu calendar cal-loaddefs server
winner windmove modus-vivendi-theme modus-themes delight eglot array
filenotify jsonrpc ert pp ewoc debug backtrace help-mode find-func xref
flymake-proc flymake warnings pcase project imenu editorconfig
rust-utils thingatpt rust-mode rust-rustfmt rust-playpen rust-compile
compile text-property-search comint ansi-color ring rust-cargo
marginalia which-key exec-path-from-shell hl-line savehist avoid
cus-load finder-inf tex-site cider-autoloads clojure-mode-autoloads
compat-autoloads corfu-autoloads denote-autoloads
dockerfile-mode-autoloads eglot-autoloads rx marginalia-autoloads
markdown-mode-autoloads php-mode-autoloads prettier-autoloads
f-autoloads dash-autoloads request-autoloads rust-mode-autoloads
use-package-ensure-system-package-autoloads system-packages-autoloads
info vertico-autoloads which-key-autoloads package browse-url url
url-proxy url-privacy url-expand url-methods url-history url-cookie
generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache json subr-x map byte-opt gv bytecomp byte-compile cconv
url-vars cl-loaddefs cl-lib early-init rmc iso-transl tooltip eldoc
paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode
mwheel term/pgtk-win pgtk-win term/common-win pgtk-dnd tool-bar dnd
fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow
isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax
font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
faces cus-face macroexp files window text-properties overlay sha1 md5
base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify
dynamic-setting system-font-setting font-render-setting cairo gtk pgtk
lcms2 multi-tty make-network-process emacs)
Memory information:
((conses 16 818637 38632)
(symbols 48 37719 0)
(strings 32 158969 5703)
(string-bytes 1 4933609)
(vectors 16 59200)
(vector-slots 8 724066 31648)
(floats 8 367 165)
(intervals 56 690 0)
(buffers 992 26))
next reply other threads:[~2022-07-09 3:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-09 3:28 Pankaj Jangid [this message]
2022-07-09 3:54 ` bug#56457: 29.0.50; set-frame-width and frame-width are not exactly complimentary Pankaj Jangid
2022-07-09 4:56 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-09 7:04 ` Pankaj Jangid
2022-07-09 7:47 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-09 8:18 ` Pankaj Jangid
2022-07-09 8:21 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bktzvua9.fsf@codeisgreat.org \
--to=pankaj@codeisgreat.org \
--cc=56457@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).