]> code.delx.au - gnu-emacs/blobdiff - lisp/term.el
mouse-drag-line changes for mouse-1 in header-line
[gnu-emacs] / lisp / term.el
index d5f35006357d97a2472b2122ebc94e4c4b91a2f7..1a0dd0cc86f491c5b0b8a4b60360f57974c1a03b 100644 (file)
@@ -1,7 +1,7 @@
 ;;; term.el --- general command interpreter in a window stuff
 
-;; Copyright (C) 1988, 1990, 1992, 1994-1995, 2001-2012
-;;   Free Software Foundation, Inc.
+;; Copyright (C) 1988, 1990, 1992, 1994-1995, 2001-2013 Free Software
+;; Foundation, Inc.
 
 ;; Author: Per Bothner <per@bothner.com>
 ;; Maintainer: Dan Nicolaescu <dann@ics.uci.edu>, Per Bothner <per@bothner.com>
@@ -452,7 +452,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 +759,7 @@ Buffer local variable.")
 
 ;;; Faces
 (defvar ansi-term-color-vector
-  [term-face
+  [term
    term-color-black
    term-color-red
    term-color-green
@@ -770,18 +770,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)
+  :type '(choice (const nil) (string :tag "color")))
+(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)
+  :type '(choice (const nil) (string :tag "color")))
+(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,13 +990,16 @@ 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)
   (setq term-ansi-current-color 0)
   (setq term-ansi-current-invisible nil)
-  (setq term-ansi-face-already-done t)
+  ;; Stefan thought this should be t, but could not remember why.
+  ;; Setting it to t seems to cause bug#11785.  Setting it to nil
+  ;; again to see if there are other consequences...
+  (setq term-ansi-face-already-done nil)
   (setq term-ansi-current-bg-color 0))
 
 (define-derived-mode term-mode fundamental-mode "Term"
@@ -3211,18 +3216,24 @@ See `term-prompt-regexp'."
         (let ((color
                (if term-ansi-current-reverse
                    (face-foreground
-                    (elt ansi-term-color-vector term-ansi-current-color))
+                    (elt ansi-term-color-vector term-ansi-current-color)
+                    nil 'default)
                  (face-background
-                  (elt ansi-term-color-vector term-ansi-current-bg-color)))))
+                  (elt ansi-term-color-vector term-ansi-current-bg-color)
+                  nil 'default))))
           (setq term-current-face
                 (list :background color
                       :foreground color))
           ) ;; No need to bother with anything else if it's invisible.
       (setq term-current-face
             (list :foreground
-                  (face-foreground (elt ansi-term-color-vector term-ansi-current-color))
+                  (face-foreground
+                   (elt ansi-term-color-vector term-ansi-current-color)
+                   nil 'default)
                   :background
-                  (face-background (elt ansi-term-color-vector term-ansi-current-bg-color))
+                  (face-background
+                   (elt ansi-term-color-vector term-ansi-current-bg-color)
+                   nil 'default)
                   :inverse-video term-ansi-current-reverse))
 
       (when term-ansi-current-bold
@@ -4048,6 +4059,7 @@ Returns `partial' if completed as far as possible with the completion matches.
 Returns `listed' if a completion listing was shown.
 
 See also `term-dynamic-complete-filename'."
+  (declare (obsolete completion-in-region "23.2"))
   (let* ((completion-ignore-case nil)
         (candidates (mapcar (function (lambda (x) (list x))) candidates))
         (completions (all-completions stub candidates)))
@@ -4081,8 +4093,6 @@ See also `term-dynamic-complete-filename'."
                   (t
                    (message "Partially completed")
                    'partial)))))))
-(make-obsolete 'term-dynamic-simple-complete 'completion-in-region "23.2")
-
 
 (defun term-dynamic-list-filename-completions ()
   "List in help buffer possible completions of the filename at point."
@@ -4174,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))