aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2004-10-05 04:23:55 +0000
committerJuri Linkov2004-10-05 04:23:55 +0000
commitea99d5c8005586f8c99ed495f92be1fa2c01bc26 (patch)
treec9babbfa51b371d4a5c219a884ed743c1b31480e
parent071fdd66922f288844c3aa52edfdbd375179d866 (diff)
downloademacs-ea99d5c8005586f8c99ed495f92be1fa2c01bc26.tar.gz
emacs-ea99d5c8005586f8c99ed495f92be1fa2c01bc26.zip
(Info-history, Info-toc): Fix Info headers.
(Info-toc): Narrow buffer before Info-fontify-node. (Info-build-toc): Don't check for special Info file names. Set main-file to nil if Info-find-file returns a symbol.
-rw-r--r--lisp/ChangeLog10
-rw-r--r--lisp/info.el29
2 files changed, 26 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 9385dcc825e..94ad045d5bb 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,13 @@
12004-10-05 Juri Linkov <juri@jurta.org>
2
3 * isearch.el (isearch-done): Set mark after running hook.
4 Suggested by Drew Adams <drew.adams@oracle.com>.
5
6 * info.el (Info-history, Info-toc): Fix Info headers.
7 (Info-toc): Narrow buffer before Info-fontify-node.
8 (Info-build-toc): Don't check for special Info file names.
9 Set main-file to nil if Info-find-file returns a symbol.
10
12004-10-05 Emilio C. Lopes <eclig@gmx.net>: 112004-10-05 Emilio C. Lopes <eclig@gmx.net>:
2 12
3 * calendar/calendar.el (calendar-goto-iso-week): Add autoload. 13 * calendar/calendar.el (calendar-goto-iso-week): Add autoload.
diff --git a/lisp/info.el b/lisp/info.el
index b779bb41ca6..2a20fc4898c 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -1729,7 +1729,7 @@ If SAME-FILE is non-nil, do not move to a different Info file."
1729 (let ((inhibit-read-only t)) 1729 (let ((inhibit-read-only t))
1730 (erase-buffer) 1730 (erase-buffer)
1731 (goto-char (point-min)) 1731 (goto-char (point-min))
1732 (insert "\n\^_\nFile: history Node: Top, Up: (dir)\n\n") 1732 (insert "\n\^_\nFile: history, Node: Top, Up: (dir)\n\n")
1733 (insert "Recently Visited Nodes\n**********************\n\n") 1733 (insert "Recently Visited Nodes\n**********************\n\n")
1734 (insert "* Menu:\n\n") 1734 (insert "* Menu:\n\n")
1735 (let ((hl (delete '("history" "Top") Info-history-list))) 1735 (let ((hl (delete '("history" "Top") Info-history-list)))
@@ -1749,26 +1749,31 @@ If SAME-FILE is non-nil, do not move to a different Info file."
1749 "Go to a node with table of contents of the current Info file. 1749 "Go to a node with table of contents of the current Info file.
1750Table of contents is created from the tree structure of menus." 1750Table of contents is created from the tree structure of menus."
1751 (interactive) 1751 (interactive)
1752 (let ((curr-file Info-current-file) 1752 (let ((curr-file (substring-no-properties Info-current-file))
1753 (curr-node Info-current-node) 1753 (curr-node (substring-no-properties Info-current-node))
1754 p) 1754 p)
1755 (with-current-buffer (get-buffer-create " *info-toc*") 1755 (with-current-buffer (get-buffer-create " *info-toc*")
1756 (let ((inhibit-read-only t) 1756 (let ((inhibit-read-only t)
1757 (node-list (Info-build-toc curr-file))) 1757 (node-list (Info-build-toc curr-file)))
1758 (erase-buffer) 1758 (erase-buffer)
1759 (goto-char (point-min)) 1759 (goto-char (point-min))
1760 (insert "\n\^_\nFile: toc Node: Top, Up: (dir)\n\n") 1760 (insert "\n\^_\nFile: toc, Node: Top, Up: (dir)\n\n")
1761 (insert "Table of Contents\n*****************\n\n") 1761 (insert "Table of Contents\n*****************\n\n")
1762 (insert "*Note Top::\n") 1762 (insert "*Note Top: (" curr-file ")Top.\n")
1763 (Info-insert-toc 1763 (Info-insert-toc
1764 (nth 2 (assoc "Top" node-list)) ; get Top nodes 1764 (nth 2 (assoc "Top" node-list)) ; get Top nodes
1765 node-list 0 (substring-no-properties curr-file))) 1765 node-list 0 curr-file))
1766 (if (not (bobp)) 1766 (if (not (bobp))
1767 (let ((Info-hide-note-references 'hide) 1767 (let ((Info-hide-note-references 'hide)
1768 (Info-fontify-visited-nodes nil)) 1768 (Info-fontify-visited-nodes nil))
1769 (Info-mode) 1769 (Info-mode)
1770 (setq Info-current-file "toc" Info-current-node "Top") 1770 (setq Info-current-file "toc" Info-current-node "Top")
1771 (Info-fontify-node))) 1771 (goto-char (point-min))
1772 (narrow-to-region (or (re-search-forward "\n[\^_\f]\n" nil t)
1773 (point-min))
1774 (point-max))
1775 (Info-fontify-node)
1776 (widen)))
1772 (goto-char (point-min)) 1777 (goto-char (point-min))
1773 (if (setq p (search-forward (concat "*Note " curr-node ":") nil t)) 1778 (if (setq p (search-forward (concat "*Note " curr-node ":") nil t))
1774 (setq p (- p (length curr-node) 2)))) 1779 (setq p (- p (length curr-node) 2))))
@@ -1789,14 +1794,12 @@ Table of contents is created from the tree structure of menus."
1789 1794
1790(defun Info-build-toc (file) 1795(defun Info-build-toc (file)
1791 "Build table of contents from menus of Info FILE and its subfiles." 1796 "Build table of contents from menus of Info FILE and its subfiles."
1792 (if (equal file "dir")
1793 (error "Table of contents for Info directory is not supported yet"))
1794 (with-temp-buffer 1797 (with-temp-buffer
1795 (let* ((default-directory (or (and (stringp file) 1798 (let* ((file (and (stringp file) (Info-find-file file)))
1796 (file-name-directory 1799 (default-directory (or (and (stringp file)
1797 (setq file (Info-find-file file)))) 1800 (file-name-directory file))
1798 default-directory)) 1801 default-directory))
1799 (main-file file) 1802 (main-file (and (stringp file) file))
1800 (sections '(("Top" "Top"))) 1803 (sections '(("Top" "Top")))
1801 nodes subfiles) 1804 nodes subfiles)
1802 (while (or main-file subfiles) 1805 (while (or main-file subfiles)