From 77838534ce878f98a4ed946778dbf021385db0bf Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 25 Aug 2018 03:16:32 +0200 Subject: [PATCH] Polyfill line-number-display-width for Emacs 25 Fixes void-function line-number-display-width errors (used in company-pseudo-tooltip-frontend). --- core/autoload/line-numbers.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/autoload/line-numbers.el b/core/autoload/line-numbers.el index cf5985093..1fa32d7a6 100644 --- a/core/autoload/line-numbers.el +++ b/core/autoload/line-numbers.el @@ -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)))