From 1dfb6683d7f155fe92803618939a71b955cea664 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sat, 9 Oct 2010 10:13:34 +0200 Subject: [PATCH] Allow shr table char to be customized Signed-off-by: Julien Danjou --- lisp/ChangeLog | 6 ++++++ lisp/shr.el | 14 ++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fb5f1e250..edf2ec7c3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2010-10-09 Julien Danjou + + * shr.el (shr-table-corner): Add. + (shr-table-line): Add. + (shr-insert-table-ruler): Use the above defcustoms to insert tables. + 2010-10-08 Julien Danjou * mm-decode.el (mm-text-html-renderer): Add mm-shr in choice list. diff --git a/lisp/shr.el b/lisp/shr.el index daafa61d3..8f246a06e 100644 --- a/lisp/shr.el +++ b/lisp/shr.el @@ -53,6 +53,16 @@ fit these criteria." :group 'shr :type 'regexp) +(defcustom shr-table-line ?- + "Character used to draw table line." + :group 'shr + :type 'char) + +(defcustom shr-table-corner ?+ + "Charater used to draw table corner." + :group 'shr + :type 'char) + (defvar shr-content-function nil "If bound, this should be a function that will return the content. This is used for cid: URLs, and the function is called with the @@ -532,9 +542,9 @@ Return a string with image data." (defun shr-insert-table-ruler (widths) (shr-indent) - (insert "+") + (insert shr-table-corner) (dotimes (i (length widths)) - (insert (make-string (aref widths i) ?-) ?+)) + (insert (make-string (aref widths i) shr-table-line) shr-table-corner)) (insert "\n")) (defun shr-table-widths (table suggested-widths) -- 2.25.1