瀏覽代碼

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 年之前
父節點
當前提交
eab65c9cf8
共有 2 個文件被更改,包括 8 次插入1 次删除
  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."
   "Overlay the newline before the current line with the table title."
   (interactive)
   (interactive)
   (let ((title "")
   (let ((title "")
-	(linum-offset (line-number-display-width 'columns))
+	(linum-offset (org-line-number-display-width 'columns))
 	(i 0))
 	(i 0))
     (dolist (column org-columns-current-fmt-compiled)
     (dolist (column org-columns-current-fmt-compiled)
       (pcase column
       (pcase column

+ 7 - 0
lisp/org-compat.el

@@ -61,6 +61,13 @@
 (defvar org-table-tab-recognizes-table.el)
 (defvar org-table-tab-recognizes-table.el)
 (defvar org-table1-hline-regexp)
 (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
 ;;; Emacs < 25.1 compatibility