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

Lines Matching +defs:temp +defs:file +defs:name

10 ;; This file is part of GNU Emacs.
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
31 ;; The basic idea is that the command name or other completable text is
40 ;; and file names, respectively. But all word separators are treated
63 ;; in your .emacs file. To load partial completion automatically, put
67 ;; in your .emacs file, too. Things will be faster if you byte-compile
68 ;; this file when you install it.
74 ;; buffer whose name matches that pattern (perhaps "filing.c").
82 ;; files. For example, `C-x C-f <sys/time.h> RET' reads the file
83 ;; /usr/include/sys/time.h. The variable PC-include-file-path is a
85 ;; is supported in include file names.
96 (defcustom PC-first-char 'find-file
102 If non-nil and non-t, the first character is taken literally only for file name
106 (other :tag "find-file" find-file))
126 (defcustom PC-include-file-path '("/usr/include" "/usr/local/include")
133 "If non-nil, include-file support in \\[find-file] is disabled."
210 as much as possible and `*' characters are treated likewise in file names.
214 \\[find-file] f_b.c TAB might complete to foo_bar.c if that file existed and no
215 other file in that directory begins with that sequence of characters.
218 specially in \\[find-file]. For example,
219 \\[find-file] <sys/time.h> RET finds the file `/usr/include/sys/time.h'.
220 See also the variable `PC-include-file-path'.
230 ;; Deal with include file feature...
232 (remove-hook 'find-file-not-found-functions 'PC-look-for-include-file))
234 (add-hook 'find-file-not-found-functions 'PC-look-for-include-file)))
237 (ad-disable-advice 'read-file-name-internal 'around 'PC-include-file)
238 (ad-activate 'read-file-name-internal))
240 (ad-enable-advice 'read-file-name-internal 'around 'PC-include-file)
241 (ad-activate 'read-file-name-internal)))
279 name which consists of three or more words, the first beginning with \"b\"
299 (buffer-name (window-buffer window)))
356 (PC-temp-minibuffer-message " [Confirm]"))))))
383 (defvar PC-completion-as-file-name-predicate
384 (lambda () minibuffer-completing-file-name)
440 point-max (as is appropriate for completing a file name). If
446 (filename (funcall PC-completion-as-file-name-predicate))
477 (setq basestr (or (file-name-directory str) ""))
480 (setq p (substitute-in-file-name basestr))
482 (setq str (concat p (file-name-nondirectory str)))
497 (let ((dir (file-name-directory str))
498 (file (file-name-nondirectory str))
499 ;; The base dir for file-completion is passed in `predicate'.
500 (default-directory (expand-file-name pred)))
501 (while (and (stringp dir) (not (file-directory-p dir)))
502 (setq dir (directory-file-name dir))
503 (setq file (concat (replace-regexp-in-string
505 (file-name-nondirectory dir))
506 "*/" file))
507 (setq dir (file-name-directory dir)))
508 (setq origstr str str (concat dir file))))
510 ;; Look for wildcard expansions in directory name
514 ;; The base dir for file-completion is passed in `predicate'.
515 (default-directory (expand-file-name pred))
525 (let ((dir (file-name-directory (car files)))
528 (equal dir (file-name-directory (car p)))))
533 (setq str (concat dir (file-name-nondirectory str)))
538 ;; that read-file-name-internal (especially our
539 ;; PC-include-file advice) can still find matches for the
545 ;; Strip directory name if appropriate
550 (setq basestr (file-name-nondirectory str)
551 dirname (file-name-directory str))
609 (file-name-nondirectory (substring str 0 p))
663 (PC-temp-minibuffer-message (if ambig
664 " [Ambiguous dir name]"
680 (PC-temp-minibuffer-message " [Complete, but not unique]"))
775 (with-output-to-temp-buffer "*Completions*"
798 (PC-temp-minibuffer-message " [Next char not unique]"))
806 (PC-temp-minibuffer-message " [Sole completion]"))
810 (substitute-in-file-name (concat dirname (car poss)))
827 (defun PC-temp-minibuffer-message (message)
833 ((fboundp 'temp-minibuffer-message)
834 (temp-minibuffer-message message))
917 (defun PC-complete-as-file-name ()
918 "Perform completion on file names preceding point.
926 (minibuffer-completion-table 'read-file-name-internal)
933 ;; This could now use file-expand-wildcards instead.
935 (defun PC-expand-many-files (name)
938 (when (and (file-name-absolute-p name)
939 (not (file-directory-p default-directory)))
941 ;; signals an error. So if the file names we're looking for don't
944 (shell-command (concat "echo " name) t)
947 ;; SH-style shells tend to simply output `name' when no match is found.
949 (regexp-quote name)
951 (regexp-quote (expand-file-name name))
977 ;; there are spaces in the file names or when the no-match
981 (or (not (file-exists-p (car files)))
988 ;; main completion code. See also the variable `PC-include-file-path'
989 ;; at top of this file.
991 (defun PC-look-for-include-file ()
992 (if (string-match "[\"<]\\([^\"<>]*\\)[\">]?$" (buffer-file-name))
993 (let ((name (substring (buffer-file-name)
995 (punc (aref (buffer-file-name) (match-beginning 0)))
999 (if (equal name "")
1005 (setq name (buffer-substring (match-beginning 1)
1016 (setq name (buffer-substring (match-beginning 1)
1020 (if (string-match "\\.elc$" name)
1021 (setq name (substring name 0 -1))
1022 (or (string-match "\\.el$" name)
1023 (setq name (concat name ".el")))))
1025 (or (string-match "\\.[[:alnum:]]+$" name)
1026 (setq name (concat name ".h")))
1028 (let ((path (or path (PC-include-file-path))))
1030 (not (file-exists-p
1031 (concat (file-name-as-directory (car path))
1032 name))))
1035 (setq name (concat (file-name-as-directory (car path)) name))
1036 (error "No such include file: <%s>" name)))
1039 (if (file-exists-p (concat dir name))
1040 (setq name (concat dir name))
1041 (error "No such include file: `%s'" name))))
1042 (setq new-buf (get-file-buffer name))
1046 (set-buffer (create-file-buffer name))
1048 (insert-file-contents name t))
1050 ;; is sufficient to tell find-file to use it.
1054 (defun PC-include-file-path ()
1055 (or PC-include-file-path
1059 (or env (error "No include file path specified"))
1066 (defun PC-include-file-all-completions (file search-path &optional full)
1072 (if dir (file-name-as-directory dir) default-directory))
1074 (if (file-name-absolute-p file)
1075 ;; It's an absolute file name, so don't need search-path
1077 (setq file (expand-file-name file))
1078 (file-name-all-completions
1079 (file-name-nondirectory file) (file-name-directory file)))
1080 (let ((subdir (file-name-directory file))
1081 (ndfile (file-name-nondirectory file))
1082 file-lists)
1088 file ))
1093 (if (file-directory-p dir)
1095 (setq file-lists
1097 (mapcar (lambda (file) (concat subdir file))
1098 (file-name-all-completions ndfile
1100 file-lists))))
1103 (let ((sorted (sort (apply 'nconc file-lists)
1112 (defadvice read-file-name-internal (around PC-include-file disable)
1116 (name (match-string 1 string))
1121 (PC-include-file-all-completions
1122 name (PC-include-file-path)))))