Polyfill line-number-display-width for Emacs 25

Fixes void-function line-number-display-width errors (used in
company-pseudo-tooltip-frontend).
This commit is contained in:
Henrik Lissner 2018-08-25 03:16:32 +02:00
parent 6515a1c539
commit 77838534ce
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -50,6 +50,13 @@ When `display-line-numbers-mode' is turned on,
to display all line numbers in the buffer."
:type 'boolean)
;;;###autoload
(defun line-number-display-width ()
"Return the width used for displaying line numbers in the
selected window."
(length (save-excursion (goto-char (point-max))
(format-mode-line "%l"))))
(defun display-line-numbers-update-width ()
"Prevent the line number width from shrinking."
(let ((width (line-number-display-width)))