comparison device-type-hacking.el @ 57:0d4e2fbdb6aa

adopt
author Henry S Thompson <ht@inf.ed.ac.uk>
date Sat, 02 Mar 2024 21:40:24 +0000
parents shared/device-type-hacking.el@107d592c5f4a
children
comparison
equal deleted inserted replaced
56:3dd34fa466c2 57:0d4e2fbdb6aa
1
2
3 (defconst device-type-hacking-id "$Id: device-type-hacking.el,v 1.1 1996/07/25 22:17:36 rjc Exp $")
4
5 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6 ;; ;;
7 ;; Changes some values depending on device type ttys. have ;;
8 ;; control-h being delete and zmacs-regions turned off. ;;
9 ;; ;;
10 ;; Since select-frame-hook doesn't seem to be called for tty ;;
11 ;; devices, we have to cheat and set the tty defaults whenever a ;;
12 ;; frame is deselected. ;;
13 ;; ;;
14 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
15
16 (defvar zmacs-regions-specifier
17 (make-specifier-and-init 'boolean
18 '( (global ((tty). nil) ((x) . t)) )
19 ))
20
21
22 (defun device-type-tty-selected ()
23
24 (define-key global-map '(control h) 'backward-delete-char-untabify)
25 )
26
27 (defun device-type-x-selected ()
28
29 (define-key global-map '(control h) 'help)
30 )
31
32 (defun device-type-select-frame-hook ()
33
34 (setq zmacs-regions
35 (specifier-instance zmacs-regions-specifier)
36 )
37
38 (if (equal (device-type (selected-device)) "tty")
39 (device-type-tty-selected)
40 (device-type-x-selected)
41 )
42
43 )
44
45 (defun device-type-deselect-frame-hook ()
46
47 (setq zmacs-regions
48 (not (specifier-instance zmacs-regions-specifier))
49 )
50
51 (device-type-tty-selected)
52
53 )
54
55 (setq deselect-frame-hook '(default-deselect-frame-hook))
56 (setq select-frame-hook '(default-select-frame-hook))
57
58
59 (add-hook 'select-frame-hook (function device-type-select-frame-hook))
60 (add-hook 'deselect-frame-hook (function device-type-deselect-frame-hook) t)
61
62
63