• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/emacs-93/emacs/lisp/

Lines Matching +defs:find +defs:file +defs:other +defs:window

9 ;; This file is part of GNU Emacs.
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
62 It is better to write a Texinfo file and generate the Info file from that,
230 (other :tag "Only replace tag" tag))
236 file, so be prepared for a few surprises if you enable this feature."
254 subsequent C-s/C-r continues through other nodes without failing
255 with this error message in other nodes. When isearch fails for
284 (defvar Info-current-file nil
285 "Info file that Info is now looking at, or nil.
286 This is the name that was specified in Info, not the actual file name.
287 It doesn't contain directory names or file name extensions added by Info.")
291 It is nil if current Info file is not split into subfiles.")
297 "Marker pointing at beginning of current Info file's tag table.
298 Marker points nowhere if file has no tag table.")
303 (defvar Info-current-file-completions nil
304 "Cached completion list for current Info file.")
306 (defvar Info-file-supports-index-cookies nil
307 "Non-nil if current Info file supports index cookies.")
323 ;; The MS-DOS list should work both when long file names are
324 ;; supported (Windows 9X), and when only 8+3 file names are available.
366 "List of file name suffixes and associated decoding commands.
367 Each entry should be (SUFFIX . STRING); the file is given to
378 ;; First, on MS-DOS with no long file names support, delete some of
380 (defun info-insert-file-contents-1 (filename suffix lfn)
381 (if lfn ; long file names are supported
383 (let* ((sans-exts (file-name-sans-extension filename))
400 (defun info-file-exists-p (filename)
401 (and (file-exists-p filename)
402 (not (file-directory-p filename))))
404 (defun info-insert-file-contents (filename &optional visit)
405 "Insert the contents of an Info file in the current buffer.
406 Do the right thing if the file has been compressed or zipped."
408 (lfn (if (fboundp 'msdos-long-file-names)
409 (msdos-long-file-names)
411 (check-short (and (fboundp 'msdos-long-file-names)
414 (if (info-file-exists-p filename)
425 ;; Try adding suffixes to FILENAME and see if we can find something.
427 (setq fullname (info-insert-file-contents-1 filename
429 (if (info-file-exists-p fullname)
431 ;; If we found a file with a suffix, set DECODER
435 ;; the short variant of a long file name as well.
437 (setq fullname (info-insert-file-contents-1 filename
439 (if (info-file-exists-p fullname)
444 (error "Can't find %s or any compressed version of it" filename)))
451 (insert-file-contents-literally fullname visit)
454 (default-directory (or (file-name-directory fullname)
460 (insert-file-contents fullname visit))))
464 (let ((source (expand-file-name "info/" source-directory))
466 (expand-file-name "info/" installation-directory)
468 (let ((infodir (expand-file-name
471 (if (file-exists-p infodir)
473 (setq infodir (expand-file-name
476 (and (file-exists-p infodir)
480 (if (and sibling (file-exists-p sibling))
487 ;; and we must always find the Info dir at run time.
493 (expand-file-name "lib-src/"
495 (not (file-exists-p alternative)))
499 ;; currently expects to find `alternative' first on the list.
520 (defun info-other-window (&optional file-or-node)
521 "Like `info' but show the Info buffer in another window."
523 (list (read-file-name "Info file name: " nil nil t))))
524 (let (same-window-buffer-names same-window-regexps)
525 (info file-or-node)))
527 ;;;###autoload (add-hook 'same-window-regexps "\\*info\\*\\(\\|<[0-9]+>\\)")
529 ;;;###autoload (put 'info 'info-file "emacs")
531 (defun info (&optional file-or-node buffer)
533 Optional argument FILE-OR-NODE specifies the file to examine;
543 this command to read a file name from the minibuffer.
552 (read-file-name "Info file name: " nil nil t))
558 (if file-or-node
564 (if (and (stringp file-or-node) (string-match "(.*)" file-or-node))
565 file-or-node
566 (concat "(" file-or-node ")")))
617 (defun Info-find-file (filename &optional noerror)
619 Optional second argument NOERROR, if t, means if file is not found
625 (setq filename (substitute-in-file-name filename))
634 (if (file-name-absolute-p filename)
636 ;; absolute file name
642 ;; Search the directory list for file FILENAME.
644 (setq temp (expand-file-name filename (car dirs)))
646 (expand-file-name (downcase filename) (car dirs)))
649 (lfn (if (fboundp 'msdos-long-file-names)
650 (msdos-long-file-names)
653 (cond ((info-file-exists-p
654 (info-insert-file-contents-1
657 ((info-file-exists-p
658 (info-insert-file-contents-1
661 ((and (fboundp 'msdos-long-file-names)
663 (info-file-exists-p
664 (info-insert-file-contents-1
673 (error "Info file %s does not exist" filename)))
677 (defun Info-find-node (filename nodename &optional no-going-back)
682 (setq filename (Info-find-file filename))
687 Info-current-file
689 (cons (list Info-current-file Info-current-node (point))
691 (Info-find-node-2 filename nodename no-going-back))
705 (set (make-local-variable 'Info-current-file)
706 (or buffer-file-name
707 ;; If called on a non-file buffer, make a fake file name.
709 (Info-find-node-2 nil nodename))
715 (defun Info-revert-find-node (filename nodename)
717 When *info* is already displaying FILENAME and NODENAME, the window position
720 (let ((old-filename Info-current-file)
724 (wline (count-lines (point-min) (window-start)))
726 (new-history (and Info-current-file
727 (list Info-current-file Info-current-node (point)))))
729 (Info-find-node filename nodename)
731 (if (and (equal old-filename Info-current-file)
737 (set-window-start (selected-window) (point))
741 ;; only add to the history when coming from a different file+node
745 (defun Info-find-in-tag-table-1 (marker regexp case-fold)
767 (defun Info-find-in-tag-table (marker regexp)
776 This function tries to find a case-sensitive match first, then a
778 (let ((result (Info-find-in-tag-table-1 marker regexp nil)))
780 (setq result (Info-find-in-tag-table-1 marker regexp t)))
783 (defun Info-find-node-in-buffer-1 (regexp case-fold)
804 (defun Info-find-node-in-buffer (regexp)
811 (or (Info-find-node-in-buffer-1 regexp nil)
812 (Info-find-node-in-buffer-1 regexp t)))
814 (defun Info-find-node-2 (filename nodename &optional no-going-back)
825 (equal Info-current-file filename)
827 (setq Info-current-file nil
829 Info-current-file-completions nil
830 buffer-file-name nil)
842 (info-insert-file-contents filename nil)
843 (setq default-directory (file-name-directory filename))))
856 (set (make-local-variable 'Info-file-supports-index-cookies) found))
858 ;; See whether file has a tag table. Record the location if yes.
867 ;; Is this an indirect file?
890 (setq Info-current-file
905 ;; 4. Node *not* found in tag table, but found in file
906 ;; 5. Node *not* in tag table, and *not* in file
910 ;; Search file for a suitable node.
923 (found (Info-find-in-tag-table m regexp)))
929 ;; If this is an indirect file, determine which
930 ;; file really holds this node and read it in.
947 ;; buffer) to find the actual node. First, check
950 (let ((pos (Info-find-node-in-buffer regexp)))
957 (Info-find-node-2
962 ;; No such anchor in tag table or node in tag table or file
968 (let ((new-history (list Info-current-file
979 (Info-find-index-name Info-point-loc)
986 (Info-find-node (nth 0 hist) (nth 1 hist) t)
989 ;; Cache the contents of the (virtual) dir file, once we have merged
997 ;; Record the file attributes of all the files from which we
999 (defvar Info-dir-file-attributes nil)
1001 (defvar Info-dir-file-name nil)
1008 (if (and Info-dir-contents Info-dir-file-attributes
1013 (let ((curr (file-attributes
1015 (file-truename (car elt)))))
1021 Info-dir-file-attributes))))
1029 (dir-file-attrs nil)
1032 ;; This is set non-nil if we find a problem in some input files.
1036 ;; Search the directory list for the directory file.
1038 (let ((truename (file-truename (expand-file-name (car dirs)))))
1040 (member (directory-file-name truename) dirs-done)
1043 (let* (file
1046 (progn (setq file (expand-file-name "dir" truename))
1047 (file-attributes file))
1048 (progn (setq file (expand-file-name "DIR" truename))
1049 (file-attributes file))
1050 (progn (setq file (expand-file-name "dir.info" truename))
1051 (file-attributes file))
1052 (progn (setq file (expand-file-name "DIR.INFO" truename))
1053 (file-attributes file)))))
1056 (cons (directory-file-name truename)
1065 (insert-file-contents file)
1066 (set (make-local-variable 'Info-dir-file-name)
1067 file)
1069 (push (cons file attrs) dir-file-attrs))
1073 (file-name-as-directory (car dirs))))
1077 (error "Can't find the Info directory node"))
1079 ;; Distinguish the dir file that comes with Emacs from all the
1086 ;; Insert the entire original dir file as a start; note that we've
1091 ;; Look at each of the other buffers one by one.
1092 (dolist (other others)
1094 ;; In each, find all the menus.
1095 (with-current-buffer other
1108 (push (list nodename other beg end) this-buffer-nodes)))
1112 (message "No `top' node in %s" Info-dir-file-name)))))
1113 ;; Add to the main menu a menu item for each other node.
1129 ;; Now take each node of each of the other buffers
1147 ;; Merge the text from the other buffer's menu
1158 (set (make-local-variable 'Info-dir-file-attributes) dir-file-attrs)))
1189 ;; Look for other headings of the same category and merge them.
1232 ;; NODEPOS is either a position (in the Info file as a whole,
1265 (setq buffer-file-name nil)
1268 (info-insert-file-contents lastfilename)
1291 ;; into the Info file for handling images.
1323 (let* ((image-file (if src (if (file-name-absolute-p src) src
1326 (image (if (file-exists-p image-file)
1327 (create-image image-file)
1394 (let ((new-history (list Info-current-file Info-current-node)))
1417 (if (stringp Info-current-file)
1419 "%" "%%" (file-name-nondirectory Info-current-file))
1420 (format "*%S*" Info-current-file))
1436 ;; Don't autoload this function: the correct entry point for other packages
1441 If NODENAME is of the form (FILENAME)NODENAME, the node is in the Info file
1442 FILENAME; otherwise, NODENAME should be in the current Info file (or one of
1444 Completion is available, but only for node names in the current Info file.
1465 (Info-find-node (if (equal filename "") nil filename)
1471 "Virtual completion table for file names input in Info node names.
1476 (string-dir (file-name-directory string))
1478 (if (file-name-absolute-p string)
1479 (list (file-name-directory string))
1484 (if string-dir (setq dir (expand-file-name string-dir dir)))
1485 (when (file-directory-p dir)
1486 (dolist (file (file-name-all-completions
1487 (file-name-nondirectory string) dir))
1488 ;; If the file name has no suffix or a standard suffix,
1490 (and (or (null (file-name-extension file))
1491 (string-match suffix file))
1493 (not (string-match "-[0-9]+\\'" file))
1495 (not (string-match "~\\'" file))
1496 (push (if string-dir (concat string-dir file) file) names))
1497 ;; If the file name ends in a standard suffix,
1499 (when (string-match suffix file)
1500 (setq file (substring file 0 (match-beginning 0)))
1501 (push (if string-dir (concat string-dir file) file) names)))))
1512 ;; First complete embedded file names.
1514 (let ((file (substring string 1)))
1517 (let ((comp (try-completion file 'Info-read-node-name-2
1524 (all-completions file 'Info-read-node-name-2
1528 ;; If a file name was given, then any node is fair game.
1561 (or Info-current-file-completions
1594 (set (make-local-variable 'Info-current-file-completions) compl))))
1600 (if (and (equal (nth 0 (car hl)) Info-current-file)
1634 (ofile Info-current-file)
1638 (ostart (window-start))
1645 ;; Hide Info file header for backward search
1699 ;; Try other subfiles.
1735 ;; Hide Info file header for backward search
1779 (set-window-start (selected-window) ostart)))))
1792 (equal ofile Info-current-file))
1855 (Info-isearch-pop-state cmd ',Info-current-file ',Info-current-node)))
1857 (defun Info-isearch-pop-state (cmd file node)
1858 (or (and (equal Info-current-file file)
1860 (progn (Info-find-node file node) (sit-for 0))))
1888 Submatch 2 if non-nil is the parenthesized file name part of the node name.
1892 "\\(\\(([^)]+)\\)?" ;Node name can start with a file name.
1897 ;;; For compatibility; other files have used this name.
1905 ;; In case another window is currently selected
1906 (save-window-excursion
1913 ;; In case another window is currently selected
1914 (save-window-excursion
1918 (defun Info-up (&optional same-file)
1920 If SAME-FILE is non-nil, do not move to a different Info file."
1922 ;; In case another window is currently selected
1923 (save-window-excursion
1926 (old-file Info-current-file)
1928 (and same-file
1930 (error "Up node is in another Info file"))
1934 (if (and (stringp old-file)
1938 (concat "\n\\*[^:]+: +(" (file-name-nondirectory old-file) ")")
1952 (cons (list Info-current-file Info-current-node (point))
1959 (Info-find-node filename nodename)
1976 (Info-find-node filename nodename)
1984 (Info-find-node "dir" "top"))
1990 (let ((curr-file Info-current-file)
2002 (let ((file (nth 0 (car hl)))
2004 (if (and (equal file curr-file)
2007 (if (stringp file)
2009 (propertize (or (file-name-directory file) "") 'invisible t)
2010 (file-name-nondirectory file)
2013 (Info-find-node 'history "Top")
2017 "Go to a node with table of contents of the current Info file.
2020 (if (stringp Info-current-file)
2021 (let ((curr-file (substring-no-properties Info-current-file))
2026 (node-list (Info-build-toc curr-file)))
2031 (insert "*Note Top: (" curr-file ")Top.\n")
2034 node-list 0 curr-file))
2039 (setq Info-current-file 'toc Info-current-node "Top")
2049 (Info-find-node 'toc "Top")
2052 (defun Info-insert-toc (nodes node-list level curr-file)
2060 (insert "*Note " (car nodes) ": (" curr-file ")" (car nodes) ".\n")
2061 (Info-insert-toc (nth 2 node) node-list (1+ level) curr-file)
2064 (defun Info-build-toc (file)
2067 (let* ((file (and (stringp file) (Info-find-file file)))
2068 (default-directory (or (and (stringp file)
2069 (file-name-directory file))
2071 (main-file (and (stringp file) file))
2074 (while (or main-file subfiles)
2075 (or main-file (message "Searching subfile %s..." (car subfiles)))
2077 (info-insert-file-contents (or main-file (car subfiles)))
2086 (when (and (not (Info-index-node nodename file))
2118 (if main-file
2127 main-file nil))
2310 (if (and (equal (nth 0 Info-complete-cache) Info-current-file)
2338 (list Info-current-file Info-current-node
2435 "Go to the Top node of this file."
2440 "Go to the final node in this file."
2493 (error "First node in file"))
2502 ;; go down to find the last subnode*.
2512 "Exit Info by selecting some other buffer."
2516 (quit-window)))
2611 in other ways.)"
2614 (if (or (< (window-start) (point-min))
2615 (> (window-start) (point-max)))
2616 (set-window-start (selected-window) (point)))
2624 (if (or (< virtual-end (window-start))
2625 (pos-visible-in-window-p virtual-end))
2636 (save-selected-window
2638 (select-window (posn-window (event-start e))))
2648 (if (or (< (window-start) (point-min))
2649 (> (window-start) (point-max)))
2650 (set-window-start (selected-window) (point)))
2663 (pos-visible-in-window-p (point-min) nil t))
2671 (save-selected-window
2673 (select-window (posn-window (event-start e))))
2724 (defun Info-index-nodes (&optional file)
2726 If FILE is omitted, it defaults to the current Info file.
2728 file and its subfiles for nodes with the index cookie. Then try
2729 to find index nodes starting from the first node in the top level
2732 (or file (setq file Info-current-file))
2733 (or (assoc file Info-index-nodes)
2735 (and (member file '("dir" apropos history toc))
2736 (setq Info-index-nodes (cons (cons file nil) Info-index-nodes)))
2737 (not (stringp file))
2738 (if Info-file-supports-index-cookies
2740 (let* ((default-directory (or (and (stringp file)
2741 (file-name-directory
2742 (setq file (Info-find-file file))))
2745 (main-file file) subfiles nodes node)
2748 (while (or main-file subfiles)
2750 (info-insert-file-contents (or main-file (car subfiles)))
2757 (if main-file
2766 main-file nil))
2771 Info-index-nodes (cons (cons file nodes) Info-index-nodes)))
2773 ;; Else find nodes with the word "Index" in the node name
2780 (Info-find-node file "Top")
2793 Info-index-nodes (cons (cons file nodes) Info-index-nodes)))
2795 ;; If file has no index nodes, still add it to the cache
2796 (setq Info-index-nodes (cons (cons file nil) Info-index-nodes)))
2797 (cdr (assoc file Info-index-nodes)))
2799 (defun Info-index-node (&optional node file)
2802 If FILE is nil, check the current Info file."
2804 (assoc (or file Info-current-file) Info-index-nodes))
2805 (member (or node Info-current-node) (Info-index-nodes file))
2807 ;; and file is not in the cache of index nodes
2808 (if Info-file-supports-index-cookies
2831 Use the \\<Info-mode-map>\\[Info-index-next] command to see the other matches.
2839 (if (equal Info-current-file "dir")
2846 (if (equal Info-current-file "dir")
2910 (Info-find-index-name name)))
2922 (defun Info-find-index-name (name)
2940 (Info-find-index-name (match-string 1 name))))
2955 (current-file Info-current-file)
2959 ;; current-node and current-file are nil when they invoke info-apropos
2964 (setq current-file Info-current-file)
2976 (if (setq nodes (Info-index-nodes (Info-find-file manual)))
2978 (Info-find-node manual (car nodes))
2995 (Info-find-node current-file current-node)
3014 (Info-find-node 'apropos "Index")
3025 (delete-other-windows)
3026 (Info-find-node "info"
3027 (if (< (window-height) 23)
3034 (save-window-excursion
3042 (while (progn (setq flag (not (pos-visible-in-window-p (point-max))))
3072 ;; If we did not find one, search back for START
3241 :help "Go to top node of file"]
3243 :help "Go to final node in this file"]
3247 :help "Search for regular expression in this Info file"]
3297 (equal (list Info-current-file Info-current-node)
3351 (setq Info-menu-last-node (list Info-current-file Info-current-node)))
3359 The name of the Info file is prepended to the node name in parentheses.
3364 (let ((node (if (stringp Info-current-file)
3365 (concat "(" (file-name-nondirectory Info-current-file) ")"
3369 (unless (stringp Info-current-file)
3370 (setq node (format "(Info-find-node '%S '%S)"
3371 Info-current-file Info-current-node)))
3388 one topic and contains references to other nodes which discuss related
3389 topics. Info has commands to follow the references and show you other nodes.
3395 Selecting other nodes:
3407 \\[Info-top-node] Go to the Top node of this file.
3408 \\[Info-final-node] Go to the final node in this file.
3417 \\[Info-toc] Go to table of contents of the current Info file.
3431 \\[Info-search] Search through this Info file for specified regexp,
3433 \\[Info-search-case-sensitively] Search through this Info file for specified regexp case-sensitively.
3444 \\[clone-buffer] Select a new cloned Info buffer in another window.
3445 \\[universal-argument] \\[info] Move to new Info file with completion.
3457 (make-local-variable 'Info-current-file)
3551 (y-or-n-p "Save the file? ")
3564 (defvar Info-file-list-for-emacs
3586 An element can be a file name, or a list of the form (PREFIX . FILE)
3587 where PREFIX is a name prefix and FILE is the file to look in.
3588 If the element is just a file name, the file name also serves as the prefix.")
3590 (defun Info-find-emacs-command-nodes (command)
3592 The `info-file' property of COMMAND says which Info manual to search.
3593 If COMMAND has no property, the variable `Info-file-list-for-emacs'
3603 (info-file "emacs")) ;default
3604 ;; Determine which Info file this command is documented in.
3605 (if (get command 'info-file)
3606 (setq info-file (get command 'info-file))
3609 (let ((file-list Info-file-list-for-emacs))
3610 (while file-list
3611 (let* ((elt (car file-list))
3615 (file (if (consp elt) (cdr elt) elt))
3620 (setq info-file file file-list nil))
3621 (setq file-list (cdr file-list))))))
3622 (Info-find-node info-file "Top")
3634 (cons (list Info-current-file
3647 ;;;###autoload (put 'Info-goto-emacs-command-node 'info-file "emacs")
3652 or in another manual found via COMMAND's `info-file' property or
3653 the variable `Info-file-list-for-emacs'.
3661 (let ((where (Info-find-emacs-command-nodes command)))
3664 ;; Get Info running, and pop to it in another window.
3665 (save-window-excursion
3669 ;; visited by Info-find-emacs-command-nodes from being
3673 (Info-find-node (nth 0 (car where)) (nth 1 (car where)))
3679 ;; when/if they go to another node. Put the other
3682 (message "Found %d other entr%s. Use %s to see %s."
3687 (error "Couldn't find documentation for %s" command))))
3689 ;;;###autoload (put 'Info-goto-emacs-key-command-node 'info-file "emacs")
3696 or in another manual found via COMMAND's `info-file' property or
3697 the variable `Info-file-list-for-emacs'."
3787 ;; If we find neither Next: nor Prev: link, show the entire
3847 other-tag)
3858 (setq other-tag
3879 (if other-tag
3880 `(display ,other-tag front-sticky nil rear-nonsticky t)
3910 (file (if external-link-p
3911 (file-name-nondirectory
3913 Info-current-file))
3922 (equal file
3925 (file-name-nondirectory
3943 ;; Unhide the file name of the external reference in parens
4024 (file (if external-link-p
4025 (file-name-nondirectory
4027 Info-current-file))
4036 (equal file
4039 (file-name-nondirectory
4050 ;; Unhide the file name in parens
4174 (save-window-excursion
4176 (Info-speedbar-fetch-file-nodes (or node '"(dir)top"))))
4196 (bwin (get-buffer-window buff 0)))
4199 (select-window bwin)
4200 (raise-frame (window-frame bwin)))
4202 (let ((pop-up-frames t)) (select-window (display-buffer buff)))
4207 (Info-find-node (match-string 1 node) (match-string 2 node))
4208 ;; If we do a find-node, and we were in info mode, restore
4220 (cond ((string-match "+" text) ;we have to expand this file
4234 (defun Info-speedbar-fetch-file-nodes (nodespec)
4236 NODESPEC is a string of the form: (file)node."
4245 (Info-find-node (match-string 1 nodespec) (match-string 2 nodespec)))
4271 "Create a speedbar display to help navigation in an Info file.
4279 (dolist (mess '("^First node in file$"
4302 "Auxiliary information to be saved in desktop file."
4303 (unless (member Info-current-file '(apropos history toc nil))
4304 (list Info-current-file Info-current-node)))
4306 (defun Info-restore-desktop-buffer (desktop-buffer-file-name
4309 "Restore an Info buffer specified in a desktop file."
4316 (Info-find-node first second)