瀏覽代碼

org-table.el: Enhance `org-table-set-header-line-format'

* lisp/org-table.el (org-table-set-header-line-format): Skip
lines setting column widths with <[0-9]+>.

Thanks to Bernard Hugueney for suggesting this.
Bastien 5 年之前
父節點
當前提交
eb5ff71c16
共有 1 個文件被更改,包括 6 次插入4 次删除
  1. 6 4
      lisp/org-table.el

+ 6 - 4
lisp/org-table.el

@@ -489,10 +489,12 @@ existing value of `header-line-format' we might want to restore."
 		;; Are we using `org-indent-mode'?
 		(pre (and (boundp 'org-indent-mode) org-indent-mode
 			  (length (get-text-property (point) 'line-prefix))))
-		(tbeg (if (save-excursion (goto-char beg) (org-at-table-hline-p))
-			  (save-excursion
-			    (goto-char beg) (move-beginning-of-line 2) (point))
-			beg)))
+		(tbeg (save-excursion
+			(goto-char beg)
+			(while (or (org-at-table-hline-p)
+				   (looking-at-p ".*|\\s-+<[0-9]+>"))
+			  (move-beginning-of-line 2))
+			(point))))
 	   (if (< tbeg (save-excursion (move-to-window-line 0) (point)))
 	       (setq header-line-format
 		     (propertize