comparison lisp/term.el @ 109724:7d18e1db65fe

merge trunk
author Kenichi Handa <handa@etlken>
date Mon, 09 Aug 2010 10:51:16 +0900
parents df8e0cd18128
children bcc7c00e9ef4
comparison
equal deleted inserted replaced
109544:197e874deb67 109724:7d18e1db65fe
500 This is a good thing to set in mode hooks.") 500 This is a good thing to set in mode hooks.")
501 501
502 (defvar term-delimiter-argument-list () 502 (defvar term-delimiter-argument-list ()
503 "List of characters to recognize as separate arguments in input. 503 "List of characters to recognize as separate arguments in input.
504 Strings comprising a character in this list will separate the arguments 504 Strings comprising a character in this list will separate the arguments
505 surrounding them, and also be regarded as arguments in their own right (unlike 505 surrounding them, and also be regarded as arguments in their own right
506 whitespace). See `term-arguments'. 506 \(unlike whitespace). See `term-arguments'.
507 Defaults to the empty list. 507 Defaults to the empty list.
508 508
509 For shells, a good value is (?\\| ?& ?< ?> ?\\( ?\\) ?\\;). 509 For shells, a good value is (?\\| ?& ?< ?> ?\\( ?\\) ?\\;).
510 510
511 This is a good thing to set in mode hooks.") 511 This is a good thing to set in mode hooks.")
1514 ;; term-read-input-ring Read into term-input-ring... 1514 ;; term-read-input-ring Read into term-input-ring...
1515 ;; term-write-input-ring Write to term-input-ring-file-name. 1515 ;; term-write-input-ring Write to term-input-ring-file-name.
1516 ;; term-replace-by-expanded-history-before-point Workhorse function. 1516 ;; term-replace-by-expanded-history-before-point Workhorse function.
1517 1517
1518 (defun term-read-input-ring (&optional silent) 1518 (defun term-read-input-ring (&optional silent)
1519 "Sets the buffer's `term-input-ring' from a history file. 1519 "Set the buffer's `term-input-ring' from a history file.
1520 The name of the file is given by the variable `term-input-ring-file-name'. 1520 The name of the file is given by the variable `term-input-ring-file-name'.
1521 The history ring is of size `term-input-ring-size', regardless of file size. 1521 The history ring is of size `term-input-ring-size', regardless of file size.
1522 If `term-input-ring-file-name' is nil this function does nothing. 1522 If `term-input-ring-file-name' is nil this function does nothing.
1523 1523
1524 If the optional argument SILENT is non-nil, we say nothing about a 1524 If the optional argument SILENT is non-nil, we say nothing about a
1562 (kill-buffer history-buf)) 1562 (kill-buffer history-buf))
1563 (setq term-input-ring ring 1563 (setq term-input-ring ring
1564 term-input-ring-index nil))))) 1564 term-input-ring-index nil)))))
1565 1565
1566 (defun term-write-input-ring () 1566 (defun term-write-input-ring ()
1567 "Writes the buffer's `term-input-ring' to a history file. 1567 "Write the buffer's `term-input-ring' to a history file.
1568 The name of the file is given by the variable `term-input-ring-file-name'. 1568 The name of the file is given by the variable `term-input-ring-file-name'.
1569 The original contents of the file are lost if `term-input-ring' is not empty. 1569 The original contents of the file are lost if `term-input-ring' is not empty.
1570 If `term-input-ring-file-name' is nil this function does nothing. 1570 If `term-input-ring-file-name' is nil this function does nothing.
1571 1571
1572 Useful within process sentinels. 1572 Useful within process sentinels.
1994 1994
1995 (defun term-send-input () 1995 (defun term-send-input ()
1996 "Send input to process. 1996 "Send input to process.
1997 After the process output mark, sends all text from the process mark to 1997 After the process output mark, sends all text from the process mark to
1998 point as input to the process. Before the process output mark, calls value 1998 point as input to the process. Before the process output mark, calls value
1999 of variable term-get-old-input to retrieve old input, copies it to the 1999 of variable `term-get-old-input' to retrieve old input, copies it to the
2000 process mark, and sends it. A terminal newline is also inserted into the 2000 process mark, and sends it. A terminal newline is also inserted into the
2001 buffer and sent to the process. The list of function names contained in the 2001 buffer and sent to the process. The list of function names contained in the
2002 value of `term-input-filter-functions' is called on the input before sending 2002 value of `term-input-filter-functions' is called on the input before sending
2003 it. The input is entered into the input history ring, if the value of variable 2003 it. The input is entered into the input history ring, if the value of variable
2004 term-input-filter returns non-nil when called on the input. 2004 `term-input-filter' returns non-nil when called on the input.
2005 2005
2006 Any history reference may be expanded depending on the value of the variable 2006 Any history reference may be expanded depending on the value of the variable
2007 `term-input-autoexpand'. The list of function names contained in the value 2007 `term-input-autoexpand'. The list of function names contained in the value
2008 of `term-input-filter-functions' is called on the input before sending it. 2008 of `term-input-filter-functions' is called on the input before sending it.
2009 The input is entered into the input history ring, if the value of variable 2009 The input is entered into the input history ring, if the value of variable
2135 set the hook `term-input-sender'." 2135 set the hook `term-input-sender'."
2136 (term-send-string proc string) 2136 (term-send-string proc string)
2137 (term-send-string proc "\n")) 2137 (term-send-string proc "\n"))
2138 2138
2139 (defun term-bol (arg) 2139 (defun term-bol (arg)
2140 "Goes to the beginning of line, then skips past the prompt, if any. 2140 "Go to the beginning of line, then skip past the prompt, if any.
2141 If a prefix argument is given (\\[universal-argument]), then no prompt skip 2141 If a prefix argument is given (\\[universal-argument]), then no prompt skip
2142 -- go straight to column 0. 2142 -- go straight to column 0.
2143 2143
2144 The prompt skip is done by skipping text matching the regular expression 2144 The prompt skip is done by skipping text matching the regular expression
2145 `term-prompt-regexp', a buffer local variable." 2145 `term-prompt-regexp', a buffer local variable."
3758 (insert ?\n) 3758 (insert ?\n)
3759 (put-text-property saved-point (point) 'face 'default) 3759 (put-text-property saved-point (point) 'face 'default)
3760 (goto-char saved-point)))) 3760 (goto-char saved-point))))
3761 3761
3762 (defun term-erase-in-display (kind) 3762 (defun term-erase-in-display (kind)
3763 "Erases (that is blanks out) part of the window. 3763 "Erase (that is blank out) part of the window.
3764 If KIND is 0, erase from (point) to (point-max); 3764 If KIND is 0, erase from (point) to (point-max);
3765 if KIND is 1, erase from home to point; else erase from home to point-max." 3765 if KIND is 1, erase from home to point; else erase from home to point-max."
3766 (term-handle-deferred-scroll) 3766 (term-handle-deferred-scroll)
3767 (cond ((eq term-terminal-parameter 0) 3767 (cond ((eq term-terminal-parameter 0)
3768 (let ((need-unwrap (bolp))) 3768 (let ((need-unwrap (bolp)))
4164 (set-window-configuration conf) 4164 (set-window-configuration conf)
4165 (setq unread-command-events (listify-key-sequence key))))))) 4165 (setq unread-command-events (listify-key-sequence key)))))))
4166 4166
4167 ;; I need a make-term that doesn't surround with *s -mm 4167 ;; I need a make-term that doesn't surround with *s -mm
4168 (defun term-ansi-make-term (name program &optional startfile &rest switches) 4168 (defun term-ansi-make-term (name program &optional startfile &rest switches)
4169 "Make a term process NAME in a buffer, running PROGRAM. 4169 "Make a term process NAME in a buffer, running PROGRAM.
4170 The name of the buffer is NAME. 4170 The name of the buffer is NAME.
4171 If there is already a running process in that buffer, it is not restarted. 4171 If there is already a running process in that buffer, it is not restarted.
4172 Optional third arg STARTFILE is the name of a file to send the contents of to 4172 Optional third arg STARTFILE is the name of a file to send the contents of to
4173 the process. Any more args are arguments to PROGRAM." 4173 the process. Any more args are arguments to PROGRAM."
4174 (let ((buffer (get-buffer-create name ))) 4174 (let ((buffer (get-buffer-create name )))
4265 If `serial-read-speed' reads this string from the user, it 4265 If `serial-read-speed' reads this string from the user, it
4266 returns nil, which is recognized by `serial-process-configure' 4266 returns nil, which is recognized by `serial-process-configure'
4267 for special serial ports that cannot be configured.") 4267 for special serial ports that cannot be configured.")
4268 4268
4269 (defun serial-supported-or-barf () 4269 (defun serial-supported-or-barf ()
4270 "Signal an error if serial processes are not supported" 4270 "Signal an error if serial processes are not supported."
4271 (unless (fboundp 'make-serial-process) 4271 (unless (fboundp 'make-serial-process)
4272 (error "Serial processes are not supported on this system"))) 4272 (error "Serial processes are not supported on this system")))
4273 4273
4274 (defun serial-read-name () 4274 (defun serial-read-name ()
4275 "Read a serial port name from the user. 4275 "Read a serial port name from the user.