79 |
:group 'info) |
:group 'info) |
80 |
|
|
81 |
(defface info-xref |
(defface info-xref |
82 |
'((((class color) (background light)) :foreground "blue") |
'((((class color) (background light)) :foreground "blue" :underline t) |
83 |
(((class color) (background dark)) :foreground "cyan") |
(((class color) (background dark)) :foreground "cyan" :underline t) |
84 |
(t :underline t)) |
(t :underline t)) |
85 |
"Face for Info cross-references." |
"Face for Info cross-references." |
86 |
:group 'info) |
:group 'info) |
455 |
|
|
456 |
;;;###autoload (add-hook 'same-window-regexps "\\*info\\*\\(\\|<[0-9]+>\\)") |
;;;###autoload (add-hook 'same-window-regexps "\\*info\\*\\(\\|<[0-9]+>\\)") |
457 |
|
|
458 |
|
;;;###autoload (put 'info 'info-file "emacs") |
459 |
;;;###autoload |
;;;###autoload |
460 |
(defun info (&optional file buffer) |
(defun info (&optional file buffer) |
461 |
"Enter Info, the documentation browser. |
"Enter Info, the documentation browser. |
1730 |
(let ((inhibit-read-only t)) |
(let ((inhibit-read-only t)) |
1731 |
(erase-buffer) |
(erase-buffer) |
1732 |
(goto-char (point-min)) |
(goto-char (point-min)) |
1733 |
(insert "\n\^_\nFile: history Node: Top, Up: (dir)\n\n") |
(insert "\n\^_\nFile: history, Node: Top, Up: (dir)\n\n") |
1734 |
(insert "Recently Visited Nodes\n**********************\n\n") |
(insert "Recently Visited Nodes\n**********************\n\n") |
1735 |
(insert "* Menu:\n\n") |
(insert "* Menu:\n\n") |
1736 |
(let ((hl (delete '("history" "Top") Info-history-list))) |
(let ((hl (delete '("history" "Top") Info-history-list))) |
1750 |
"Go to a node with table of contents of the current Info file. |
"Go to a node with table of contents of the current Info file. |
1751 |
Table of contents is created from the tree structure of menus." |
Table of contents is created from the tree structure of menus." |
1752 |
(interactive) |
(interactive) |
1753 |
(let ((curr-file Info-current-file) |
(let ((curr-file (substring-no-properties Info-current-file)) |
1754 |
(curr-node Info-current-node) |
(curr-node (substring-no-properties Info-current-node)) |
1755 |
p) |
p) |
1756 |
(with-current-buffer (get-buffer-create " *info-toc*") |
(with-current-buffer (get-buffer-create " *info-toc*") |
1757 |
(let ((inhibit-read-only t) |
(let ((inhibit-read-only t) |
1758 |
(node-list (Info-build-toc curr-file))) |
(node-list (Info-build-toc curr-file))) |
1759 |
(erase-buffer) |
(erase-buffer) |
1760 |
(goto-char (point-min)) |
(goto-char (point-min)) |
1761 |
(insert "\n\^_\nFile: toc Node: Top, Up: (dir)\n\n") |
(insert "\n\^_\nFile: toc, Node: Top, Up: (dir)\n\n") |
1762 |
(insert "Table of Contents\n*****************\n\n") |
(insert "Table of Contents\n*****************\n\n") |
1763 |
(insert "*Note Top::\n") |
(insert "*Note Top: (" curr-file ")Top.\n") |
1764 |
(Info-insert-toc |
(Info-insert-toc |
1765 |
(nth 2 (assoc "Top" node-list)) ; get Top nodes |
(nth 2 (assoc "Top" node-list)) ; get Top nodes |
1766 |
node-list 0 (substring-no-properties curr-file))) |
node-list 0 curr-file)) |
1767 |
(if (not (bobp)) |
(if (not (bobp)) |
1768 |
(let ((Info-hide-note-references 'hide) |
(let ((Info-hide-note-references 'hide) |
1769 |
(Info-fontify-visited-nodes nil)) |
(Info-fontify-visited-nodes nil)) |
1770 |
(Info-mode) |
(Info-mode) |
1771 |
(setq Info-current-file "toc" Info-current-node "Top") |
(setq Info-current-file "toc" Info-current-node "Top") |
1772 |
(Info-fontify-node))) |
(goto-char (point-min)) |
1773 |
|
(narrow-to-region (or (re-search-forward "\n[\^_\f]\n" nil t) |
1774 |
|
(point-min)) |
1775 |
|
(point-max)) |
1776 |
|
(Info-fontify-node) |
1777 |
|
(widen))) |
1778 |
(goto-char (point-min)) |
(goto-char (point-min)) |
1779 |
(if (setq p (search-forward (concat "*Note " curr-node ":") nil t)) |
(if (setq p (search-forward (concat "*Note " curr-node ":") nil t)) |
1780 |
(setq p (- p (length curr-node) 2)))) |
(setq p (- p (length curr-node) 2)))) |
1795 |
|
|
1796 |
(defun Info-build-toc (file) |
(defun Info-build-toc (file) |
1797 |
"Build table of contents from menus of Info FILE and its subfiles." |
"Build table of contents from menus of Info FILE and its subfiles." |
|
(if (equal file "dir") |
|
|
(error "Table of contents for Info directory is not supported yet")) |
|
1798 |
(with-temp-buffer |
(with-temp-buffer |
1799 |
(let* ((default-directory (or (and (stringp file) |
(let* ((file (and (stringp file) (Info-find-file file))) |
1800 |
(file-name-directory |
(default-directory (or (and (stringp file) |
1801 |
(setq file (Info-find-file file)))) |
(file-name-directory file)) |
1802 |
default-directory)) |
default-directory)) |
1803 |
(main-file file) |
(main-file (and (stringp file) file)) |
1804 |
(sections '(("Top" "Top"))) |
(sections '(("Top" "Top"))) |
1805 |
nodes subfiles) |
nodes subfiles) |
1806 |
(while (or main-file subfiles) |
(while (or main-file subfiles) |
3262 |
(car elt) |
(car elt) |
3263 |
elt)) |
elt)) |
3264 |
(file (if (consp elt) (cdr elt) elt)) |
(file (if (consp elt) (cdr elt) elt)) |
3265 |
|
(case-fold-search nil) |
3266 |
(regexp (concat "\\`" (regexp-quote name) |
(regexp (concat "\\`" (regexp-quote name) |
3267 |
"\\(\\'\\|-\\)"))) |
"\\(\\'\\|-\\)"))) |
3268 |
(if (string-match regexp (symbol-name command)) |
(if (string-match regexp (symbol-name command)) |