diff options
| author | Lars Magne Ingebrigtsen | 2011-07-02 14:27:53 +0200 |
|---|---|---|
| committer | Lars Magne Ingebrigtsen | 2011-07-02 14:27:53 +0200 |
| commit | 063b0e45af10b6275c868ae70343f228f68eb63b (patch) | |
| tree | cdf5e8d59d4f17a20b08261e4448127acaf62bc3 /lisp/disp-table.el | |
| parent | 28545e04974fd13858eaff304cc09b562fd9f71f (diff) | |
| download | emacs-063b0e45af10b6275c868ae70343f228f68eb63b.tar.gz emacs-063b0e45af10b6275c868ae70343f228f68eb63b.zip | |
* 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.el | 20 |
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', | |||
| 94 | (while (< i 256) | 94 | (while (< i 256) |
| 95 | (aset vector i (aref dt i)) | 95 | (aset vector i (aref dt i)) |
| 96 | (setq i (1+ i))) | 96 | (setq i (1+ i))) |
| 97 | (describe-vector vector)) | 97 | (describe-vector |
| 98 | vector 'display-table-print-array)) | ||
| 98 | (help-mode)))) | 99 | (help-mode)))) |
| 99 | 100 | ||
| 101 | (defun display-table-print-array (desc) | ||
| 102 | (insert "[") | ||
| 103 | (let ((column (current-column)) | ||
| 104 | (width (window-width)) | ||
| 105 | string) | ||
| 106 | (dotimes (i (length desc)) | ||
| 107 | (setq string (format "%s" (aref desc i))) | ||
| 108 | (cond | ||
| 109 | ((>= (+ (current-column) (length string) 1) | ||
| 110 | width) | ||
| 111 | (insert "\n") | ||
| 112 | (insert (make-string column ? ))) | ||
| 113 | ((> i 0) | ||
| 114 | (insert " "))) | ||
| 115 | (insert string))) | ||
| 116 | (insert "]\n")) | ||
| 117 | |||
| 100 | ;;;###autoload | 118 | ;;;###autoload |
| 101 | (defun describe-current-display-table () | 119 | (defun describe-current-display-table () |
| 102 | "Describe the display table in use in the selected window and buffer." | 120 | "Describe the display table in use in the selected window and buffer." |