From: Lars Magne Ingebrigtsen Date: Sat, 2 Jul 2011 12:27:53 +0000 (+0200) Subject: * disp-table.el (display-table-print-array): New function. X-Git-Tag: emacs-pretest-24.0.90~104^2~152^2~254 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=063b0e45af10b6275c868ae70343f228f68eb63b;p=emacs.git * disp-table.el (display-table-print-array): New function. (describe-display-table): Use it to print the vectors more pretty (Bug#8859). --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 277131a13db..0d7ebbadaef 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2011-07-02 Lars Magne Ingebrigtsen + + * disp-table.el (display-table-print-array): New function. + (describe-display-table): Use it to print the vectors more pretty + (Bug#8859). + 2011-07-02 Martin Rudalics * window.el (window-state-get-1): Don't assign clone numbers. 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."