comparison lisp/info.el @ 55174:084cf910857b

Add *info*<[0-9]+> to same-window-regexps instead of same-window-buffer-names. (info): New arg `buffer'. Use it. Doc fix. Read file name for non-numeric prefix argument, append the number to the buffer name for numeric prefix argument. (info-other-window): Bind same-window-regexps to nil. (Info-reference-name): Rename to Info-point-loc. (Info-find-node-2): Call forward-line for numeric Info-point-loc, and Info-find-index-name for stringy Info-point-loc. (Info-extract-menu-node-name): New arg `index-node'. Use regexp without middle `.', but with final `.' and optional line number for it. Set Info-point-loc for index nodes. (Info-index): Remove middle `.' from index entry regexp. Modify line number regexp. (Info-index-next): Decrement line number. (info-apropos): Remove middle `.' from index entry regexp. Add optional line number regexp at the end. Add matched value for line number to the result list and insert it to the buffer. (Info-fontify-node): Hide index line numbers. (Info-goto-node): Replace "\\s *\\'" by "\\s +\\'" to not trim empty matches. (Info-follow-reference): Use `str' instead of Info-following-node-name-re. (Info-toc): Use full file names. Set Info-current-node to "Top". (Info-fontify-node): Compare file names without directory name. (Info-try-follow-nearest-node): Don't set Info-reference-name. Set second arg of Info-extract-menu-node-name for index nodes. (info-xref-visited): Use magenta3 instead of magenta4. (Info-mode): Add info-apropos to docstring.
author Juri Linkov <juri@jurta.org>
date Tue, 27 Apr 2004 06:39:46 +0000
parents 33f0fdb8887c
children 3616e8c83bfa
comparison
equal deleted inserted replaced
55173:ff738c1cdcc9 55174:084cf910857b
86 :group 'info) 86 :group 'info)
87 87
88 (defface info-xref-visited 88 (defface info-xref-visited
89 '((t :inherit info-xref) 89 '((t :inherit info-xref)
90 (((class color) (background light)) :foreground "magenta4") 90 (((class color) (background light)) :foreground "magenta4")
91 (((class color) (background dark)) :foreground "magenta4")) 91 (((class color) (background dark)) :foreground "magenta3")) ;"violet"?
92 "Face for visited Info cross-references." 92 "Face for visited Info cross-references."
93 :group 'info) 93 :group 'info)
94 94
95 (defcustom Info-fontify-visited-nodes t 95 (defcustom Info-fontify-visited-nodes t
96 "*Non-nil means to fontify visited nodes in a different face." 96 "*Non-nil means to fontify visited nodes in a different face."
237 "Cached completion list for current Info file.") 237 "Cached completion list for current Info file.")
238 238
239 (defvar Info-index-alternatives nil 239 (defvar Info-index-alternatives nil
240 "List of possible matches for last `Info-index' command.") 240 "List of possible matches for last `Info-index' command.")
241 241
242 (defvar Info-reference-name nil 242 (defvar Info-point-loc nil
243 "Name of the selected cross-reference. 243 "Point location within a selected node.
244 Point is moved to the proper occurrence of this name within a node 244 If string, the point is moved to the proper occurrence of the
245 after selecting it.") 245 name of the followed cross reference within a selected node.
246 If number, the point is moved to the corresponding line.")
246 247
247 (defvar Info-standalone nil 248 (defvar Info-standalone nil
248 "Non-nil if Emacs was started solely as an Info browser.") 249 "Non-nil if Emacs was started solely as an Info browser.")
249 250
250 (defvar Info-suffix-list 251 (defvar Info-suffix-list
447 ;;;###autoload 448 ;;;###autoload
448 (defun info-other-window (&optional file) 449 (defun info-other-window (&optional file)
449 "Like `info' but show the Info buffer in another window." 450 "Like `info' but show the Info buffer in another window."
450 (interactive (if current-prefix-arg 451 (interactive (if current-prefix-arg
451 (list (read-file-name "Info file name: " nil nil t)))) 452 (list (read-file-name "Info file name: " nil nil t))))
452 (let (same-window-buffer-names) 453 (let (same-window-buffer-names same-window-regexps)
453 (info file))) 454 (info file)))
454 455
455 ;;;###autoload (add-hook 'same-window-buffer-names "*info*") 456 ;;;###autoload (add-hook 'same-window-regexps "\\*info\\*\\(\\|<[0-9]+>\\)")
456 457
457 ;;;###autoload 458 ;;;###autoload
458 (defun info (&optional file) 459 (defun info (&optional file buffer)
459 "Enter Info, the documentation browser. 460 "Enter Info, the documentation browser.
460 Optional argument FILE specifies the file to examine; 461 Optional argument FILE specifies the file to examine;
461 the default is the top-level directory of Info. 462 the default is the top-level directory of Info.
462 Called from a program, FILE may specify an Info node of the form 463 Called from a program, FILE may specify an Info node of the form
463 `(FILENAME)NODENAME'. 464 `(FILENAME)NODENAME'.
464 465 Optional argument BUFFER specifies the Info buffer name;
465 In interactive use, a prefix argument directs this command 466 the default buffer name is *info*. If BUFFER exists,
466 to read a file name from the minibuffer. 467 just switch to BUFFER. Otherwise, create a new buffer
468 with the top-level Info directory.
469
470 In interactive use, a non-numeric prefix argument directs
471 this command to read a file name from the minibuffer.
472 A numeric prefix argument appends the number to the buffer name.
467 473
468 The search path for Info files is in the variable `Info-directory-list'. 474 The search path for Info files is in the variable `Info-directory-list'.
469 The top-level Info directory is made by combining all the files named `dir' 475 The top-level Info directory is made by combining all the files named `dir'
470 in all the directories in that path." 476 in all the directories in that path."
471 (interactive (if current-prefix-arg 477 (interactive (list
472 (list (read-file-name "Info file name: " nil nil t)))) 478 (if (and current-prefix-arg (not (numberp current-prefix-arg)))
473 (pop-to-buffer "*info*") 479 (read-file-name "Info file name: " nil nil t))
480 (if (numberp current-prefix-arg)
481 (format "*info*<%s>" current-prefix-arg))))
482 (pop-to-buffer (or buffer "*info*"))
483 (if (and buffer (not (eq major-mode 'Info-mode)))
484 (Info-mode))
474 (if file 485 (if file
475 ;; If argument already contains parentheses, don't add another set 486 ;; If argument already contains parentheses, don't add another set
476 ;; since the argument will then be parsed improperly. This also 487 ;; since the argument will then be parsed improperly. This also
477 ;; has the added benefit of allowing node names to be included 488 ;; has the added benefit of allowing node names to be included
478 ;; following the parenthesized filename. 489 ;; following the parenthesized filename.
864 ;; Add anchors to the history too 875 ;; Add anchors to the history too
865 (setq Info-history-list 876 (setq Info-history-list
866 (cons new-history 877 (cons new-history
867 (delete new-history Info-history-list)))) 878 (delete new-history Info-history-list))))
868 (goto-char anchorpos)) 879 (goto-char anchorpos))
869 (Info-reference-name 880 ((numberp Info-point-loc)
870 (Info-find-index-name Info-reference-name) 881 (forward-line (1- Info-point-loc))
871 (setq Info-reference-name nil)))))) 882 (setq Info-point-loc nil))
883 ((stringp Info-point-loc)
884 (Info-find-index-name Info-point-loc)
885 (setq Info-point-loc nil))))))
872 ;; If we did not finish finding the specified node, 886 ;; If we did not finish finding the specified node,
873 ;; go back to the previous one. 887 ;; go back to the previous one.
874 (or Info-current-node no-going-back (null Info-history) 888 (or Info-current-node no-going-back (null Info-history)
875 (let ((hist (car Info-history))) 889 (let ((hist (car Info-history)))
876 (setq Info-history (cdr Info-history)) 890 (setq Info-history (cdr Info-history))
1311 nodename) 1325 nodename)
1312 (setq filename (if (= (match-beginning 1) (match-end 1)) 1326 (setq filename (if (= (match-beginning 1) (match-end 1))
1313 "" 1327 ""
1314 (match-string 2 nodename)) 1328 (match-string 2 nodename))
1315 nodename (match-string 3 nodename)) 1329 nodename (match-string 3 nodename))
1316 (let ((trim (string-match "\\s *\\'" filename))) 1330 (let ((trim (string-match "\\s +\\'" filename)))
1317 (if trim (setq filename (substring filename 0 trim)))) 1331 (if trim (setq filename (substring filename 0 trim))))
1318 (let ((trim (string-match "\\s *\\'" nodename))) 1332 (let ((trim (string-match "\\s +\\'" nodename)))
1319 (if trim (setq nodename (substring nodename 0 trim)))) 1333 (if trim (setq nodename (substring nodename 0 trim))))
1320 (if transient-mark-mode (deactivate-mark)) 1334 (if transient-mark-mode (deactivate-mark))
1321 (Info-find-node (if (equal filename "") nil filename) 1335 (Info-find-node (if (equal filename "") nil filename)
1322 (if (equal nodename "") "Top" nodename)))) 1336 (if (equal nodename "") "Top" nodename))))
1323 1337
1662 (insert "\n\nFile: toc Node: Top, Up: (dir)\n\n") 1676 (insert "\n\nFile: toc Node: Top, Up: (dir)\n\n")
1663 (insert "Table of Contents\n*****************\n\n") 1677 (insert "Table of Contents\n*****************\n\n")
1664 (insert "*Note Top::\n") 1678 (insert "*Note Top::\n")
1665 (Info-insert-toc 1679 (Info-insert-toc
1666 (nth 2 (assoc "Top" node-list)) ; get Top nodes 1680 (nth 2 (assoc "Top" node-list)) ; get Top nodes
1667 node-list 0 (file-name-nondirectory curr-file))) 1681 node-list 0 curr-file))
1668 (if (not (bobp)) 1682 (if (not (bobp))
1669 (let ((Info-hide-note-references 'hide) 1683 (let ((Info-hide-note-references 'hide)
1670 (Info-fontify-visited-nodes nil)) 1684 (Info-fontify-visited-nodes nil))
1685 (setq Info-current-node "Top")
1671 (Info-fontify-node))) 1686 (Info-fontify-node)))
1672 (goto-char (point-min)) 1687 (goto-char (point-min))
1673 (if (setq p (search-forward (concat "*Note " curr-node ":") nil t)) 1688 (if (setq p (search-forward (concat "*Note " curr-node ":") nil t))
1674 (setq p (- p (length curr-node) 2)))) 1689 (setq p (- p (length curr-node) 2))))
1675 (Info-find-node "toc" "Top") 1690 (Info-find-node "toc" "Top")
1827 (and (looking-back "\\*note[ \n\t]+") 1842 (and (looking-back "\\*note[ \n\t]+")
1828 (goto-char (match-beginning 0))) 1843 (goto-char (match-beginning 0)))
1829 (if (and (save-excursion 1844 (if (and (save-excursion
1830 (goto-char (+ (point) 5)) ; skip a possible *note 1845 (goto-char (+ (point) 5)) ; skip a possible *note
1831 (re-search-backward "\\*note[ \n\t]+" nil t) 1846 (re-search-backward "\\*note[ \n\t]+" nil t)
1832 (looking-at (concat "\\*note[ \n\t]+" 1847 (looking-at str))
1833 (Info-following-node-name-re "^.,\t"))))
1834 (<= (point) (match-end 0))) 1848 (<= (point) (match-end 0)))
1835 (goto-char (match-beginning 0)))) 1849 (goto-char (match-beginning 0))))
1836 ;; Go to the reference closest to point 1850 ;; Go to the reference closest to point
1837 (let ((next-ref (save-excursion (and (re-search-forward str nil t) 1851 (let ((next-ref (save-excursion (and (re-search-forward str nil t)
1838 (+ (match-beginning 0) 5)))) 1852 (+ (match-beginning 0) 5))))
1856 ;; where the xref name might be wrapped over two lines. 1870 ;; where the xref name might be wrapped over two lines.
1857 "Regexp that matches a menu entry name upto but not including the colon. 1871 "Regexp that matches a menu entry name upto but not including the colon.
1858 Because of ambiguities, this should be concatenated with something like 1872 Because of ambiguities, this should be concatenated with something like
1859 `:' and `Info-following-node-name-re'.") 1873 `:' and `Info-following-node-name-re'.")
1860 1874
1861 (defun Info-extract-menu-node-name (&optional multi-line) 1875 (defun Info-extract-menu-node-name (&optional multi-line index-node)
1862 (skip-chars-forward " \t\n") 1876 (skip-chars-forward " \t\n")
1863 (when (looking-at (concat Info-menu-entry-name-re ":\\(:\\|" 1877 (when (looking-at (concat Info-menu-entry-name-re ":\\(:\\|"
1864 (Info-following-node-name-re 1878 (Info-following-node-name-re
1865 (if multi-line "^.,\t" "^.,\t\n")) "\\)")) 1879 (cond
1880 (index-node "^,\t\n")
1881 (multi-line "^.,\t")
1882 (t "^.,\t\n")))
1883 "\\)"
1884 (if index-node
1885 "\\.\\(?:[ \t\n]+(line +\\([0-9]+\\))\\)?"
1886 "")))
1887 (if index-node
1888 (setq Info-point-loc
1889 (if (match-beginning 5)
1890 (string-to-number (match-string 5))
1891 (buffer-substring (match-beginning 0) (1- (match-beginning 1)))))
1892 ;;; Comment out the next line to use names of cross-references:
1893 ;;; (setq Info-point-loc
1894 ;;; (buffer-substring (match-beginning 0) (1- (match-beginning 1))))
1895 )
1866 (replace-regexp-in-string 1896 (replace-regexp-in-string
1867 "[ \n]+" " " 1897 "[ \n]+" " "
1868 (or (match-string 2) 1898 (or (match-string 2)
1869 ;; If the node name is the menu entry name (using `entry::'). 1899 ;; If the node name is the menu entry name (using `entry::').
1870 (buffer-substring (match-beginning 0) (1- (match-beginning 1))))))) 1900 (buffer-substring (match-beginning 0) (1- (match-beginning 1)))))))
2325 (completing-read "Index topic: " 'Info-complete-menu-item)) 2355 (completing-read "Index topic: " 'Info-complete-menu-item))
2326 (kill-buffer Info-complete-menu-buffer))))) 2356 (kill-buffer Info-complete-menu-buffer)))))
2327 (if (equal Info-current-file "dir") 2357 (if (equal Info-current-file "dir")
2328 (error "The Info directory node has no index; use m to select a manual")) 2358 (error "The Info directory node has no index; use m to select a manual"))
2329 (let ((orignode Info-current-node) 2359 (let ((orignode Info-current-node)
2330 (pattern (format "\n\\* +\\([^\n]*%s[^\n]*\\):[ \t]+\\([^.\n]*\\)\\.[ \t]*\\([0-9]*\\)" 2360 (pattern (format "\n\\* +\\([^\n]*%s[^\n]*\\):[ \t]+\\([^\n]*\\)\\.\\(?:[ \t\n]*(line +\\([0-9]+\\))\\)?"
2331 (regexp-quote topic))) 2361 (regexp-quote topic)))
2332 node 2362 node
2333 (case-fold-search t)) 2363 (case-fold-search t))
2334 (Info-goto-index) 2364 (Info-goto-index)
2335 (or (equal topic "") 2365 (or (equal topic "")
2377 (nconc (cdr Info-index-alternatives) 2407 (nconc (cdr Info-index-alternatives)
2378 (list (car Info-index-alternatives))) 2408 (list (car Info-index-alternatives)))
2379 num (1- num))) 2409 num (1- num)))
2380 (Info-goto-node (nth 1 (car Info-index-alternatives))) 2410 (Info-goto-node (nth 1 (car Info-index-alternatives)))
2381 (if (> (nth 3 (car Info-index-alternatives)) 0) 2411 (if (> (nth 3 (car Info-index-alternatives)) 0)
2382 (forward-line (nth 3 (car Info-index-alternatives))) 2412 (forward-line (1- (nth 3 (car Info-index-alternatives))))
2383 (forward-line 3) ; don't search in headers 2413 (forward-line 3) ; don't search in headers
2384 (let ((name (car (car Info-index-alternatives)))) 2414 (let ((name (car (car Info-index-alternatives))))
2385 (Info-find-index-name name))) 2415 (Info-find-index-name name)))
2386 (message "Found `%s' in %s. %s" 2416 (message "Found `%s' in %s. %s"
2387 (car (car Info-index-alternatives)) 2417 (car (car Info-index-alternatives))
2416 (defun info-apropos (string) 2446 (defun info-apropos (string)
2417 "Grovel indices of all known Info files on your system for STRING. 2447 "Grovel indices of all known Info files on your system for STRING.
2418 Build a menu of the possible matches." 2448 Build a menu of the possible matches."
2419 (interactive "sIndex apropos: ") 2449 (interactive "sIndex apropos: ")
2420 (unless (string= string "") 2450 (unless (string= string "")
2421 (let ((pattern (format "\n\\* +\\([^\n]*%s[^\n]*\\):[ \t]+\\([^.]+\\)." 2451 (let ((pattern (format "\n\\* +\\([^\n]*%s[^\n]*\\):[ \t]+\\([^\n]+\\)\\.\\(?:[ \t\n]*(line +\\([0-9]+\\))\\)?"
2422 (regexp-quote string))) 2452 (regexp-quote string)))
2423 (ohist Info-history) 2453 (ohist Info-history)
2424 (ohist-list Info-history-list) 2454 (ohist-list Info-history-list)
2425 (current-node Info-current-node) 2455 (current-node Info-current-node)
2426 (current-file Info-current-file) 2456 (current-file Info-current-file)
2445 (while 2475 (while
2446 (progn 2476 (progn
2447 (goto-char (point-min)) 2477 (goto-char (point-min))
2448 (while (re-search-forward pattern nil t) 2478 (while (re-search-forward pattern nil t)
2449 (add-to-list 'matches 2479 (add-to-list 'matches
2450 (list (match-string 1) 2480 (list manual
2451 (match-string 2) 2481 (match-string-no-properties 1)
2452 manual))) 2482 (match-string-no-properties 2)
2483 (match-string-no-properties 3))))
2453 (and (setq node (Info-extract-pointer "next" t)) 2484 (and (setq node (Info-extract-pointer "next" t))
2454 (string-match "\\<Index\\>" node))) 2485 (string-match "\\<Index\\>" node)))
2455 (Info-goto-node node)))) 2486 (Info-goto-node node))))
2456 (error nil)))) 2487 (error nil))))
2457 (Info-goto-node (concat "(" current-file ")" current-node)) 2488 (Info-goto-node (concat "(" current-file ")" current-node))
2463 (with-current-buffer (get-buffer-create " *info-apropos*") 2494 (with-current-buffer (get-buffer-create " *info-apropos*")
2464 (erase-buffer) 2495 (erase-buffer)
2465 (insert "\n\nFile: apropos, Node: Top, Up: (dir)\n") 2496 (insert "\n\nFile: apropos, Node: Top, Up: (dir)\n")
2466 (insert "* Menu: \nNodes whose indices contain \"" string "\"\n\n") 2497 (insert "* Menu: \nNodes whose indices contain \"" string "\"\n\n")
2467 (dolist (entry matches) 2498 (dolist (entry matches)
2468 (insert "* " (car entry) " [" (nth 2 entry) 2499 (insert "* " (nth 1 entry) " [" (nth 0 entry)
2469 "]: (" (nth 2 entry) ")" (nth 1 entry) ".\n"))) 2500 "]: (" (nth 0 entry) ")" (nth 2 entry) "."
2501 (if (nth 3 entry) (concat " (line " (nth 3 entry) ")") "")
2502 "\n")))
2470 (Info-find-node "apropos" "top") 2503 (Info-find-node "apropos" "top")
2471 (setq Info-complete-cache nil))))) 2504 (setq Info-complete-cache nil)))))
2472 2505
2473 (defun Info-undefined () 2506 (defun Info-undefined ()
2474 "Make command be undefined in Info." 2507 "Make command be undefined in Info."
2582 (or (featurep 'browse-url) (require 'browse-url nil t))) 2615 (or (featurep 'browse-url) (require 'browse-url nil t)))
2583 (setq node t) 2616 (setq node t)
2584 (browse-url (browse-url-url-at-point))) 2617 (browse-url (browse-url-url-at-point)))
2585 ((setq node (Info-get-token (point) "\\*note[ \n\t]+" 2618 ((setq node (Info-get-token (point) "\\*note[ \n\t]+"
2586 "\\*note[ \n\t]+\\([^:]*\\):\\(:\\|[ \n\t]*(\\)?")) 2619 "\\*note[ \n\t]+\\([^:]*\\):\\(:\\|[ \n\t]*(\\)?"))
2587 ;;; (or (match-string 2)
2588 ;;; (setq Info-reference-name
2589 ;;; (replace-regexp-in-string
2590 ;;; "[ \n\t]+" " " (match-string-no-properties 1))))
2591 (Info-follow-reference node fork)) 2620 (Info-follow-reference node fork))
2592 ;; menu item: node name 2621 ;; menu item: node name
2593 ((setq node (Info-get-token (point) "\\* +" "\\* +\\([^:]*\\)::")) 2622 ((setq node (Info-get-token (point) "\\* +" "\\* +\\([^:]*\\)::"))
2594 (Info-goto-node node fork)) 2623 (Info-goto-node node fork))
2595 ;; menu item: index entry 2624 ;; menu item: node name or index entry
2596 ((Info-get-token (point) "\\* +" "\\* +\\(.*\\): ") 2625 ((Info-get-token (point) "\\* +" "\\* +\\(.*\\): ")
2597 (if (save-match-data (string-match "\\<index\\>" Info-current-node))
2598 (setq Info-reference-name (match-string-no-properties 1)))
2599 (beginning-of-line) 2626 (beginning-of-line)
2600 (forward-char 2) 2627 (forward-char 2)
2601 (setq node (Info-extract-menu-node-name)) 2628 (setq node (Info-extract-menu-node-name
2629 nil (string-match "\\<index\\>" Info-current-node)))
2602 (Info-goto-node node fork)) 2630 (Info-goto-node node fork))
2603 ((setq node (Info-get-token (point) "Up: " "Up: \\([^,\n\t]*\\)")) 2631 ((setq node (Info-get-token (point) "Up: " "Up: \\([^,\n\t]*\\)"))
2604 (Info-goto-node node fork)) 2632 (Info-goto-node node fork))
2605 ((setq node (Info-get-token (point) "Next: " "Next: \\([^,\n\t]*\\)")) 2633 ((setq node (Info-get-token (point) "Next: " "Next: \\([^,\n\t]*\\)"))
2606 (Info-goto-node node fork)) 2634 (Info-goto-node node fork))
2846 \\[Info-last] Move to the last node you were at. 2874 \\[Info-last] Move to the last node you were at.
2847 \\[Info-history] Go to the history buffer. 2875 \\[Info-history] Go to the history buffer.
2848 \\[Info-toc] Go to the buffer with a table of contents. 2876 \\[Info-toc] Go to the buffer with a table of contents.
2849 \\[Info-index] Look up a topic in this file's Index and move to that node. 2877 \\[Info-index] Look up a topic in this file's Index and move to that node.
2850 \\[Info-index-next] (comma) Move to the next match from a previous \\<Info-mode-map>\\[Info-index] command. 2878 \\[Info-index-next] (comma) Move to the next match from a previous \\<Info-mode-map>\\[Info-index] command.
2879 \\[info-apropos] Look for a string in the indices of all manuals.
2851 \\[Info-top-node] Go to the Top node of this file. 2880 \\[Info-top-node] Go to the Top node of this file.
2852 \\[Info-final-node] Go to the final node in this file. 2881 \\[Info-final-node] Go to the final node in this file.
2853 \\[Info-backward-node] Go backward one node, considering all nodes as forming one sequence. 2882 \\[Info-backward-node] Go backward one node, considering all nodes as forming one sequence.
2854 \\[Info-forward-node] Go forward one node, considering all nodes as forming one sequence. 2883 \\[Info-forward-node] Go forward one node, considering all nodes as forming one sequence.
2855 2884
3350 (file (file-name-nondirectory 3379 (file (file-name-nondirectory
3351 Info-current-file)) 3380 Info-current-file))
3352 (hl Info-history-list) 3381 (hl Info-history-list)
3353 res) 3382 res)
3354 (if (string-match "(\\([^)]+\\))\\([^)]*\\)" node) 3383 (if (string-match "(\\([^)]+\\))\\([^)]*\\)" node)
3355 (setq file (match-string 1 node) 3384 (setq file (file-name-nondirectory
3385 (match-string 1 node))
3356 node (if (equal (match-string 2 node) "") 3386 node (if (equal (match-string 2 node) "")
3357 "Top" 3387 "Top"
3358 (match-string 2 node)))) 3388 (match-string 2 node))))
3359 (while hl 3389 (while hl
3360 (if (and (string-equal node (nth 1 (car hl))) 3390 (if (and (string-equal node (nth 1 (car hl)))
3450 (match-string 3))) 3480 (match-string 3)))
3451 (file (file-name-nondirectory Info-current-file)) 3481 (file (file-name-nondirectory Info-current-file))
3452 (hl Info-history-list) 3482 (hl Info-history-list)
3453 res) 3483 res)
3454 (if (string-match "(\\([^)]+\\))\\([^)]*\\)" node) 3484 (if (string-match "(\\([^)]+\\))\\([^)]*\\)" node)
3455 (setq file (match-string 1 node) 3485 (setq file (file-name-nondirectory
3486 (match-string 1 node))
3456 node (if (equal (match-string 2 node) "") 3487 node (if (equal (match-string 2 node) "")
3457 "Top" 3488 "Top"
3458 (match-string 2 node)))) 3489 (match-string 2 node))))
3459 (while hl 3490 (while hl
3460 (if (and (string-equal node (nth 1 (car hl))) 3491 (if (and (string-equal node (nth 1 (car hl)))
3498 'font-lock-face 'info-menu-header) 3529 'font-lock-face 'info-menu-header)
3499 (while (re-search-forward "\n\n\\([^*\n ].*\\)\n\n?[*]" nil t) 3530 (while (re-search-forward "\n\n\\([^*\n ].*\\)\n\n?[*]" nil t)
3500 (put-text-property (match-beginning 1) (match-end 1) 3531 (put-text-property (match-beginning 1) (match-end 1)
3501 'font-lock-face 'info-menu-header))) 3532 'font-lock-face 'info-menu-header)))
3502 3533
3534 ;; Hide index line numbers
3535 (goto-char (point-min))
3536 (when (and not-fontified-p (string-match "\\<Index\\>" Info-current-node))
3537 (while (re-search-forward "[ \t\n]*(line +[0-9]+)" nil t)
3538 (put-text-property (match-beginning 0) (match-end 0)
3539 'invisible t)))
3540
3503 ;; Fontify http and ftp references 3541 ;; Fontify http and ftp references
3504 (goto-char (point-min)) 3542 (goto-char (point-min))
3505 (when not-fontified-p 3543 (when not-fontified-p
3506 (while (re-search-forward "[hf]t?tp://[^ \t\n\"`({<>})']+" nil t) 3544 (while (re-search-forward "[hf]t?tp://[^ \t\n\"`({<>})']+" nil t)
3507 (add-text-properties (match-beginning 0) (match-end 0) 3545 (add-text-properties (match-beginning 0) (match-end 0)