]> code.delx.au - gnu-emacs/commitdiff
* disp-table.el (display-table-print-array): New function.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Sat, 2 Jul 2011 12:27:53 +0000 (14:27 +0200)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Sat, 2 Jul 2011 12:27:53 +0000 (14:27 +0200)
(describe-display-table): Use it to print the vectors more pretty
(Bug#8859).

lisp/ChangeLog
lisp/disp-table.el

index 277131a13db0fa01cac8dd94834906b36f5f008a..0d7ebbadaeffbeb602d2b485833f974bcd3dd5ee 100644 (file)
@@ -1,3 +1,9 @@
+2011-07-02  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * 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  <rudalics@gmx.at>
 
        * window.el (window-state-get-1): Don't assign clone numbers.
index 7a9043a6a0ada858b9ac6a2b1ec6c8950d03a630..3befedac2565f0fc32efe185aa57b05e136e18d3 100644 (file)
@@ -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."