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 7 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

@@ -61,6 +61,13 @@
 (defvar org-table-tab-recognizes-table.el)
 (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