diff options
| author | Stefan Monnier | 2015-05-03 22:24:20 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2015-05-03 22:24:20 -0400 |
| commit | 4183482f4dd3c1a96c817d1598024952b82a7e59 (patch) | |
| tree | b8e6e28a8ad99f4ce98f59a1703e707e043c0495 | |
| parent | b7bb71c801ecd9afa09f260ca7dbe7a5677cf9e0 (diff) | |
| download | emacs-4183482f4dd3c1a96c817d1598024952b82a7e59.tar.gz emacs-4183482f4dd3c1a96c817d1598024952b82a7e59.zip | |
* lisp/term/screen.el (xterm-screen-extra-capabilities): New custom
(terminal-init-screen): Use it (bug#20356).
* lisp/term/xterm.el: Provide `term/xterm' instead of `xterm'.
(xterm--extra-capabilities-type): New const.
(xterm-extra-capabilities): Use it.
(xterm--version-handler): Lower the pseudo-version for `screen'.
| -rw-r--r-- | etc/NEWS | 7 | ||||
| -rw-r--r-- | lisp/term/screen.el | 17 | ||||
| -rw-r--r-- | lisp/term/xterm.el | 27 |
3 files changed, 38 insertions, 13 deletions
| @@ -238,6 +238,8 @@ Unicode standards. | |||
| 238 | 238 | ||
| 239 | * Changes in Specialized Modes and Packages in Emacs 25.1 | 239 | * Changes in Specialized Modes and Packages in Emacs 25.1 |
| 240 | 240 | ||
| 241 | ** New `xterm-screen-extra-capabilities' config. | ||
| 242 | |||
| 241 | ** The `save-place' variable is replaced by a `save-place-mode'. | 243 | ** The `save-place' variable is replaced by a `save-place-mode'. |
| 242 | 244 | ||
| 243 | ** Midnight-mode | 245 | ** Midnight-mode |
| @@ -691,6 +693,11 @@ a typographically-correct documents. | |||
| 691 | 693 | ||
| 692 | * Incompatible Lisp Changes in Emacs 25.1 | 694 | * Incompatible Lisp Changes in Emacs 25.1 |
| 693 | 695 | ||
| 696 | ** `indirect-function' does not signal `void-function' any more. | ||
| 697 | This is mostly a bug-fix, since this change was missed back in 24.4 when | ||
| 698 | symbol-function was changed not to signal `void-function' any more. | ||
| 699 | *** As a consequence, the second arg of `indirect-function' is now obsolete. | ||
| 700 | |||
| 694 | ** Comint, term, and compile do not set the EMACS env var any more. | 701 | ** Comint, term, and compile do not set the EMACS env var any more. |
| 695 | Use the INSIDE_EMACS environment variable instead. | 702 | Use the INSIDE_EMACS environment variable instead. |
| 696 | 703 | ||
diff --git a/lisp/term/screen.el b/lisp/term/screen.el index 3587c4f95e5..41fd916a785 100644 --- a/lisp/term/screen.el +++ b/lisp/term/screen.el | |||
| @@ -1,9 +1,22 @@ | |||
| 1 | ;;; screen.el --- terminal initialization for screen and tmux -*- lexical-binding: t -*- | 1 | ;;; screen.el --- terminal initialization for screen and tmux -*- lexical-binding: t -*- |
| 2 | ;; Copyright (C) 1995, 2001-2015 Free Software Foundation, Inc. | 2 | ;; Copyright (C) 1995, 2001-2015 Free Software Foundation, Inc. |
| 3 | 3 | ||
| 4 | (require 'term/xterm) | ||
| 5 | |||
| 6 | (defcustom xterm-screen-extra-capabilities '(modifyOtherKeys) | ||
| 7 | "Extra capabilities supported under \"screen\". | ||
| 8 | Some features of screen depend on the terminal emulator in which | ||
| 9 | it runs, which can change when the screen session is moved to another tty." | ||
| 10 | :type xterm--extra-capabilities-type | ||
| 11 | :group 'xterm) | ||
| 12 | |||
| 4 | (defun terminal-init-screen () | 13 | (defun terminal-init-screen () |
| 5 | "Terminal initialization function for screen." | 14 | "Terminal initialization function for screen." |
| 6 | ;; Treat a screen terminal similar to an xterm. | 15 | ;; Treat a screen terminal similar to an xterm, but don't use |
| 7 | (tty-run-terminal-initialization (selected-frame) "xterm")) | 16 | ;; xterm-extra-capabilities's `check' setting since that doesn't seem |
| 17 | ;; to work so well (it depends too much on the surrounding terminal | ||
| 18 | ;; emulator, which can change during the session, bug#20356). | ||
| 19 | (let ((xterm-extra-capabilities xterm-screen-extra-capabilities)) | ||
| 20 | (tty-run-terminal-initialization (selected-frame) "xterm"))) | ||
| 8 | 21 | ||
| 9 | ;; screen.el ends here | 22 | ;; screen.el ends here |
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el index 726ecf91f85..79699c6fe43 100644 --- a/lisp/term/xterm.el +++ b/lisp/term/xterm.el | |||
| @@ -29,6 +29,13 @@ | |||
| 29 | :version "24.1" | 29 | :version "24.1" |
| 30 | :group 'terminals) | 30 | :group 'terminals) |
| 31 | 31 | ||
| 32 | (defconst xterm--extra-capabilities-type | ||
| 33 | ;; NOTE: If you add entries here, make sure to update | ||
| 34 | ;; `terminal-init-xterm' as well. | ||
| 35 | '(set (const :tag "modifyOtherKeys support" modifyOtherKeys) | ||
| 36 | (const :tag "report background" reportBackground) | ||
| 37 | (const :tag "set X selection" setSelection))) | ||
| 38 | |||
| 32 | (defcustom xterm-extra-capabilities 'check | 39 | (defcustom xterm-extra-capabilities 'check |
| 33 | "Whether Xterm supports some additional, more modern, features. | 40 | "Whether Xterm supports some additional, more modern, features. |
| 34 | If nil, just assume that it does not. | 41 | If nil, just assume that it does not. |
| @@ -40,13 +47,8 @@ The relevant features are: | |||
| 40 | reportBackground -- if supported, Xterm reports its background color | 47 | reportBackground -- if supported, Xterm reports its background color |
| 41 | setSelection -- if supported, Xterm saves yanked text to the X selection" | 48 | setSelection -- if supported, Xterm saves yanked text to the X selection" |
| 42 | :version "24.1" | 49 | :version "24.1" |
| 43 | :type '(choice (const :tag "No" nil) | 50 | :type `(choice (const :tag "Check" check) |
| 44 | (const :tag "Check" check) | 51 | ,xterm--extra-capabilities-type)) |
| 45 | ;; NOTE: If you add entries here, make sure to update | ||
| 46 | ;; `terminal-init-xterm' as well. | ||
| 47 | (set (const :tag "modifyOtherKeys support" modifyOtherKeys) | ||
| 48 | (const :tag "report background" reportBackground) | ||
| 49 | (const :tag "set X selection" setSelection)))) | ||
| 50 | 52 | ||
| 51 | (defcustom xterm-max-cut-length 100000 | 53 | (defcustom xterm-max-cut-length 100000 |
| 52 | "Maximum number of bytes to cut into xterm using the OSC 52 sequence. | 54 | "Maximum number of bytes to cut into xterm using the OSC 52 sequence. |
| @@ -623,8 +625,11 @@ string bytes that can be copied is 3/4 of this value." | |||
| 623 | (setq version 200)) | 625 | (setq version 200)) |
| 624 | (when (equal (match-string 1 str) "83") | 626 | (when (equal (match-string 1 str) "83") |
| 625 | ;; `screen' (which returns 83;40003;0) seems to also lack support for | 627 | ;; `screen' (which returns 83;40003;0) seems to also lack support for |
| 626 | ;; some of these (bug#17607). | 628 | ;; some of these (bug#17607, bug#20356). |
| 627 | (setq version 240)) | 629 | ;; Note: this code path should normally not be used any more |
| 630 | ;; since term/screen.el now binds xterm-extra-capabilities | ||
| 631 | ;; to a fixed value, rather than using the dynamic checking. | ||
| 632 | (setq version 200)) | ||
| 628 | ;; If version is 242 or higher, assume the xterm supports | 633 | ;; If version is 242 or higher, assume the xterm supports |
| 629 | ;; reporting the background color (TODO: maybe earlier | 634 | ;; reporting the background color (TODO: maybe earlier |
| 630 | ;; versions do too...) | 635 | ;; versions do too...) |
| @@ -925,6 +930,6 @@ versions of xterm." | |||
| 925 | (set-terminal-parameter nil 'background-mode 'dark) | 930 | (set-terminal-parameter nil 'background-mode 'dark) |
| 926 | t)) | 931 | t)) |
| 927 | 932 | ||
| 928 | (provide 'xterm) | 933 | (provide 'xterm) ;Backward compatibility. |
| 929 | 934 | (provide 'term/xterm) | |
| 930 | ;;; xterm.el ends here | 935 | ;;; xterm.el ends here |