diff options
| author | Kenichi Handa | 2008-10-25 01:31:35 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2008-10-25 01:31:35 +0000 |
| commit | c6ec96f84a64513eaa05ea0247ef651152a71b7e (patch) | |
| tree | 30589f2c7ff53e416fcd09b25b2dbde4f4c35f86 | |
| parent | 46bf60bcbf777c506111a22a74e7f6592f480dd4 (diff) | |
| download | emacs-c6ec96f84a64513eaa05ea0247ef651152a71b7e.tar.gz emacs-c6ec96f84a64513eaa05ea0247ef651152a71b7e.zip | |
(describe-categories): Display the terse legend at the head.
| -rw-r--r-- | lisp/help-fns.el | 52 |
1 files changed, 40 insertions, 12 deletions
diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 612b90ff62b..d08c184e1f5 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el | |||
| @@ -780,20 +780,48 @@ BUFFER should be a buffer or a buffer name." | |||
| 780 | (setq buffer (or buffer (current-buffer))) | 780 | (setq buffer (or buffer (current-buffer))) |
| 781 | (help-setup-xref (list #'describe-categories buffer) (interactive-p)) | 781 | (help-setup-xref (list #'describe-categories buffer) (interactive-p)) |
| 782 | (with-help-window (help-buffer) | 782 | (with-help-window (help-buffer) |
| 783 | (let ((table (with-current-buffer buffer (category-table)))) | 783 | (let* ((table (with-current-buffer buffer (category-table))) |
| 784 | (docs (char-table-extra-slot table 0))) | ||
| 785 | (if (or (not (vectorp docs)) (/= (length docs) 95)) | ||
| 786 | (error "Invalid first extra slot in this category table\n")) | ||
| 784 | (with-current-buffer standard-output | 787 | (with-current-buffer standard-output |
| 788 | (insert "Legend of category mnemonics (see the tail for the longer description)\n") | ||
| 789 | (let ((pos (point)) (items 0) lines n) | ||
| 790 | (dotimes (i 95) | ||
| 791 | (if (aref docs i) (setq items (1+ items)))) | ||
| 792 | (setq lines (1+ (/ (1- items) 4))) | ||
| 793 | (setq n 0) | ||
| 794 | (dotimes (i 95) | ||
| 795 | (let ((elt (aref docs i))) | ||
| 796 | (when elt | ||
| 797 | (string-match ".*" elt) | ||
| 798 | (setq elt (match-string 0 elt)) | ||
| 799 | (if (>= (length elt) 17) | ||
| 800 | (setq elt (concat (substring elt 0 14) "..."))) | ||
| 801 | (if (< (point) (point-max)) | ||
| 802 | (move-to-column (* 20 (/ n lines)) t)) | ||
| 803 | (insert (+ i ?\s) ?: elt) | ||
| 804 | (if (< (point) (point-max)) | ||
| 805 | (forward-line 1) | ||
| 806 | (insert "\n")) | ||
| 807 | (setq n (1+ n)) | ||
| 808 | (if (= (% n lines) 0) | ||
| 809 | (goto-char pos)))))) | ||
| 810 | (goto-char (point-max)) | ||
| 811 | (insert "\n" | ||
| 812 | "character(s)\tcategory mnemonics\n" | ||
| 813 | "------------\t------------------") | ||
| 785 | (describe-vector table 'help-describe-category-set) | 814 | (describe-vector table 'help-describe-category-set) |
| 786 | (let ((docs (char-table-extra-slot table 0))) | 815 | (insert "Legend of category mnemonics:\n") |
| 787 | (if (or (not (vectorp docs)) (/= (length docs) 95)) | 816 | (dotimes (i 95) |
| 788 | (insert "Invalid first extra slot in this char table\n") | 817 | (let ((elt (aref docs i))) |
| 789 | (insert "Meanings of mnemonic characters are:\n") | 818 | (when elt |
| 790 | (dotimes (i 95) | 819 | (if (string-match "\n" elt) |
| 791 | (let ((elt (aref docs i))) | 820 | (setq elt (substring elt (match-end 0)))) |
| 792 | (when elt | 821 | (insert (+ i ?\s) ": " elt "\n")))) |
| 793 | (insert (+ i ?\s) ": " elt "\n")))) | 822 | (while (setq table (char-table-parent table)) |
| 794 | (while (setq table (char-table-parent table)) | 823 | (insert "\nThe parent category table is:") |
| 795 | (insert "\nThe parent category table is:") | 824 | (describe-vector table 'help-describe-category-set)))))) |
| 796 | (describe-vector table 'help-describe-category-set)))))))) | ||
| 797 | 825 | ||
| 798 | (provide 'help-fns) | 826 | (provide 'help-fns) |
| 799 | 827 | ||