diff options
| author | Dan Nicolaescu | 2007-09-02 18:22:41 +0000 |
|---|---|---|
| committer | Dan Nicolaescu | 2007-09-02 18:22:41 +0000 |
| commit | 13af5af5bbb69cd40386218f597a2cc5bc6af413 (patch) | |
| tree | c18f3b26d46521566f4c5021baffca2102cf9843 | |
| parent | 0729e1c4e17d8da5ffb4237288d3bf26e34d0350 (diff) | |
| download | emacs-13af5af5bbb69cd40386218f597a2cc5bc6af413.tar.gz emacs-13af5af5bbb69cd40386218f597a2cc5bc6af413.zip | |
(xterm-modify-other-keys-terminal-list): New
variable.
(xterm-turn-on-modify-other-keys): Only turn on modify-other-keys
if the selected frames is in
xterm-modify-other-keys-terminal-list.
(xterm-turn-off-modify-other-keys): Add an optional frame
parameter. Only turn off modify-other-keys if FRAME is in
xterm-modify-other-keys-terminal-list.
(xterm-remove-modify-other-keys): New function.
(terminal-init-xterm): Use it. Deal with delete-frame hook. Add
the selected frame to xterm-modify-other-keys-terminal-list.
| -rw-r--r-- | lisp/ChangeLog | 14 | ||||
| -rw-r--r-- | lisp/term/xterm.el | 32 |
2 files changed, 42 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f69b4fa6ae9..14dddab6752 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,17 @@ | |||
| 1 | 2007-09-02 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 2 | |||
| 3 | * term/xterm.el (xterm-modify-other-keys-terminal-list): New | ||
| 4 | variable. | ||
| 5 | (xterm-turn-on-modify-other-keys): Only turn on modify-other-keys | ||
| 6 | if the selected frames is in | ||
| 7 | xterm-modify-other-keys-terminal-list. | ||
| 8 | (xterm-turn-off-modify-other-keys): Add an optional frame | ||
| 9 | parameter. Only turn off modify-other-keys if FRAME is in | ||
| 10 | xterm-modify-other-keys-terminal-list. | ||
| 11 | (xterm-remove-modify-other-keys): New function. | ||
| 12 | (terminal-init-xterm): Use it. Deal with delete-frame hook. Add | ||
| 13 | the selected frame to xterm-modify-other-keys-terminal-list. | ||
| 14 | |||
| 1 | 2007-09-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | 15 | 2007-09-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> |
| 2 | 16 | ||
| 3 | * term/x-win.el (x-gtk-stock-map): Map diropen to system-file-manager. | 17 | * term/x-win.el (x-gtk-stock-map): Map diropen to system-file-manager. |
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el index 22f83f2f96d..5b4bd05c542 100644 --- a/lisp/term/xterm.el +++ b/lisp/term/xterm.el | |||
| @@ -322,6 +322,9 @@ | |||
| 322 | (define-key xterm-function-map "\e[13~" [f3]) | 322 | (define-key xterm-function-map "\e[13~" [f3]) |
| 323 | (define-key xterm-function-map "\e[14~" [f4]) | 323 | (define-key xterm-function-map "\e[14~" [f4]) |
| 324 | 324 | ||
| 325 | ;; List of terminals for which modify-other-keys has been turned on. | ||
| 326 | (defvar xterm-modify-other-keys-terminal-list nil) | ||
| 327 | |||
| 325 | (defun terminal-init-xterm () | 328 | (defun terminal-init-xterm () |
| 326 | "Terminal initialization function for xterm." | 329 | "Terminal initialization function for xterm." |
| 327 | ;; rxvt terminals sometimes set the TERM variable to "xterm", but | 330 | ;; rxvt terminals sometimes set the TERM variable to "xterm", but |
| @@ -430,7 +433,12 @@ | |||
| 430 | ;; suspending, resuming and exiting. | 433 | ;; suspending, resuming and exiting. |
| 431 | (add-hook 'suspend-hook 'xterm-turn-off-modify-other-keys) | 434 | (add-hook 'suspend-hook 'xterm-turn-off-modify-other-keys) |
| 432 | (add-hook 'suspend-resume-hook 'xterm-turn-on-modify-other-keys) | 435 | (add-hook 'suspend-resume-hook 'xterm-turn-on-modify-other-keys) |
| 433 | (add-hook 'kill-emacs-hook 'xterm-turn-off-modify-other-keys) | 436 | (add-hook 'kill-emacs-hook 'xterm-remove-modify-other-keys) |
| 437 | (add-hook 'delete-frame-hook 'xterm-remove-modify-other-keys) | ||
| 438 | ;; Add the selected frame to the list of frames that | ||
| 439 | ;; need to deal with modify-other-keys. | ||
| 440 | (push (frame-terminal (selected-frame)) | ||
| 441 | xterm-modify-other-keys-terminal-list) | ||
| 434 | (xterm-turn-on-modify-other-keys))))))) | 442 | (xterm-turn-on-modify-other-keys))))))) |
| 435 | 443 | ||
| 436 | ;; Set up colors, for those versions of xterm that support it. | 444 | ;; Set up colors, for those versions of xterm that support it. |
| @@ -551,11 +559,27 @@ versions of xterm." | |||
| 551 | 559 | ||
| 552 | (defun xterm-turn-on-modify-other-keys () | 560 | (defun xterm-turn-on-modify-other-keys () |
| 553 | "Turn on the modifyOtherKeys feature of xterm." | 561 | "Turn on the modifyOtherKeys feature of xterm." |
| 554 | (send-string-to-terminal "\e[>4;1m")) | 562 | (let ((frame (selected-frame))) |
| 563 | (when (and (frame-live-p frame) | ||
| 564 | (memq frame xterm-modify-other-keys-terminal-list)) | ||
| 565 | (send-string-to-terminal "\e[>4;1m")))) | ||
| 555 | 566 | ||
| 556 | (defun xterm-turn-off-modify-other-keys () | 567 | (defun xterm-turn-off-modify-other-keys (&optional frame) |
| 557 | "Turn off the modifyOtherKeys feature of xterm." | 568 | "Turn off the modifyOtherKeys feature of xterm." |
| 558 | (send-string-to-terminal "\e[>4m")) | 569 | (setq frame (and frame (selected-frame))) |
| 570 | (when (and (frame-live-p frame) | ||
| 571 | (memq frame xterm-modify-other-keys-terminal-list)) | ||
| 572 | (send-string-to-terminal "\e[>4m"))) | ||
| 573 | |||
| 574 | (defun xterm-remove-modify-other-keys (&optional frame) | ||
| 575 | "Turn off the modifyOtherKeys feature of xterm and remove frame from consideration." | ||
| 576 | (setq frame (and frame (selected-frame))) | ||
| 577 | (when (and (frame-live-p frame) | ||
| 578 | (memq frame xterm-modify-other-keys-terminal-list)) | ||
| 579 | (setq xterm-modify-other-keys-terminal-list | ||
| 580 | (delq (frame-terminal frame) | ||
| 581 | xterm-modify-other-keys-terminal-list)) | ||
| 582 | (send-string-to-terminal "\e[>4m"))) | ||
| 559 | 583 | ||
| 560 | ;; arch-tag: 12e7ebdd-1e6c-4b25-b0f9-35ace25e855a | 584 | ;; arch-tag: 12e7ebdd-1e6c-4b25-b0f9-35ace25e855a |
| 561 | ;;; xterm.el ends here | 585 | ;;; xterm.el ends here |