summaryrefslogtreecommitdiff
path: root/lisp/term
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/term')
-rw-r--r--lisp/term/konsole.el2
-rw-r--r--lisp/term/linux.el7
-rw-r--r--lisp/term/lk201.el2
-rw-r--r--lisp/term/pc-win.el2
-rw-r--r--lisp/term/screen.el2
-rw-r--r--lisp/term/st.el13
-rw-r--r--lisp/term/tmux.el2
-rw-r--r--lisp/term/w32-win.el8
-rw-r--r--lisp/term/w32console.el2
-rw-r--r--lisp/term/x-win.el2
-rw-r--r--lisp/term/xterm.el32
11 files changed, 50 insertions, 24 deletions
diff --git a/lisp/term/konsole.el b/lisp/term/konsole.el
index e38a5d34e75..1f65a46011c 100644
--- a/lisp/term/konsole.el
+++ b/lisp/term/konsole.el
@@ -9,4 +9,4 @@
(provide 'term/konsole)
-;; konsole.el ends here
+;;; konsole.el ends here
diff --git a/lisp/term/linux.el b/lisp/term/linux.el
index 35bd3ac0acb..6d43e477ac9 100644
--- a/lisp/term/linux.el
+++ b/lisp/term/linux.el
@@ -1,4 +1,6 @@
-;; The Linux console handles Latin-1 by default. -*- lexical-binding:t -*-
+;;; linux.el -*- lexical-binding:t -*-
+
+;; The Linux console handles Latin-1 by default.
(declare-function gpm-mouse-enable "t-mouse" ())
@@ -10,6 +12,9 @@
;; It can't really display underlines.
(tty-no-underline)
+ ;; Compositions confuse cursor movement.
+ (setq-default auto-composition-mode "linux")
+
(ignore-errors (when gpm-mouse-mode (require 't-mouse) (gpm-mouse-enable)))
;; Make Latin-1 input characters work, too.
diff --git a/lisp/term/lk201.el b/lisp/term/lk201.el
index 3bcaa2ecd18..c2802477670 100644
--- a/lisp/term/lk201.el
+++ b/lisp/term/lk201.el
@@ -1,4 +1,4 @@
-;; Define function key sequences for DEC terminals. -*- lexical-binding: t -*-
+;;; lk201.el --- Define function key sequences for DEC terminals. -*- lexical-binding: t -*-
(defvar lk201-function-map
(let ((map (make-sparse-keymap)))
diff --git a/lisp/term/pc-win.el b/lisp/term/pc-win.el
index 8cff2ceaeec..9e7b360b9c6 100644
--- a/lisp/term/pc-win.el
+++ b/lisp/term/pc-win.el
@@ -290,7 +290,7 @@ This is used by `msdos-show-help'.")
(not cursor-in-echo-area)) ;Don't overwrite a prompt.
(cond
((stringp help)
- (setq help (replace-regexp-in-string "\n" ", " help))
+ (setq help (string-replace "\n" ", " help))
(unless (or msdos-previous-message
(string-equal help (current-message))
(and (stringp msdos-last-help-message)
diff --git a/lisp/term/screen.el b/lisp/term/screen.el
index 04481e8358b..9655f41b6c1 100644
--- a/lisp/term/screen.el
+++ b/lisp/term/screen.el
@@ -22,4 +22,4 @@ it runs, which can change when the screen session is moved to another tty."
(provide 'term/screen)
-;; screen.el ends here
+;;; screen.el ends here
diff --git a/lisp/term/st.el b/lisp/term/st.el
index 08432c414af..f1cbad6d59f 100644
--- a/lisp/term/st.el
+++ b/lisp/term/st.el
@@ -11,10 +11,19 @@
(require 'term/xterm)
+(defcustom xterm-st-extra-capabilities '( modifyOtherKeys getSelection
+ setSelection)
+ "Extra capabilities supported under \"stterm\"."
+ :version "28.1"
+ :type xterm--extra-capabilities-type
+ :group 'xterm)
+
(defun terminal-init-st ()
"Terminal initialization function for st."
- (tty-run-terminal-initialization (selected-frame) "xterm"))
+ ;; Using `check' leads to a two-second timeout.
+ (let ((xterm-extra-capabilities xterm-st-extra-capabilities))
+ (tty-run-terminal-initialization (selected-frame) "xterm")))
(provide 'term/st)
-;; st.el ends here
+;;; st.el ends here
diff --git a/lisp/term/tmux.el b/lisp/term/tmux.el
index aa0c98364f3..4ea6f416c8c 100644
--- a/lisp/term/tmux.el
+++ b/lisp/term/tmux.el
@@ -22,4 +22,4 @@ it runs, which can change when the tmux session is moved to another tty."
(provide 'term/tmux)
-;; tmux.el ends here
+;;; tmux.el ends here
diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el
index e8451930133..80afcb36040 100644
--- a/lisp/term/w32-win.el
+++ b/lisp/term/w32-win.el
@@ -284,7 +284,8 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
'(libxml2 "libxml2-2.dll" "libxml2.dll")
'(zlib "zlib1.dll" "libz-1.dll")
'(lcms2 "liblcms2-2.dll")
- '(json "libjansson-4.dll")))
+ '(json "libjansson-4.dll")
+ '(gccjit "libgccjit-0.dll")))
;;; multi-tty support
(defvar w32-initialized nil
@@ -409,7 +410,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
;;; Fix interface to (X-specific) mouse.el
(defun w32--set-selection (type value)
(if (eq type 'CLIPBOARD)
- (w32-set-clipboard-data (replace-regexp-in-string "\0" "\\0" value t t))
+ (w32-set-clipboard-data (string-replace "\0" "\\0" value))
(put 'x-selections (or type 'PRIMARY) value)))
(defun w32--get-selection (&optional type data-type)
@@ -555,6 +556,9 @@ be found in this alist.
This alist is used by w32font.c when it looks for fonts that can display
characters from scripts for which no USBs are defined.")
+(declare-function x-list-fonts "xfaces.c"
+ (pattern &optional face frame maximum width))
+
(defun w32-find-non-USB-fonts (&optional frame size)
"Compute the value of `w32-non-USB-fonts' for specified SIZE and FRAME.
FRAME defaults to the selected frame.
diff --git a/lisp/term/w32console.el b/lisp/term/w32console.el
index 4a925cd84c3..1a5dc05783e 100644
--- a/lisp/term/w32console.el
+++ b/lisp/term/w32console.el
@@ -1,4 +1,4 @@
-;;; w32console.el -- Setup w32 console keys and colors. -*- lexical-binding: t; -*-
+;;; w32console.el --- Setup w32 console keys and colors. -*- lexical-binding: t; -*-
;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el
index e4521ff1876..8c6c75e7e22 100644
--- a/lisp/term/x-win.el
+++ b/lisp/term/x-win.el
@@ -1355,7 +1355,7 @@ This returns an error if any Emacs frames are X frames."
(declare-function x-get-selection-internal "xselect.c"
(selection-symbol target-type &optional time-stamp terminal))
-(add-to-list 'display-format-alist '("\\`[^:]*:[0-9]+\\(\\.[0-9]+\\)?\\'" . x))
+(add-to-list 'display-format-alist '("\\`.*:[0-9]+\\(\\.[0-9]+\\)?\\'" . x))
(cl-defmethod handle-args-function (args &context (window-system x))
(x-handle-args args))
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el
index eeaf805930b..e63bf36cc3d 100644
--- a/lisp/term/xterm.el
+++ b/lisp/term/xterm.el
@@ -770,8 +770,7 @@ Can be nil to mean \"no timeout\".")
By not redisplaying right away for xterm queries, we can avoid
unsightly flashing during initialization. Give up and redisplay
anyway if we've been waiting a little while."
- (let ((start-time (current-time))
- (inhibit--record-char t))
+ (let ((start-time (current-time)))
(or (let ((inhibit-redisplay t))
(read-event nil nil xterm-query-redisplay-timeout))
(read-event nil nil
@@ -839,8 +838,8 @@ We run the first FUNCTION whose STRING matches the input events."
basemap
(make-composed-keymap map (keymap-parent basemap))))
-(defun terminal-init-xterm ()
- "Terminal initialization function for xterm."
+(defun xterm--init ()
+ "Initialize the terminal for xterm."
;; rxvt terminals sometimes set the TERM variable to "xterm", but
;; rxvt's keybindings are incompatible with xterm's. It is
;; better in that case to use rxvt's initialization function.
@@ -882,9 +881,18 @@ We run the first FUNCTION whose STRING matches the input events."
;; support it just ignore the sequence.
(xterm--init-bracketed-paste-mode)
;; We likewise unconditionally enable support for focus tracking.
- (xterm--init-focus-tracking)
+ (xterm--init-focus-tracking))
- (run-hooks 'terminal-init-xterm-hook))
+(defun terminal-init-xterm ()
+ "Terminal initialization function for xterm."
+ (unwind-protect
+ (progn
+ (xterm--init)
+ ;; If the terminal initialization completed without errors, clear
+ ;; the lossage to discard the responses of the terminal emulator
+ ;; during initialization; otherwise they appear in the recent keys.
+ (clear-this-command-keys))
+ (run-hooks 'terminal-init-xterm-hook)))
(defun xterm--init-modify-other-keys ()
"Terminal initialization for xterm's modifyOtherKeys support."
@@ -936,9 +944,10 @@ See `xterm--init-frame-title'"
(defun xterm-set-window-title (&optional terminal)
"Set the window title of the Xterm TERMINAL.
The title is constructed from `frame-title-format'."
- (send-string-to-terminal
- (format "\e]2;%s\a" (format-mode-line frame-title-format))
- terminal))
+ (unless (display-graphic-p terminal)
+ (send-string-to-terminal
+ (format "\e]2;%s\a" (format-mode-line frame-title-format))
+ terminal)))
(defun xterm--selection-char (type)
(pcase type
@@ -1007,10 +1016,9 @@ hitting screen's max DCS length."
'terminal-init-screen))
(bytes (encode-coding-string data 'utf-8-unix))
(base-64 (if screen
- (replace-regexp-in-string
+ (string-replace
"\n" "\e\\\eP"
- (base64-encode-string bytes)
- :fixedcase :literal)
+ (base64-encode-string bytes))
(base64-encode-string bytes :no-line-break)))
(length (length base-64)))
(if (> length xterm-max-cut-length)