mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-31 09:20:54 -08:00
* woman.el, winner.el, vc/vc-rcs.el, vc/vc-hooks.el, vc/vc-hg.el: * vc/vc-git.el, vc/vc-dir.el, vc/vc-bzr.el, vc/vc-annotate.el: * textmodes/tex-mode.el, textmodes/sgml-mode.el, tar-mode.el: * strokes.el, ses.el, server.el, progmodes/js.el, progmodes/gdb-mi.el: * progmodes/flymake.el, progmodes/ebrowse.el, progmodes/compile.el: * play/tetris.el, play/snake.el, play/pong.el, play/landmark.el: * play/hanoi.el, play/decipher.el, play/5x5.el, nxml/nxml-mode.el: * net/secrets.el, net/quickurl.el, midnight.el, mail/footnote.el: * image-dired.el, ibuffer.el, ibuf-macs.el, ibuf-ext.el, hexl.el: * eshell/eshell.el, eshell/esh-io.el, eshell/esh-ext.el: * eshell/esh-cmd.el, eshell/em-ls.el, eshell/em-hist.el: * eshell/em-cmpl.el, eshell/em-banner.el: * url/url.el, url/url-queue.el, url/url-parse.el, url/url-http.el: * url/url-future.el, url/url-dav.el, url/url-cookie.el: * calendar/parse-time.el, test/eshell.el: Use cl-lib. * wid-browse.el, wdired.el, vc/vc.el, vc/vc-mtn.el, vc/vc-cvs.el: * vc/vc-arch.el, tree-widget.el, textmodes/texinfo.el: * textmodes/refill.el, textmodes/css-mode.el, term/tvi970.el: * term/ns-win.el, term.el, shell.el, ps-samp.el: * progmodes/perl-mode.el, progmodes/pascal.el, progmodes/gud.el: * progmodes/glasses.el, progmodes/etags.el, progmodes/cwarn.el: * play/gamegrid.el, play/bubbles.el, novice.el, notifications.el: * net/zeroconf.el, net/xesam.el, net/snmp-mode.el, net/mairix.el: * net/ldap.el, net/eudc.el, net/browse-url.el, man.el: * mail/mailheader.el, mail/feedmail.el: * url/url-util.el, url/url-privacy.el, url/url-nfs.el, url/url-misc.el: * url/url-methods.el, url/url-gw.el, url/url-file.el, url/url-expand.el: Dont use CL. * ibuf-ext.el (ibuffer-mark-old-buffers): Use float-time. * eshell/esh-opt.el (eshell-eval-using-options): Quote code with `lambda' rather than with `quote'. (eshell-do-opt): Adjust accordingly. (eshell-process-option): Simplify. * eshell/esh-var.el: * eshell/em-script.el: Require `esh-opt' for eshell-eval-using-options. * emacs-pcase.el (pcase--dontcare-upats, pcase--let*) (pcase--expand, pcase--u1): Rename pcase's internal `dontcare' pattern to `pcase--dontcare'. * emacs-cl.el (labels): Mark obsolete. (cl--letf, letf): Move to cl-lib. (cl--letf*, letf*): Remove. * emacs-cl-lib.el (cl-nth-value): Use defalias. * emacs-cl-macs.el (cl-dolist, cl-dotimes): Add indent rule. (cl-progv): Rewrite. (cl--letf, cl-letf): Move from cl.el. (cl-letf*): New macro. * emacs-cl-extra.el (cl--progv-before, cl--progv-after): Remove.
120 lines
4.6 KiB
EmacsLisp
120 lines
4.6 KiB
EmacsLisp
;;; tvi970.el --- terminal support for the Televideo 970
|
||
|
||
;; Copyright (C) 1992, 2001-2012 Free Software Foundation, Inc.
|
||
|
||
;; Author: Jim Blandy <jimb@occs.cs.oberlin.edu>
|
||
;; Keywords: terminals
|
||
;; Created: January 1992
|
||
|
||
;; This file is part of GNU Emacs.
|
||
|
||
;; GNU Emacs is free software: you can redistribute it and/or modify
|
||
;; it under the terms of the GNU General Public License as published by
|
||
;; the Free Software Foundation, either version 3 of the License, or
|
||
;; (at your option) any later version.
|
||
|
||
;; GNU Emacs is distributed in the hope that it will be useful,
|
||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
;; GNU General Public License for more details.
|
||
|
||
;; You should have received a copy of the GNU General Public License
|
||
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
|
||
|
||
;;; Commentary:
|
||
|
||
;; Uses the Emacs 19 terminal initialization features --- won't work with 18.
|
||
|
||
;;; Code:
|
||
|
||
(defvar tvi970-terminal-map
|
||
(let ((map (make-sparse-keymap)))
|
||
|
||
;; Miscellaneous keys
|
||
(dolist (key-binding
|
||
'(;; These are set up by termcap or terminfo
|
||
;; ("\eOP" [kp-f1])
|
||
;; ("\eOQ" [kp-f2])
|
||
;; ("\eOR" [kp-f3])
|
||
;; ("\eOS" [kp-f4])
|
||
|
||
;; These might bre set by terminfo.
|
||
("\e[H" [home])
|
||
("\e[Z" [backtab])
|
||
("\e[i" [print])
|
||
("\e[@" [insert])
|
||
("\e[L" [insertline])
|
||
("\e[M" [deleteline])
|
||
("\e[U" [next]) ;; actually the `page' key
|
||
|
||
;; These won't be set up by either
|
||
("\eOm" [kp-subtract])
|
||
("\eOl" [kp-separator])
|
||
("\eOn" [kp-decimal])
|
||
("\eOM" [kp-enter])
|
||
|
||
;; These won't be set up by either either
|
||
("\e[K" [key_eol]) ;; Not an X keysym
|
||
("\e[J" [key_eos]) ;; Not an X keysym
|
||
("\e[2J" [key_clear]) ;; Not an X keysym
|
||
("\e[P" [key_dc]) ;; Not an X keysym
|
||
("\e[g" [S-tab]) ;; Not an X keysym
|
||
("\e[2N" [clearentry]) ;; Not an X keysym
|
||
("\e[2K" [S-clearentry]) ;; Not an X keysym
|
||
("\e[E" [?\C-j]) ;; Not an X keysym
|
||
("\e[g" [S-backtab]) ;; Not an X keysym
|
||
("\e[?1i" [key_sprint]) ;; Not an X keysym
|
||
("\e[4h" [key_sic]) ;; Not an X keysym
|
||
("\e[4l" [S-delete]) ;; Not an X keysym
|
||
("\e[Q" [S-insertline]) ;; Not an X keysym
|
||
("\e[1Q" [key_sdl]) ;; Not an X keysym
|
||
("\e[19l" [key_seol]) ;; Not an X keysym
|
||
("\e[19h" [S-erasepage]) ;; Not an X keysym
|
||
("\e[V" [S-page]) ;; Not an X keysym
|
||
("\eS" [send]) ;; Not an X keysym
|
||
("\e5" [S-send]) ;; Not an X keysym
|
||
))
|
||
(define-key map (car key-binding) (nth 1 key-binding)))
|
||
|
||
|
||
;; The numeric keypad keys.
|
||
(dotimes (i 10)
|
||
(define-key map (format "\eO%c" (+ i ?p))
|
||
(vector (intern (format "kp-%d" i)))))
|
||
;; The numbered function keys.
|
||
(dotimes (i 16)
|
||
(define-key map (format "\e?%c" (+ i ?a))
|
||
(vector (intern (format "f%d" (1+ i)))))
|
||
(define-key map (format "\e?%c" (+ i ?A))
|
||
(vector (intern (format "S-f%d" (1+ i))))))
|
||
map))
|
||
|
||
(defun terminal-init-tvi970 ()
|
||
"Terminal initialization function for tvi970."
|
||
;; Use inheritance to let the main keymap override these defaults.
|
||
;; This way we don't override terminfo-derived settings or settings
|
||
;; made in the .emacs file.
|
||
(let ((m (copy-keymap tvi970-terminal-map)))
|
||
(set-keymap-parent m (keymap-parent input-decode-map))
|
||
(set-keymap-parent input-decode-map m))
|
||
(tvi970-set-keypad-mode 1))
|
||
|
||
|
||
;; Should keypad numbers send ordinary digits or distinct escape sequences?
|
||
(define-minor-mode tvi970-set-keypad-mode
|
||
"Toggle alternate keypad mode on TVI 970 keypad.
|
||
With a prefix argument ARG, enable the mode if ARG is positive,
|
||
and disable it otherwise. If called from Lisp, enable the mode
|
||
if ARG is omitted or nil.
|
||
|
||
In ``alternate keypad mode'', the keys send distinct escape
|
||
sequences, meaning that they can have their own bindings,
|
||
independent of the normal number keys.
|
||
|
||
When disabled, the terminal enters ``numeric keypad mode'', in
|
||
which the keypad's keys act as ordinary digits."
|
||
:variable (terminal-parameter nil 'tvi970-keypad-numeric)
|
||
(send-string-to-terminal
|
||
(if (terminal-parameter nil 'tvi970-keypad-numeric) "\e=" "\e>")))
|
||
|
||
;;; tvi970.el ends here
|