/[emacs]/emacs/lisp/info.el
ViewVC logotype

Diff of /emacs/lisp/info.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.346 by monnier, Wed May 28 22:53:08 2003 UTC revision 1.347 by monnier, Tue Jun 3 19:54:42 2003 UTC
# Line 107  A header-line does not scroll with the r Line 107  A header-line does not scroll with the r
107    "List of directories to search for Info documentation files.    "List of directories to search for Info documentation files.
108  If nil, meaning not yet initialized, Info uses the environment  If nil, meaning not yet initialized, Info uses the environment
109  variable INFOPATH to initialize it, or `Info-default-directory-list'  variable INFOPATH to initialize it, or `Info-default-directory-list'
110  if there is no INFOPATH variable in the environment.  if there is no INFOPATH variable in the environment, or the
111    concatenation of the two if INFOPATH ends with a colon.
112    
113  When `Info-directory-list' is initialized from the value of  When `Info-directory-list' is initialized from the value of
114  `Info-default-directory-list', and Emacs is installed in one of the  `Info-default-directory-list', and Emacs is installed in one of the
# Line 161  If value is non-nil but not t, the refer Line 162  If value is non-nil but not t, the refer
162                   (other :tag "Replace only tag" tag))                   (other :tag "Replace only tag" tag))
163    :group 'info)    :group 'info)
164    
165  (defcustom Info-mode-hook '(turn-on-font-lock)  (defcustom Info-mode-hook
166      ;; Try to obey obsolete Info-fontify settings.
167      (unless (and (boundp 'Info-fontify) (null Info-fontify))
168        '(turn-on-font-lock))
169    "Hooks run when `info-mode' is called."    "Hooks run when `info-mode' is called."
170    :type 'hook    :type 'hook
171    :group 'info)    :group 'info)
# Line 595  If a match was found, value is a list (F Line 599  If a match was found, value is a list (F
599  FOUND-ANCHOR is non-nil if a `Ref:' was matched, POS is the position  FOUND-ANCHOR is non-nil if a `Ref:' was matched, POS is the position
600  where the match was found, and MODE is `major-mode' of the buffer in  where the match was found, and MODE is `major-mode' of the buffer in
601  which the match was found."  which the match was found."
602    (let ((case-fold-search case-fold)    (let ((case-fold-search case-fold))
         found-mode guesspos found-anchor)  
603      (save-excursion      (save-excursion
604        (set-buffer (marker-buffer marker))        (set-buffer (marker-buffer marker))
605        (goto-char marker)        (goto-char marker)
# Line 733  a case-insensitive match is tried." Line 736  a case-insensitive match is tried."
736                                  (if (stringp nodename)                                  (if (stringp nodename)
737                                      (regexp-quote nodename)                                      (regexp-quote nodename)
738                                    "")                                    "")
739                                  "\\) *[,\t\n\177]"))                                  "\\) *[,\t\n\177]")))
                 (nodepos nil))  
740    
741              (catch 'foo              (catch 'foo
742    
# Line 1107  a case-insensitive match is tried." Line 1109  a case-insensitive match is tried."
1109    "Display images in current node."    "Display images in current node."
1110    (save-excursion    (save-excursion
1111      (let ((inhibit-read-only t)      (let ((inhibit-read-only t)
1112            (case-fold-search t)            (case-fold-search t))
           paragraph-markers)  
1113        (goto-char (point-min))        (goto-char (point-min))
1114        (while (re-search-forward        (while (re-search-forward
1115                "\\(\0\b[[]image\\(\\(?:[^\b]\\|[^\0]+\b\\)*\\)\0\b[]]\\)"                "\\(\0\b[[]image\\(\\(?:[^\b]\\|[^\0]+\b\\)*\\)\0\b[]]\\)"
# Line 1128  a case-insensitive match is tried." Line 1129  a case-insensitive match is tried."
1129                 start (point) `(display ,image rear-nonsticky (display)))))))                 start (point) `(display ,image rear-nonsticky (display)))))))
1130      (set-buffer-modified-p nil)))      (set-buffer-modified-p nil)))
1131    
 (defvar Info-header-line nil  
   "If the info node header is hidden, the text of the header.")  
 (put 'Info-header-line 'risky-local-variable t)  
   
1132  (defun Info-select-node ()  (defun Info-select-node ()
1133  "Select the info node that point is in.  "Select the info node that point is in.
1134  Bind this in case the user sets it to nil."  Bind this in case the user sets it to nil."
# Line 1167  Bind this in case the user sets it to ni Line 1164  Bind this in case the user sets it to ni
1164                              (point-max)))                              (point-max)))
1165          (if Info-enable-active-nodes (eval active-expression))          (if Info-enable-active-nodes (eval active-expression))
1166          (Info-fontify-node)          (Info-fontify-node)
         (setq Info-header-line (get-text-property (point-min) 'header-line))  
1167          (Info-display-images-node)          (Info-display-images-node)
1168          (run-hooks 'Info-selection-hook)))))          (run-hooks 'Info-selection-hook)))))
1169    
# Line 1321  If FORK is a string, it is the name to u Line 1317  If FORK is a string, it is the name to u
1317    (when (equal regexp "")    (when (equal regexp "")
1318      (setq regexp (car Info-search-history)))      (setq regexp (car Info-search-history)))
1319    (when regexp    (when regexp
1320      (let ((found ()) current      (let ((found ())
1321            (onode Info-current-node)            (onode Info-current-node)
1322            (ofile Info-current-file)            (ofile Info-current-file)
1323            (opoint (point))            (opoint (point))
# Line 1529  FOOTNOTENAME may be an abbreviation of t Line 1525  FOOTNOTENAME may be an abbreviation of t
1525    (unless footnotename    (unless footnotename
1526      (error "No reference was specified"))      (error "No reference was specified"))
1527    
1528    (let (target beg i (str (concat "\\*note " (regexp-quote footnotename)))    (let (target i (str (concat "\\*note " (regexp-quote footnotename)))
1529                 (case-fold-search t))                 (case-fold-search t))
1530      (while (setq i (string-match " " str i))      (while (setq i (string-match " " str i))
1531        (setq str (concat (substring str 0 i) "[ \t\n]+" (substring str (1+ i))))        (setq str (concat (substring str 0 i) "[ \t\n]+" (substring str (1+ i))))
# Line 1550  FOOTNOTENAME may be an abbreviation of t Line 1546  FOOTNOTENAME may be an abbreviation of t
1546  (defun Info-extract-menu-node-name (&optional errmessage multi-line)  (defun Info-extract-menu-node-name (&optional errmessage multi-line)
1547    (skip-chars-forward " \t\n")    (skip-chars-forward " \t\n")
1548    (let ((beg (point))    (let ((beg (point))
1549          str i)          str)
1550      (while (not (looking-at ":*[,.;() \t\n]"))      (while (not (looking-at ":*[,.;() \t\n]"))
1551        (skip-chars-forward "^:")        (skip-chars-forward "^:")
1552        (forward-char 1))        (forward-char 1))
# Line 1579  FOOTNOTENAME may be an abbreviation of t Line 1575  FOOTNOTENAME may be an abbreviation of t
1575    ;; also look for menu items in subsequent nodes as long as those    ;; also look for menu items in subsequent nodes as long as those
1576    ;; nodes' names match `Info-complete-next-re'.  This feature is currently    ;; nodes' names match `Info-complete-next-re'.  This feature is currently
1577    ;; only used for completion in Info-index.    ;; only used for completion in Info-index.
1578    (save-excursion    (with-current-buffer Info-complete-menu-buffer
     (set-buffer Info-complete-menu-buffer)  
1579      (let ((completion-ignore-case t)      (let ((completion-ignore-case t)
1580            (case-fold-search t)            (case-fold-search t)
1581            (orignode Info-current-node)            (orignode Info-current-node)
# Line 2010  Give a blank topic name to go to the Ind Line 2005  Give a blank topic name to go to the Ind
2005    (if (equal Info-current-file "dir")    (if (equal Info-current-file "dir")
2006        (error "The Info directory node has no index; use m to select a manual"))        (error "The Info directory node has no index; use m to select a manual"))
2007    (let ((orignode Info-current-node)    (let ((orignode Info-current-node)
         (rnode nil)  
2008          (pattern (format "\n\\* +\\([^\n]*%s[^\n]*\\):[ \t]+\\([^.\n]*\\)\\.[ \t]*\\([0-9]*\\)"          (pattern (format "\n\\* +\\([^\n]*%s[^\n]*\\):[ \t]+\\([^.\n]*\\)\\.[ \t]*\\([0-9]*\\)"
2009                           (regexp-quote topic)))                           (regexp-quote topic)))
2010          node          node
# Line 2495  Advanced commands: Line 2489  Advanced commands:
2489    (setq Info-tag-table-buffer nil)    (setq Info-tag-table-buffer nil)
2490    (make-local-variable 'Info-history)    (make-local-variable 'Info-history)
2491    (make-local-variable 'Info-index-alternatives)    (make-local-variable 'Info-index-alternatives)
2492    (make-local-variable 'Info-header-line)    (setq header-line-format
2493    (setq header-line-format (if Info-use-header-line 'Info-header-line))          (if Info-use-header-line
2494                '(:eval (get-text-property (point-min) 'header-line))
2495              nil)) ; so the header line isn't displayed
2496    (set (make-local-variable 'tool-bar-map) info-tool-bar-map)    (set (make-local-variable 'tool-bar-map) info-tool-bar-map)
2497    ;; This is for the sake of the invisible text we use handling titles.    ;; This is for the sake of the invisible text we use handling titles.
2498    (make-local-variable 'line-move-ignore-invisible)    (make-local-variable 'line-move-ignore-invisible)
# Line 2630  The locations are of the format used in Line 2626  The locations are of the format used in
2626      ;; Bind Info-history to nil, to prevent the index nodes from      ;; Bind Info-history to nil, to prevent the index nodes from
2627      ;; getting into the node history.      ;; getting into the node history.
2628      (let ((Info-history nil)      (let ((Info-history nil)
2629            (exact nil)            node)
           node found)  
2630        (Info-goto-node (Info-extract-menu-node-name))        (Info-goto-node (Info-extract-menu-node-name))
2631        (while        (while
2632            (progn            (progn
# Line 2893  the variable `Info-file-list-for-emacs'. Line 2888  the variable `Info-file-list-for-emacs'.
2888                    (goto-char (match-beginning 1))                    (goto-char (match-beginning 1))
2889                    (insert other-tag)))                    (insert other-tag)))
2890                (when (or hide-tag (eq Info-hide-note-references t))                (when (or hide-tag (eq Info-hide-note-references t))
2891                  (setq paragraph-markers (cons (set-marker (make-marker) start)                  (push (set-marker (make-marker) start)
2892                                                paragraph-markers))))))                        paragraph-markers)))))
2893    
2894          (let ((fill-nobreak-invisible t))          (let ((fill-nobreak-invisible t))
2895            (goto-char (point-max))            (goto-char (point-max))
# Line 3030  specific node to expand." Line 3025  specific node to expand."
3025        (select-frame cf)        (select-frame cf)
3026        (if completions        (if completions
3027            (speedbar-with-writable            (speedbar-with-writable
3028             (while completions             (dolist (completion completions)
3029               (speedbar-make-tag-line 'bracket ?+ 'Info-speedbar-expand-node               (speedbar-make-tag-line 'bracket ?+ 'Info-speedbar-expand-node
3030                                       (cdr (car completions))                                       (cdr completion)
3031                                       (car (car completions))                                       (car completion)
3032                                       'Info-speedbar-goto-node                                       'Info-speedbar-goto-node
3033                                       (cdr (car completions))                                       (cdr completion)
3034                                       'info-xref depth)                                       'info-xref depth))
              (setq completions (cdr completions)))  
3035             t)             t)
3036          nil))))          nil))))
3037    
# Line 3056  The INDENT level is ignored." Line 3050  The INDENT level is ignored."
3050            (let ((pop-up-frames t)) (select-window (display-buffer buff)))            (let ((pop-up-frames t)) (select-window (display-buffer buff)))
3051          (select-frame speedbar-attached-frame)          (select-frame speedbar-attached-frame)
3052          (switch-to-buffer buff)))          (switch-to-buffer buff)))
3053      (let ((junk (string-match "^(\\([^)]+\\))\\([^.]+\\)$" node))      (if (not (string-match "^(\\([^)]+\\))\\([^.]+\\)$" node))
3054            (file (match-string 1 node))          (error "Invalid node %s" node)
3055            (node (match-string 2 node)))        (Info-find-node (match-string 1 node) (match-string 2 node))
       (Info-find-node file node)  
3056        ;; If we do a find-node, and we were in info mode, restore        ;; If we do a find-node, and we were in info mode, restore
3057        ;; the old default method.  Once we are in info mode, it makes        ;; the old default method.  Once we are in info mode, it makes
3058        ;; sense to return to whatever method the user was using before.        ;; sense to return to whatever method the user was using before.
# Line 3096  Optional THISFILE represends the filenam Line 3089  Optional THISFILE represends the filenam
3089      (if (not (equal major-mode 'Info-mode))      (if (not (equal major-mode 'Info-mode))
3090          (Info-mode))          (Info-mode))
3091      ;; Get the node into this buffer      ;; Get the node into this buffer
3092      (let ((junk (string-match "^(\\([^)]+\\))\\([^.]+\\)$" nodespec))      (if (not (string-match "^(\\([^)]+\\))\\([^.]+\\)$" nodespec))
3093            (file (match-string 1 nodespec))          (error "Invalid node specification %s" nodespec)
3094            (node (match-string 2 nodespec)))        (Info-find-node (match-string 1 nodespec) (match-string 2 nodespec)))
       (Info-find-node file node))  
3095      ;; Scan the created buffer      ;; Scan the created buffer
3096      (goto-char (point-min))      (goto-char (point-min))
3097      (let ((completions nil)      (let ((completions nil)
# Line 3110  Optional THISFILE represends the filenam Line 3102  Optional THISFILE represends the filenam
3102        (re-search-forward "\n\\* \\([^:\t\n]*\\):" nil t)        (re-search-forward "\n\\* \\([^:\t\n]*\\):" nil t)
3103        (while (re-search-forward "\n\\* \\([^:\t\n]*\\):" nil t)        (while (re-search-forward "\n\\* \\([^:\t\n]*\\):" nil t)
3104          (let ((name (match-string 1)))          (let ((name (match-string 1)))
3105            (if (looking-at " *\\(([^)]+)[^.\n]+\\)\\.")            (push (cons name
3106                (setq name (cons name (match-string 1)))                        (if (looking-at " *\\(([^)]+)[^.\n]+\\)\\.")
3107              (if (looking-at " *\\(([^)]+)\\)\\.")                            (match-string 1)
3108                  (setq name (cons name (concat (match-string 1) "Top")))                          (if (looking-at " *\\(([^)]+)\\)\\.")
3109                (if (looking-at " \\([^.]+\\).")                              (concat (match-string 1) "Top")
3110                    (setq name                            (concat "(" thisfile ")"
3111                          (cons name (concat "(" thisfile ")" (match-string 1))))                                    (if (looking-at " \\([^.]+\\).")
3112                  (setq name (cons name (concat "(" thisfile ")" name))))))                                        (match-string 1)
3113            (setq completions (cons name completions))))                                      name)))))
3114                    completions)))
3115        (nreverse completions))))        (nreverse completions))))
3116    
3117  ;;; Info mode node listing  ;;; Info mode node listing

Legend:
Removed from v.1.346  
changed lines
  Added in v.1.347

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26