summaryrefslogtreecommitdiff
path: root/lisp/disp-table.el
diff options
context:
space:
mode:
authorLars Magne Ingebrigtsen <larsi@gnus.org>2011-07-02 14:27:53 +0200
committerLars Magne Ingebrigtsen <larsi@gnus.org>2011-07-02 14:27:53 +0200
commit063b0e45af10b6275c868ae70343f228f68eb63b (patch)
treecdf5e8d59d4f17a20b08261e4448127acaf62bc3 /lisp/disp-table.el
parent28545e04974fd13858eaff304cc09b562fd9f71f (diff)
downloademacs-063b0e45af10b6275c868ae70343f228f68eb63b.tar.gz
* disp-table.el (display-table-print-array): New function.
(describe-display-table): Use it to print the vectors more pretty (Bug#8859).
Diffstat (limited to 'lisp/disp-table.el')
-rw-r--r--lisp/disp-table.el20
1 files changed, 19 insertions, 1 deletions
diff --git a/lisp/disp-table.el b/lisp/disp-table.el
index 7a9043a6a0a..3befedac256 100644
--- a/lisp/disp-table.el
+++ b/lisp/disp-table.el
@@ -94,9 +94,27 @@ Valid symbols are `truncation', `wrap', `escape', `control',
(while (< i 256)
(aset vector i (aref dt i))
(setq i (1+ i)))
- (describe-vector vector))
+ (describe-vector
+ vector 'display-table-print-array))
(help-mode))))
+(defun display-table-print-array (desc)
+ (insert "[")
+ (let ((column (current-column))
+ (width (window-width))
+ string)
+ (dotimes (i (length desc))
+ (setq string (format "%s" (aref desc i)))
+ (cond
+ ((>= (+ (current-column) (length string) 1)
+ width)
+ (insert "\n")
+ (insert (make-string column ? )))
+ ((> i 0)
+ (insert " ")))
+ (insert string)))
+ (insert "]\n"))
+
;;;###autoload
(defun describe-current-display-table ()
"Describe the display table in use in the selected window and buffer."