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

Lines Matching +defs:raw +defs:file +defs:name

11 ;; This file is part of GNU Emacs.
24 ;; along with GNU Emacs; see the file COPYING. If not, write to the
55 ;;; (defun term-send-up () (interactive) (term-send-raw-string "\eOA"))
56 ;;; (defun term-send-down () (interactive) (term-send-raw-string "\eOB"))
57 ;;; (defun term-send-right () (interactive) (term-send-raw-string "\eOC"))
58 ;;; (defun term-send-left () (interactive) (term-send-raw-string "\eOD"))
71 ;;; otherwise the file should get loaded straight away.
76 ;;; simply do a C-x C-f and, via ange-ftp, the file is automatically loaded
135 ;;; - Add hooks to allow raw-mode keys to be configurable
188 ;;; If you want to use color ls the best setup is to have a different file
197 ;;; # Configuration file for the color ls utility
198 ;;; # This file goes in the /etc directory, and must be world readable.
199 ;;; # You can copy this file to .dir_colors in your $HOME directory to
215 ;;; # Below are the color init strings for the basic file types. A color init
224 ;;; FILE 00 # normal file
235 ;;; # List any file extensions like '.gz' or '.tar' that you would like ls
298 ;;; # echo -e '\033' > escape.file
342 ;; The changelog is at the end of this file.
348 ;; This file defines a general command-interpreter-in-a-buffer package
357 ;; instead of shell-mode, see the notes at the end of this file.
388 ;; replace with expanded/completed name.
485 (defcustom explicit-shell-file-name nil
486 "*If non-nil, is file name to use for explicitly requested inferior shell."
487 :type '(choice (const nil) file)
536 (defcustom term-input-ring-file-name nil
537 "*If non-nil, name of the file to read/write input history.
628 (defvar term-raw-map nil
633 (defvar term-raw-escape-map nil)
665 (defmacro term-in-char-mode () '(eq (current-local-map) term-raw-map))
770 ; (define-key term-mode-map [menu-bar completion complete-file]
802 (define-key term-completion-menu [menu-bar completion complete-file]
860 ;; Set up term-raw-map, etc.
865 (define-key term-raw-map term-escape-char 'term-send-raw))
867 (define-key term-raw-map c term-raw-escape-map)
868 ;; Define standard bindings in term-raw-escape-map
869 (define-key term-raw-escape-map "\C-v"
871 (define-key term-raw-escape-map "\C-u"
873 (define-key term-raw-escape-map c 'term-send-raw)
874 (define-key term-raw-escape-map "\C-q" 'term-pager-toggle)
876 (define-key term-raw-escape-map "\C-k" 'term-char-mode)
877 (define-key term-raw-escape-map "\C-j" 'term-line-mode)
879 (define-key term-raw-escape-map [?\M-x] 'execute-extended-command))
885 (define-key map (make-string 1 i) 'term-send-raw)
888 (define-key esc-map (make-string 1 i) 'term-send-raw-meta))
891 (define-key map (vector elm) 'term-send-raw))
893 (setq term-raw-map map)
894 (setq term-raw-escape-map
900 (define-key term-raw-map [button2] 'term-mouse-paste)
901 (define-key term-raw-map [mouse-2] 'term-mouse-paste)
902 (define-key term-raw-map [menu-bar terminal] term-terminal-menu)
903 (define-key term-raw-map [menu-bar signals] term-signals-menu))
904 (define-key term-raw-map [up] 'term-send-up)
905 (define-key term-raw-map [down] 'term-send-down)
906 (define-key term-raw-map [right] 'term-send-right)
907 (define-key term-raw-map [left] 'term-send-left)
908 (define-key term-raw-map [delete] 'term-send-del)
909 (define-key term-raw-map [deletechar] 'term-send-del)
910 (define-key term-raw-map [backspace] 'term-send-backspace)
911 (define-key term-raw-map [home] 'term-send-home)
912 (define-key term-raw-map [end] 'term-send-end)
913 (define-key term-raw-map [insert] 'term-send-insert)
914 (define-key term-raw-map [S-prior] 'scroll-down)
915 (define-key term-raw-map [S-next] 'scroll-up)
916 (define-key term-raw-map [S-insert] 'term-paste)
917 (define-key term-raw-map [prior] 'term-send-prior)
918 (define-key term-raw-map [next] 'term-send-next))
956 The interpreter name is same as buffer name, sans the asterisks.
989 Commands in raw mode:
991 \\{term-raw-map}
1002 (setq mode-name "Term")
1025 (make-local-variable 'term-input-ring-file-name)
1041 (setq term-ansi-at-host (system-name))
1161 (defun term-send-raw-string (chars)
1172 (defun term-send-raw ()
1180 (term-send-raw-string (make-string 1 last-input-char)))
1182 (defun term-send-raw-meta ()
1195 (term-send-raw-string (if (and (numberp char)
1205 (term-send-raw-string
1213 (term-send-raw-string (current-kill (cond
1221 (term-send-raw-string (current-kill 0)))
1227 (defun term-send-up () (interactive) (term-send-raw-string "\eOA"))
1228 (defun term-send-down () (interactive) (term-send-raw-string "\eOB"))
1229 (defun term-send-right () (interactive) (term-send-raw-string "\eOC"))
1230 (defun term-send-left () (interactive) (term-send-raw-string "\eOD"))
1231 (defun term-send-home () (interactive) (term-send-raw-string "\e[1~"))
1232 (defun term-send-insert() (interactive) (term-send-raw-string "\e[2~"))
1233 (defun term-send-end () (interactive) (term-send-raw-string "\e[4~"))
1234 (defun term-send-prior () (interactive) (term-send-raw-string "\e[5~"))
1235 (defun term-send-next () (interactive) (term-send-raw-string "\e[6~"))
1236 (defun term-send-del () (interactive) (term-send-raw-string "\e[3~"))
1237 (defun term-send-backspace () (interactive) (term-send-raw-string "\C-?"))
1241 "Switch to char (\"raw\") sub-mode of term mode.
1245 ;; FIXME: Emit message? Cfr ilisp-raw-message
1248 (use-local-map term-raw-map)
1282 name of one."
1287 (defun make-term (name program &optional startfile &rest switches)
1289 The name of the buffer is made by surrounding NAME with `*'s.
1291 Optional third arg STARTFILE is the name of a file to send the contents of to
1293 (let ((buffer (get-buffer-create (concat "*" name "*"))))
1300 (term-exec buffer name program startfile switches)))
1309 \\<term-raw-map>Type \\[switch-to-buffer] to switch to another buffer."
1311 (or explicit-shell-file-name
1320 (defun term-exec (buffer name command startfile switches)
1330 (let ((proc (term-exec-1 name buffer command switches)))
1347 (insert-file-contents startfile)
1359 (if (null (buffer-name buffer))
1372 (term-handle-exit (process-name proc)
1381 (defun term-handle-exit (process-name msg)
1389 (insert ?\n "Process " process-name " " msg)
1398 (defvar term-term-name "eterm-color")
1400 ; (format term-termcap-string emacs-term-name "TERMCAP=" 24 80)
1419 (defun term-exec-1 (name buffer command switches)
1428 (format "TERM=%s" term-term-name)
1431 term-term-name term-height term-width)
1445 ;; escape codes, so we need to see the raw output. We will have to
1448 (apply 'start-process name buffer
1478 ;;; term-write-input-ring Write to term-input-ring-file-name.
1482 "Sets the buffer's `term-input-ring' from a history file.
1483 The name of the file is given by the variable `term-input-ring-file-name'.
1484 The history ring is of size `term-input-ring-size', regardless of file size.
1485 If `term-input-ring-file-name' is nil this function does nothing.
1488 failure to read the history file.
1492 The structure of the history file should be one input command per line,
1495 (cond ((or (null term-input-ring-file-name)
1496 (equal term-input-ring-file-name ""))
1498 ((not (file-readable-p term-input-ring-file-name))
1500 (message "Cannot read history file %s"
1501 term-input-ring-file-name)))
1504 (file term-input-ring-file-name)
1512 (insert-file-contents file)
1513 ;; Save restriction in case file is already visited...
1531 "Writes the buffer's `term-input-ring' to a history file.
1532 The name of the file is given by the variable `term-input-ring-file-name'.
1533 The original contents of the file are lost if `term-input-ring' is not empty.
1534 If `term-input-ring-file-name' is nil this function does nothing.
1539 (cond ((or (null term-input-ring-file-name)
1540 (equal term-input-ring-file-name "")
1543 ((not (file-writable-p term-input-ring-file-name))
1544 (message "Cannot write history file %s" term-input-ring-file-name))
1548 (file term-input-ring-file-name)
1558 (write-region (buffer-string) nil file nil 'no-message)
1925 Argument 0 is the command name."
2330 ;;; Support for source-file processing commands.
2335 ;;; for doing this (e.g., lisp-load-file). The functions below are useful
2339 ;;; and Soar, in that they don't know anything about file extensions.
2341 ;;; The load-file/compile-file default mechanism could be smarter -- it
2343 ;;; whether the file is source or executable. If you compile foo.lisp
2344 ;;; with compile-file, then the next load-file should use foo.bin for
2350 ;;; TERM-SOURCE-DEFAULT -- determines defaults for source-file processing
2357 ;;; TERM-GET-SOURCE -- used by the source-file processing commands to prompt
2358 ;;; for the file to process.
2360 ;;; (TERM-SOURCE-DEFAULT previous-dir/file source-modes)
2362 ;;; This function computes the defaults for the load-file and compile-file
2366 ;;; source-file processing command, or nil if there hasn't been one yet.
2376 ;;; If the command is given in a file buffer whose major mode is in
2377 ;;; SOURCE-MODES, then the filename is the default file, and the
2378 ;;; file's directory is the default directory.
2380 ;;; If the buffer isn't a source file buffer (e.g., it's the process buffer),
2381 ;;; then the default directory & file are what was used in the last source-file
2384 ;;; is the cwd, with no default file. (\"no default file\" = nil)
2390 ;;; The function returns a pair: (default-directory . default-file).
2392 (defun term-source-default (previous-dir/file source-modes)
2393 (cond ((and buffer-file-name (memq major-mode source-modes))
2394 (cons (file-name-directory buffer-file-name)
2395 (file-name-nondirectory buffer-file-name)))
2396 (previous-dir/file)
2403 ;;; Prior to loading or compiling (or otherwise processing) a file (in the CMU
2405 ;;; If the file is loaded into a buffer, and the buffer is modified, the user
2410 (let ((buff (get-file-buffer fname)))
2414 (buffer-name buff))))
2422 ;;; (TERM-GET-SOURCE prompt prev-dir/file source-modes mustmatch-p)
2425 ;;; commands that process source files (like loading or compiling a file).
2431 ;;; PROMPT is the prompt string. PREV-DIR/FILE is the (directory . file) pair
2433 ;;; modes used to determine what file buffers contain source files. (These
2435 ;;; then the filename reader will only accept a file that exists.
2438 ;;; (interactive (term-get-source "Compile file: " prev-lisp-dir/file
2458 (defun term-get-source (prompt prev-dir/file source-modes mustmatch-p)
2459 (let* ((def (term-source-default prev-dir/file source-modes))
2463 (file-exists-p stringfile)
2465 (not (file-directory-p stringfile))))
2466 (defdir (if sfile-p (file-name-directory stringfile)
2468 (deffile (if sfile-p (file-name-nondirectory stringfile)
2470 (ans (read-file-name (if deffile (format "%s(default %s) "
2476 (list (expand-file-name (substitute-in-file-name ans)))))
2667 (file-name-as-directory
2668 (if (and (string= term-ansi-at-host (system-name))
2669 (string= term-ansi-at-user (user-real-login-name)))
2670 (expand-file-name term-ansi-at-dir)
2671 (if (string= term-ansi-at-user (user-real-login-name))
2678 (if (string= term-ansi-at-host (system-name))
3394 ;; Make sure the file named TRUE-FILE is in a buffer that appears on the screen
3399 (defun term-display-line (true-file line)
3400 (term-display-buffer-line (find-file-noselect true-file) line))
3450 ; (define-key map (make-string 1 i) 'term-send-raw)
3835 (defun term-start-output-log (name)
3836 "Record raw inferior process output in a buffer."
3841 (buffer-name (current-buffer)))
3843 (if (or (null name) (equal name ""))
3846 (if (get-buffer name)
3849 (set-buffer (get-buffer-create name))
3853 (setq term-log-buffer (get-buffer name))
3855 (buffer-name term-log-buffer))))
3858 "Discontinue raw inferior process logging."
3889 ;;; replace with expanded/completed name.
3906 "*If non-nil, add a `/' to completed directories, ` ' to file names.
3918 "*List of suffixes to be disregarded during file completion.
3923 (defvar term-file-name-prefix ""
3924 "Prefix prepended to absolute file names taken from process input.
3930 ;; Return expanded DIRECTORY, with `term-file-name-prefix' if absolute.
3931 (expand-file-name (if (file-name-absolute-p directory)
3932 (concat term-file-name-prefix directory)
3957 (and filename (substitute-in-file-name filename))))
3988 (message "Completing file name..."))
4004 (pathdir (file-name-directory filename))
4005 (pathnondir (file-name-nondirectory filename))
4007 (completion (file-name-completion pathnondir directory))
4012 ((eq completion t) ; Means already completed "file".
4018 (let ((file (concat (file-name-as-directory directory) completion)))
4019 (insert (substring (directory-file-name completion)
4021 (cond ((symbolp (file-name-completion completion directory))
4023 (insert (if (file-directory-p file) dirsuffix filesuffix))
4027 (file-exists-p file))
4029 (insert (if (file-directory-p file) dirsuffix filesuffix))
4046 see `expand-file-name' and `substitute-in-file-name'. For completion see
4049 (replace-match (expand-file-name (term-match-partial-filename)) t t)
4106 (pathdir (file-name-directory filename))
4107 (pathnondir (file-name-nondirectory filename))
4109 (completions (file-name-all-completions pathnondir directory)))
4141 (defun term-ansi-make-term (name program &optional startfile &rest switches)
4143 The name of the buffer is NAME.
4145 Optional third arg STARTFILE is the name of a file to send the contents of to
4147 (let ((buffer (get-buffer-create name )))
4154 (term-exec buffer name program startfile switches)))
4157 (defvar term-ansi-buffer-name nil)
4159 (defvar term-ansi-buffer-base-name nil)
4162 (defun ansi-term (program &optional new-buffer-name)
4165 (or explicit-shell-file-name
4170 ;; Pick the name of the new buffer.
4171 (setq term-ansi-buffer-name
4172 (if new-buffer-name
4173 new-buffer-name
4174 (if term-ansi-buffer-base-name
4175 (if (eq term-ansi-buffer-base-name t)
4176 (file-name-nondirectory program)
4177 term-ansi-buffer-base-name)
4180 (setq term-ansi-buffer-name (concat "*" term-ansi-buffer-name "*"))
4186 (setq term-ansi-buffer-name (generate-new-buffer-name term-ansi-buffer-name))
4187 (setq term-ansi-buffer-name (term-ansi-make-term term-ansi-buffer-name program))
4189 (set-buffer term-ansi-buffer-name)
4193 ;; I wanna have find-file on C-x C-f -mm
4199 (switch-to-buffer term-ansi-buffer-name))
4266 ;;; (setq mode-name "Shell")