From: Drew Adams <drew.adams@oracle.com>
To: 29050@debbugs.gnu.org
Subject: bug#29050: 26.0; Change in when `window-configuration-change-hook' is run
Date: Sat, 28 Oct 2017 18:25:35 -0700 (PDT) [thread overview]
Message-ID: <37edcb5c-29d2-4125-a86d-a360db6fcd5f@default> (raw)
This change does not seem right (from NEWS):
*** Resizing a frame no longer runs 'window-configuration-change-hook'.
'window-size-change-functions' should be used instead.
Previously you could have a hook on 'window-configuration-change-hook'
that would take effect for frame resizings. Now you cannot.
Perhaps someone thought that just telling users to use
'window-size-change-functions' instead would suffice. No. That hook
(which already existed, and which was fine as it was) is for ABNORMAL
hooks. This incompatible change means that you cannot use the same,
NORMAL hook for both'window-configuration-change-hook' and
'window-size-change-functions'.
So if you want the behavior you had before, i.e., you want a function to
be invoked for both kinds of changes, you are out of luck. You need to
have two different functions, or you need to at least change the
function to accept a frame argument, even if it is not used. Why?
Example:
(define-minor-mode pretty-control-l-mode
"Toggle pretty display of Control-l (`^L') characters.
With ARG, turn pretty display of `^L' on if and only if ARG is positive."
:init-value nil :global t :group 'Pretty-Control-L
(if pretty-control-l-mode
(add-hook 'window-configuration-change-hook 'refresh-pretty-control-l)
(remove-hook 'window-configuration-change-hook 'refresh-pretty-control-l))
(walk-windows
(lambda (window)
(let ((display-table (or (window-display-table window)
(make-display-table))))
(aset display-table ?\014 (and pretty-control-l-mode
(pp^L-^L-display-table-entry window)))
(set-window-display-table window display-table)))
'no-minibuf
'visible))
The hook function no longer kicks in for "frame resizing", which also
means that it no longer kicks in when a frame is created. So now the
code needs to add the hook function to both hooks (a normal hook and an
abnormal hook). And the hook function, `refresh-pretty-control-l', now
needs to be changed to accept a phantom FRAME arg:
(defun refresh-pretty-control-l (&optional _)
"Reinitialize `pretty-control-l-mode', if on, to update the display."
(interactive)
(when pretty-control-l-mode (pretty-control-l-mode t)))
Why this incompatible change?
In GNU Emacs 26.0.90 (build 3, x86_64-w64-mingw32)
of 2017-10-13
Repository revision: 906224eba147bdfc0514090064e8e8f53160f1d4
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
`configure --without-dbus --host=x86_64-w64-mingw32
--without-compress-install 'CFLAGS=-O2 -static -g3''
next reply other threads:[~2017-10-29 1:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-29 1:25 Drew Adams [this message]
2017-10-29 11:19 ` bug#29050: 26.0; Change in when `window-configuration-change-hook' is run martin rudalics
2017-10-30 0:10 ` Drew Adams
2017-10-30 8:24 ` martin rudalics
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=37edcb5c-29d2-4125-a86d-a360db6fcd5f@default \
--to=drew.adams@oracle.com \
--cc=29050@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).