diff options
| author | Daniel Colascione | 2014-04-17 00:54:23 -0700 |
|---|---|---|
| committer | Daniel Colascione | 2014-04-17 00:54:23 -0700 |
| commit | bfc30790686607fac1b7667d3a73d0f46b80e85f (patch) | |
| tree | d492a6b10405b75ad5341d1e5509b86ad09e75f8 /src/term.c | |
| parent | a3f989d4c430f4788352b2bad801ba99ccf2bb21 (diff) | |
| download | emacs-bfc30790686607fac1b7667d3a73d0f46b80e85f.tar.gz emacs-bfc30790686607fac1b7667d3a73d0f46b80e85f.zip | |
2014-04-17 Daniel Colascione <dancol@dancol.org>
Add support for bracketed paste mode; add infrastructure for
managing terminal mode enabling and disabling automatically.
* xt-mouse.el:
(xterm-mouse-mode): Simplify.
(xterm-mouse-tracking-enable-sequence)
(xterm-mouse-tracking-disable-sequence): New constants.
(turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal): Use
tty-mode-set-strings and tty-mode-reset-strings terminal
parameters instead of random hooks.
(turn-on-xterm-mouse-tracking)
(turn-off-xterm-mouse-tracking): Delete.
* term/xterm.el (xterm-extra-capabilities): Fix bitrotted comment.
(xterm-paste-ending-sequence): New constant.
(xterm-paste): New command used for bracketed paste support.
(xterm-modify-other-keys-terminal-list): Delete obsolete variable.
(terminal-init-xterm-bracketed-paste-mode): New function.
(terminal-init-xterm): Call it.
(terminal-init-xterm-modify-other-keys): Use tty-mode-set-strings
and tty-mode-reset-strings instead of random hooks.
(xterm-turn-on-modify-other-keys)
(xterm-turn-off-modify-other-keys)
(xterm-remove-modify-other-keys): Delete obsolete functions.
* term/screen.el: Rewrite to just use the xterm code. Add
copyright notice. Mention tmux.
Diffstat (limited to 'src/term.c')
| -rw-r--r-- | src/term.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/term.c b/src/term.c index 47be788f31a..9d9d682a544 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -131,6 +131,9 @@ enum no_color_bit | |||
| 131 | 131 | ||
| 132 | static int max_frame_cols; | 132 | static int max_frame_cols; |
| 133 | 133 | ||
| 134 | static Lisp_Object Qtty_mode_set_strings; | ||
| 135 | static Lisp_Object Qtty_mode_reset_strings; | ||
| 136 | |||
| 134 | 137 | ||
| 135 | 138 | ||
| 136 | #ifdef HAVE_GPM | 139 | #ifdef HAVE_GPM |
| @@ -162,6 +165,29 @@ tty_ring_bell (struct frame *f) | |||
| 162 | /* Set up termcap modes for Emacs. */ | 165 | /* Set up termcap modes for Emacs. */ |
| 163 | 166 | ||
| 164 | static void | 167 | static void |
| 168 | tty_send_additional_strings (struct terminal* terminal, Lisp_Object sym) | ||
| 169 | { | ||
| 170 | Lisp_Object lisp_terminal; | ||
| 171 | Lisp_Object extra_codes; | ||
| 172 | struct tty_display_info *tty = terminal->display_info.tty; | ||
| 173 | |||
| 174 | XSETTERMINAL (lisp_terminal, terminal); | ||
| 175 | for (extra_codes = Fterminal_parameter (lisp_terminal, sym); | ||
| 176 | CONSP (extra_codes); | ||
| 177 | extra_codes = XCDR (extra_codes)) | ||
| 178 | { | ||
| 179 | Lisp_Object string = XCAR (extra_codes); | ||
| 180 | if (STRINGP (string)) | ||
| 181 | { | ||
| 182 | fwrite (SDATA (string), 1, SBYTES (string), tty->output); | ||
| 183 | fflush (tty->output); | ||
| 184 | if (tty->termscript) | ||
| 185 | fwrite (SDATA (string), 1, SBYTES (string), tty->termscript); | ||
| 186 | } | ||
| 187 | } | ||
| 188 | } | ||
| 189 | |||
| 190 | static void | ||
| 165 | tty_set_terminal_modes (struct terminal *terminal) | 191 | tty_set_terminal_modes (struct terminal *terminal) |
| 166 | { | 192 | { |
| 167 | struct tty_display_info *tty = terminal->display_info.tty; | 193 | struct tty_display_info *tty = terminal->display_info.tty; |
| @@ -184,6 +210,7 @@ tty_set_terminal_modes (struct terminal *terminal) | |||
| 184 | OUTPUT_IF (tty, tty->TS_keypad_mode); | 210 | OUTPUT_IF (tty, tty->TS_keypad_mode); |
| 185 | losecursor (tty); | 211 | losecursor (tty); |
| 186 | fflush (tty->output); | 212 | fflush (tty->output); |
| 213 | tty_send_additional_strings (terminal, Qtty_mode_set_strings); | ||
| 187 | } | 214 | } |
| 188 | } | 215 | } |
| 189 | 216 | ||
| @@ -196,6 +223,7 @@ tty_reset_terminal_modes (struct terminal *terminal) | |||
| 196 | 223 | ||
| 197 | if (tty->output) | 224 | if (tty->output) |
| 198 | { | 225 | { |
| 226 | tty_send_additional_strings (terminal, Qtty_mode_reset_strings); | ||
| 199 | tty_turn_off_highlight (tty); | 227 | tty_turn_off_highlight (tty); |
| 200 | tty_turn_off_insert (tty); | 228 | tty_turn_off_insert (tty); |
| 201 | OUTPUT_IF (tty, tty->TS_end_keypad_mode); | 229 | OUTPUT_IF (tty, tty->TS_end_keypad_mode); |
| @@ -4562,6 +4590,9 @@ bigger, or it may make it blink, or it may do nothing at all. */); | |||
| 4562 | encode_terminal_src = NULL; | 4590 | encode_terminal_src = NULL; |
| 4563 | encode_terminal_dst = NULL; | 4591 | encode_terminal_dst = NULL; |
| 4564 | 4592 | ||
| 4593 | DEFSYM (Qtty_mode_set_strings, "tty-mode-set-strings"); | ||
| 4594 | DEFSYM (Qtty_mode_reset_strings, "tty-mode-reset-strings"); | ||
| 4595 | |||
| 4565 | #ifndef MSDOS | 4596 | #ifndef MSDOS |
| 4566 | DEFSYM (Qtty_menu_next_item, "tty-menu-next-item"); | 4597 | DEFSYM (Qtty_menu_next_item, "tty-menu-next-item"); |
| 4567 | DEFSYM (Qtty_menu_prev_item, "tty-menu-prev-item"); | 4598 | DEFSYM (Qtty_menu_prev_item, "tty-menu-prev-item"); |