Browse Source

Fix colview-related failing tests

* lisp/org-compat.el (org-line-number-display-width): New function.
* lisp/org-colview.el (org-columns--display-here-title): Use new
  function.
Nicolas Goaziou 3 years ago
parent
commit
eab65c9cf8
2 changed files with 8 additions and 1 deletions
  1. 1 1
      lisp/org-colview.el
  2. 7 0
      lisp/org-compat.el

+ 1 - 1
lisp/org-colview.el

@@ -448,7 +448,7 @@ for the duration of the command.")
   "Overlay the newline before the current line with the table title."
   (interactive)
   (let ((title "")
-	(linum-offset (line-number-display-width 'columns))
+	(linum-offset (org-line-number-display-width 'columns))
 	(i 0))
     (dolist (column org-columns-current-fmt-compiled)
       (pcase column

+ 7 - 0
lisp/org-compat.el

@@ -62,6 +62,13 @@
 (defvar org-table1-hline-regexp)
 
 
+;;; Emacs < 26.1 compatibility
+
+(if (fboundp 'line-number-display-width)
+    (defalias 'org-line-number-display-width 'line-number-display-width)
+  (defun org-line-number-display-width (&rest _) 0))
+
+
 ;;; Emacs < 25.1 compatibility
 
 (when (< emacs-major-version 25)