[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 4183482: * lisp/term/screen.el (xterm-screen-extra-
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] master 4183482: * lisp/term/screen.el (xterm-screen-extra-capabilities): New custom |
Date: |
Mon, 04 May 2015 02:24:30 +0000 |
branch: master
commit 4183482f4dd3c1a96c817d1598024952b82a7e59
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>
* 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'.
---
etc/NEWS | 7 +++++++
lisp/term/screen.el | 17 +++++++++++++++--
lisp/term/xterm.el | 27 ++++++++++++++++-----------
3 files changed, 38 insertions(+), 13 deletions(-)
diff --git a/etc/NEWS b/etc/NEWS
index 7497652..715295b 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -238,6 +238,8 @@ Unicode standards.
* Changes in Specialized Modes and Packages in Emacs 25.1
+** New `xterm-screen-extra-capabilities' config.
+
** The `save-place' variable is replaced by a `save-place-mode'.
** Midnight-mode
@@ -691,6 +693,11 @@ a typographically-correct documents.
* Incompatible Lisp Changes in Emacs 25.1
+** `indirect-function' does not signal `void-function' any more.
+This is mostly a bug-fix, since this change was missed back in 24.4 when
+symbol-function was changed not to signal `void-function' any more.
+*** As a consequence, the second arg of `indirect-function' is now obsolete.
+
** Comint, term, and compile do not set the EMACS env var any more.
Use the INSIDE_EMACS environment variable instead.
diff --git a/lisp/term/screen.el b/lisp/term/screen.el
index 3587c4f..41fd916 100644
--- a/lisp/term/screen.el
+++ b/lisp/term/screen.el
@@ -1,9 +1,22 @@
;;; screen.el --- terminal initialization for screen and tmux -*-
lexical-binding: t -*-
;; Copyright (C) 1995, 2001-2015 Free Software Foundation, Inc.
+(require 'term/xterm)
+
+(defcustom xterm-screen-extra-capabilities '(modifyOtherKeys)
+ "Extra capabilities supported under \"screen\".
+Some features of screen depend on the terminal emulator in which
+it runs, which can change when the screen session is moved to another tty."
+ :type xterm--extra-capabilities-type
+ :group 'xterm)
+
(defun terminal-init-screen ()
"Terminal initialization function for screen."
- ;; Treat a screen terminal similar to an xterm.
- (tty-run-terminal-initialization (selected-frame) "xterm"))
+ ;; Treat a screen terminal similar to an xterm, but don't use
+ ;; xterm-extra-capabilities's `check' setting since that doesn't seem
+ ;; to work so well (it depends too much on the surrounding terminal
+ ;; emulator, which can change during the session, bug#20356).
+ (let ((xterm-extra-capabilities xterm-screen-extra-capabilities))
+ (tty-run-terminal-initialization (selected-frame) "xterm")))
;; screen.el ends here
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el
index 726ecf9..79699c6 100644
--- a/lisp/term/xterm.el
+++ b/lisp/term/xterm.el
@@ -29,6 +29,13 @@
:version "24.1"
:group 'terminals)
+(defconst xterm--extra-capabilities-type
+ ;; NOTE: If you add entries here, make sure to update
+ ;; `terminal-init-xterm' as well.
+ '(set (const :tag "modifyOtherKeys support" modifyOtherKeys)
+ (const :tag "report background" reportBackground)
+ (const :tag "set X selection" setSelection)))
+
(defcustom xterm-extra-capabilities 'check
"Whether Xterm supports some additional, more modern, features.
If nil, just assume that it does not.
@@ -40,13 +47,8 @@ The relevant features are:
reportBackground -- if supported, Xterm reports its background color
setSelection -- if supported, Xterm saves yanked text to the X selection"
:version "24.1"
- :type '(choice (const :tag "No" nil)
- (const :tag "Check" check)
- ;; NOTE: If you add entries here, make sure to update
- ;; `terminal-init-xterm' as well.
- (set (const :tag "modifyOtherKeys support" modifyOtherKeys)
- (const :tag "report background" reportBackground)
- (const :tag "set X selection" setSelection))))
+ :type `(choice (const :tag "Check" check)
+ ,xterm--extra-capabilities-type))
(defcustom xterm-max-cut-length 100000
"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."
(setq version 200))
(when (equal (match-string 1 str) "83")
;; `screen' (which returns 83;40003;0) seems to also lack support for
- ;; some of these (bug#17607).
- (setq version 240))
+ ;; some of these (bug#17607, bug#20356).
+ ;; Note: this code path should normally not be used any more
+ ;; since term/screen.el now binds xterm-extra-capabilities
+ ;; to a fixed value, rather than using the dynamic checking.
+ (setq version 200))
;; If version is 242 or higher, assume the xterm supports
;; reporting the background color (TODO: maybe earlier
;; versions do too...)
@@ -925,6 +930,6 @@ versions of xterm."
(set-terminal-parameter nil 'background-mode 'dark)
t))
-(provide 'xterm)
-
+(provide 'xterm) ;Backward compatibility.
+(provide 'term/xterm)
;;; xterm.el ends here
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 4183482: * lisp/term/screen.el (xterm-screen-extra-capabilities): New custom,
Stefan Monnier <=