Apply changes suggested by @jingtaozf

This commit is contained in:
Lars Tveito 2016-02-28 11:31:27 +01:00
parent ea7437a068
commit 92f418d3c5

View File

@ -93,9 +93,9 @@ holding contextual information."
(defvar width-cookies nil) (defvar width-cookies nil)
(defvar width-cookies-table nil) (defvar width-cookies-table nil)
(defconst gfm-table-left-border "| ") (defconst gfm-table-left-border "|")
(defconst gfm-table-right-border " |") (defconst gfm-table-right-border " |")
(defconst gfm-table-separator " | ") (defconst gfm-table-separator " |")
(defun org-gfm-table-col-width (table column info) (defun org-gfm-table-col-width (table column info)
"Return width of TABLE at given COLUMN. INFO is a plist used as "Return width of TABLE at given COLUMN. INFO is a plist used as
@ -135,7 +135,7 @@ the column."
"Return a function to build horizontal line in TABLE with given "Return a function to build horizontal line in TABLE with given
CHAR. INFO is a plist used as a communication channel." CHAR. INFO is a plist used as a communication channel."
`(lambda (col) `(lambda (col)
(let ((max-width (org-gfm-table-col-width table col info))) (let ((max-width (max 3 (org-gfm-table-col-width table col info))))
(when (< max-width 1) (when (< max-width 1)
(setq max-width 1)) (setq max-width 1))
(make-string max-width ,char)))) (make-string max-width ,char))))
@ -154,7 +154,7 @@ of the cell. INFO is a plist used as a communication channel."
(data (or contents ""))) (data (or contents "")))
(setq contents (setq contents
(concat data (concat data
(make-string (- width (string-width data)) (make-string (max 0 (- width (string-width data)))
?\s))) ?\s)))
(concat left-border contents right-border))) (concat left-border contents right-border)))