GNU bug report logs - #28844
26.0.90; display-line-numbers-mode should call window-configuration-change-hook

Previous Next

Package: emacs;

Reported by: Paul Rankin <hello <at> paulwrankin.com>

Date: Sun, 15 Oct 2017 07:57:01 UTC

Severity: minor

Found in version 26.0.90

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Paul Rankin <hello <at> paulwrankin.com>
Subject: bug#28844: closed (Re: bug#28844: 26.0.90; display-line-numbers-mode
 should call window-configuration-change-hook)
Date: Fri, 20 Oct 2017 09:43:03 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#28844: 26.0.90; display-line-numbers-mode should call window-configuration-change-hook

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 28844 <at> debbugs.gnu.org.

-- 
28844: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=28844
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: hello <at> paulwrankin.com
Cc: agrambot <at> gmail.com, 28844-done <at> debbugs.gnu.org
Subject: Re: bug#28844: 26.0.90; display-line-numbers-mode should call
 window-configuration-change-hook
Date: Fri, 20 Oct 2017 12:42:18 +0300
> Date: Tue, 17 Oct 2017 11:33:57 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 28844 <at> debbugs.gnu.org, agrambot <at> gmail.com
> 
> So having looked at your package, I think post-command-hook will solve your
> problem.  All you need to do in the hook is check if line-number-display-width
> returns a value different from the last time, and if so, call your function
> olivetti-set-environment; otherwise do nothing.

Another possibility is to use pre-redisplay-function.  An example is
in tabulated-list.el.

Anyway, since there were no further comments, I'm marking this bug
done.

[Message part 3 (message/rfc822, inline)]
From: Paul Rankin <hello <at> paulwrankin.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.0.90; display-line-numbers-mode should call
 window-configuration-change-hook
Date: Sun, 15 Oct 2017 17:56:43 +1000
Activating/deactivating display-line-numbers-mode alters the window configuration and so should call window-configuration-change-hook but does not.

From the Emacs NEWS file:

> Lisp programs that need to know how much screen estate is used up for
> line-number display in a window can use the new function
> 'line-number-display-width'.

This is nice, but in order to use this, we need to know when to act upon it, e.g. when display-line-numbers-mode affects the window configuration. Or, if there is a more appropriate hook.

To reproduce:

1. emacs -Q
2. add a hook to window-configuration-change-hook
3. M-x display-line-numbers-mode

Expected results:

Hook added should run when enabling display-line-numbers.

Actual results:

Hook is not run.

Configuration:

GNU Emacs 26.0.90 (build 1, x86_64-apple-darwin17.0.0) of 2017-10-15
macOS 10.13 (17A405)

MacBook Pro (Retina, 15-inch, Mid 2015)
2.2 GHz Intel Core i7
16 GB 1600 MHz DDR3
Intel Iris Pro 1536 MB



This bug report was last modified 7 years and 166 days ago.

Previous Next


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