Merge from emacs-24; up to 2012-11-15T23:31:37Z!dancol@dancol.org
[bpt/emacs.git] / lisp / term.el
index 7567bd3..a7c50d6 100644 (file)
 (require 'ring)
 (require 'ehelp)
 
+(declare-function ring-empty-p "ring" (ring))
+(declare-function ring-ref "ring" (ring index))
+(declare-function ring-insert-at-beginning "ring" (ring item))
+(declare-function ring-length "ring" (ring))
+(declare-function ring-insert "ring" (ring item))
+
 (defgroup term nil
   "General command interpreter in a window."
   :group 'processes)
@@ -452,7 +458,7 @@ state 4: term-terminal-parameter contains pending output.")
   "A queue of strings whose echo we want suppressed.")
 (defvar term-terminal-parameter)
 (defvar term-terminal-previous-parameter)
-(defvar term-current-face 'term-face)
+(defvar term-current-face 'term)
 (defvar term-scroll-start 0 "Top-most line (inclusive) of scrolling region.")
 (defvar term-scroll-end) ; Number of line (zero-based) after scrolling region.
 (defvar term-pager-count nil
@@ -759,7 +765,7 @@ Buffer local variable.")
 
 ;;; Faces
 (defvar ansi-term-color-vector
-  [term-face
+  [term
    term-color-black
    term-color-red
    term-color-green
@@ -770,18 +776,20 @@ Buffer local variable.")
    term-color-white])
 
 (defcustom term-default-fg-color nil
-  "If non-nil, default color for foreground in Term mode.
-This is deprecated in favor of customizing the `term-face' face."
+  "If non-nil, default color for foreground in Term mode."
   :group 'term
   :type 'string)
+(make-obsolete-variable 'term-default-fg-color "use the face `term' instead."
+                        "24.3")
 
 (defcustom term-default-bg-color nil
-  "If non-nil, default color for foreground in Term mode.
-This is deprecated in favor of customizing the `term-face' face."
+  "If non-nil, default color for foreground in Term mode."
   :group 'term
   :type 'string)
+(make-obsolete-variable 'term-default-bg-color "use the face `term' instead."
+                        "24.3")
 
-(defface term-face
+(defface term
   `((t
      :foreground ,term-default-fg-color
      :background ,term-default-bg-color
@@ -988,7 +996,7 @@ is buffer-local."
     dt))
 
 (defun term-ansi-reset ()
-  (setq term-current-face 'term-face)
+  (setq term-current-face 'term)
   (setq term-ansi-current-underline nil)
   (setq term-ansi-current-bold nil)
   (setq term-ansi-current-reverse nil)
@@ -4176,11 +4184,16 @@ the process.  Any more args are arguments to PROGRAM."
   (term-mode)
   (term-char-mode)
 
-  ;; I wanna have find-file on C-x C-f -mm
-  ;; your mileage may definitely vary, maybe it's better to put this in your
-  ;; .emacs ...
-
-  (term-set-escape-char ?\C-x)
+  ;; Historical baggage.  A call to term-set-escape-char used to not
+  ;; undo any previous call to t-s-e-c.  Because of this, ansi-term
+  ;; ended up with both C-x and C-c as escape chars.  Who knows what
+  ;; the original intention was, but people could have become used to
+  ;; either.   (Bug#12842)
+  (let (term-escape-char)
+    ;; I wanna have find-file on C-x C-f -mm
+    ;; your mileage may definitely vary, maybe it's better to put this in your
+    ;; .emacs ...
+    (term-set-escape-char ?\C-x))
 
   (switch-to-buffer term-ansi-buffer-name))