From ea99d5c8005586f8c99ed495f92be1fa2c01bc26 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Tue, 5 Oct 2004 04:23:55 +0000 Subject: [PATCH] (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. --- lisp/ChangeLog | 10 ++++++++++ lisp/info.el | 29 ++++++++++++++++------------- 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 @@ +2004-10-05 Juri Linkov + + * isearch.el (isearch-done): Set mark after running hook. + Suggested by Drew Adams . + + * info.el (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. + 2004-10-05 Emilio C. Lopes : * 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." (let ((inhibit-read-only t)) (erase-buffer) (goto-char (point-min)) - (insert "\n\^_\nFile: history Node: Top, Up: (dir)\n\n") + (insert "\n\^_\nFile: history, Node: Top, Up: (dir)\n\n") (insert "Recently Visited Nodes\n**********************\n\n") (insert "* Menu:\n\n") (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." "Go to a node with table of contents of the current Info file. Table of contents is created from the tree structure of menus." (interactive) - (let ((curr-file Info-current-file) - (curr-node Info-current-node) + (let ((curr-file (substring-no-properties Info-current-file)) + (curr-node (substring-no-properties Info-current-node)) p) (with-current-buffer (get-buffer-create " *info-toc*") (let ((inhibit-read-only t) (node-list (Info-build-toc curr-file))) (erase-buffer) (goto-char (point-min)) - (insert "\n\^_\nFile: toc Node: Top, Up: (dir)\n\n") + (insert "\n\^_\nFile: toc, Node: Top, Up: (dir)\n\n") (insert "Table of Contents\n*****************\n\n") - (insert "*Note Top::\n") + (insert "*Note Top: (" curr-file ")Top.\n") (Info-insert-toc (nth 2 (assoc "Top" node-list)) ; get Top nodes - node-list 0 (substring-no-properties curr-file))) + node-list 0 curr-file)) (if (not (bobp)) (let ((Info-hide-note-references 'hide) (Info-fontify-visited-nodes nil)) (Info-mode) (setq Info-current-file "toc" Info-current-node "Top") - (Info-fontify-node))) + (goto-char (point-min)) + (narrow-to-region (or (re-search-forward "\n[\^_\f]\n" nil t) + (point-min)) + (point-max)) + (Info-fontify-node) + (widen))) (goto-char (point-min)) (if (setq p (search-forward (concat "*Note " curr-node ":") nil t)) (setq p (- p (length curr-node) 2)))) @@ -1789,14 +1794,12 @@ Table of contents is created from the tree structure of menus." (defun Info-build-toc (file) "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")) (with-temp-buffer - (let* ((default-directory (or (and (stringp file) - (file-name-directory - (setq file (Info-find-file file)))) + (let* ((file (and (stringp file) (Info-find-file file))) + (default-directory (or (and (stringp file) + (file-name-directory file)) default-directory)) - (main-file file) + (main-file (and (stringp file) file)) (sections '(("Top" "Top"))) nodes subfiles) (while (or main-file subfiles) -- 2.39.5