changeset 38475:916f157c7118

(ignore-key, sun-esc-bracket, meta-flag): Remove. (sun-raw-prefix): Replace t3, t4, t6, and t7 with f3, f4, f6 and f7. Complete bindings for F<1..12> keys. (global-map): Remove `undo' binding (already in the default). Replace `t<n>' bindings with `f<n>' bindings.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 17 Jul 2001 18:37:47 +0000
parents 86bc182c8651
children 87a409912f22
files lisp/term/sun.el
diffstat 1 files changed, 85 insertions(+), 88 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/term/sun.el	Tue Jul 17 16:44:16 2001 +0000
+++ b/lisp/term/sun.el	Tue Jul 17 18:37:47 2001 +0000
@@ -29,11 +29,6 @@
 
 ;;; Code:
 
-(defun ignore-key ()
-  "interactive version of ignore"
-  (interactive)
-  (ignore))
-
 (defun scroll-down-in-place (n)
   (interactive "p")
   (previous-line n)
@@ -56,6 +51,7 @@
   (interactive)
   (if (zerop (minibuffer-depth))
       (repeat-complex-command 1)
+    ;; FIXME: this function does not seem to exist.  -stef'01
     (previous-complex-command 1)))
 
 (defun rerun-prev-command ()
@@ -88,16 +84,13 @@
   (interactive)
   (re-search-backward (grep-arg)))
 
-;;;
-;;; handle sun's extra function keys
-;;; this version for those who run with standard .ttyswrc and no emacstool
-;;;
-;;; sunview picks up expose and open on the way UP, 
-;;; so we ignore them on the way down
-;;;
-
-(defvar sun-esc-bracket nil
-  "*If non-nil, rebind ESC [ as prefix for Sun function keys.")
+;;
+;; handle sun's extra function keys
+;; this version for those who run with standard .ttyswrc and no emacstool
+;;
+;; sunview picks up expose and open on the way UP, 
+;; so we ignore them on the way down
+;;
 
 (defvar sun-raw-prefix (make-sparse-keymap))
 (define-key function-key-map "\e[" sun-raw-prefix)
@@ -112,16 +105,24 @@
 (define-key sun-raw-prefix "193z" [redo])
 (define-key sun-raw-prefix "194z" [props])
 (define-key sun-raw-prefix "195z" [undo])
-; (define-key sun-raw-prefix "196z" 'ignore-key)		; Expose-down
-; (define-key sun-raw-prefix "197z" [put])
-; (define-key sun-raw-prefix "198z" 'ignore-key)		; Open-down
-; (define-key sun-raw-prefix "199z" [get])
+;; (define-key sun-raw-prefix "196z" 'ignore)		; Expose-down
+;; (define-key sun-raw-prefix "197z" [put])
+;; (define-key sun-raw-prefix "198z" 'ignore)		; Open-down
+;; (define-key sun-raw-prefix "199z" [get])
 (define-key sun-raw-prefix "200z" [find])
-; (define-key sun-raw-prefix "201z" 'kill-region-and-unmark)	; Delete
-(define-key sun-raw-prefix "226z" [t3])
-(define-key sun-raw-prefix "227z" [t4])
-(define-key sun-raw-prefix "229z" [t6])
-(define-key sun-raw-prefix "230z" [t7])
+;; (define-key sun-raw-prefix "201z" 'kill-region-and-unmark)	; Delete
+(define-key sun-raw-prefix "224z" [f1])
+(define-key sun-raw-prefix "225z" [f2])
+(define-key sun-raw-prefix "226z" [f3])
+(define-key sun-raw-prefix "227z" [f4])
+(define-key sun-raw-prefix "228z" [f5])
+(define-key sun-raw-prefix "229z" [f6])
+(define-key sun-raw-prefix "230z" [f7])
+(define-key sun-raw-prefix "231z" [f8])
+(define-key sun-raw-prefix "232z" [f9])
+(define-key sun-raw-prefix "233z" [f10])
+(define-key sun-raw-prefix "234z" [f11])
+(define-key sun-raw-prefix "235z" [f12])
 (define-key sun-raw-prefix "A" [up])			; R8
 (define-key sun-raw-prefix "B" [down])			; R14
 (define-key sun-raw-prefix "C" [right])			; R12
@@ -134,59 +135,55 @@
 (global-set-key [r11]	'recenter)
 (global-set-key [r13]	'end-of-buffer)
 (global-set-key [r15]	'scroll-up)
-(global-set-key [redo]	'redraw-display)
+(global-set-key [redo]	'redraw-display)  ;FIXME: collides with default.
 (global-set-key [props]	'list-buffers)
-(global-set-key [undo]	'undo)
 (global-set-key [put]	'sun-select-region)
 (global-set-key [get]	'sun-yank-selection)
 (global-set-key [find]	'exchange-point-and-mark)
-(global-set-key [t3]	'scroll-down-in-place)
-(global-set-key [t4]	'scroll-up-in-place)
-(global-set-key [t6]	'shrink-window)
-(global-set-key [t7]	'enlarge-window)
+(global-set-key [f3]	'scroll-down-in-place)
+(global-set-key [f4]	'scroll-up-in-place)
+(global-set-key [f6]	'shrink-window)
+(global-set-key [f7]	'enlarge-window)
 
 
-(if sun-esc-bracket (global-unset-key "\e["))
-
-;;; Since .emacs gets loaded before this file, a hook is supplied
-;;; for you to put your own bindings in.
+;; Since .emacs gets loaded before this file, a hook is supplied
+;; for you to put your own bindings in.
 
 (defvar sun-raw-prefix-hooks nil
   "List of forms to evaluate after setting sun-raw-prefix.")
 
-(let ((hooks sun-raw-prefix-hooks))
-  (while hooks
-    (eval (car hooks))
-    (setq hooks (cdr hooks))
-    ))
+(when sun-raw-prefix-hooks
+  (message "sun-raw-prefix-hooks is obsolete!  Use term-setup-hook instead!")
+  (let ((hooks sun-raw-prefix-hooks))
+    (while hooks
+      (eval (car hooks))
+      (setq hooks (cdr hooks)))))
 
 
 ;;; This section adds definitions for the emacstool users
-;;; emacstool event filter converts function keys to C-x*{c}{lrt}
-;;;
-;;; for example the Open key (L7) would be encoded as "\C-x*gl"
-;;; the control, meta, and shift keys modify the character {lrt}
-;;; note that (unshifted) C-l is ",",  C-r is "2", and C-t is "4"
-;;;
-;;; {c} is [a-j] for LEFT, [a-i] for TOP, [a-o] for RIGHT.
-;;; A higher level insists on encoding {h,j,l,n}{r} (the arrow keys)
-;;; as ANSI escape sequences.  Use the shell command 
-;;; % setkeys noarrows
-;;; if you want these to come through for emacstool.
-;;;
-;;; If you are not using EmacsTool, 
-;;; you can also use this by creating a .ttyswrc file to do the conversion.
-;;; but it won't include the CONTROL, META, or SHIFT keys!
-;;;
-;;; Important to define SHIFTed sequence before matching unshifted sequence.
-;;; (talk about bletcherous old uppercase terminal conventions!*$#@&%*&#$%)
-;;;  this is worse than C-S/C-Q flow control anyday!
-;;;  Do *YOU* run in capslock mode?
-;;;
+;; emacstool event filter converts function keys to C-x*{c}{lrt}
+;;
+;; for example the Open key (L7) would be encoded as "\C-x*gl"
+;; the control, meta, and shift keys modify the character {lrt}
+;; note that (unshifted) C-l is ",",  C-r is "2", and C-t is "4"
+;;
+;; {c} is [a-j] for LEFT, [a-i] for TOP, [a-o] for RIGHT.
+;; A higher level insists on encoding {h,j,l,n}{r} (the arrow keys)
+;; as ANSI escape sequences.  Use the shell command 
+;; % setkeys noarrows
+;; if you want these to come through for emacstool.
+;;
+;; If you are not using EmacsTool, 
+;; you can also use this by creating a .ttyswrc file to do the conversion.
+;; but it won't include the CONTROL, META, or SHIFT keys!
+;;
+;; Important to define SHIFTed sequence before matching unshifted sequence.
+;; (talk about bletcherous old uppercase terminal conventions!*$#@&%*&#$%)
+;;  this is worse than C-S/C-Q flow control anyday!
+;;  Do *YOU* run in capslock mode?
+;;
 
-;;; Note:  al, el and gl are trapped by EmacsTool, so they never make it here.
-
-(defvar meta-flag t)
+;; Note:  al, el and gl are trapped by EmacsTool, so they never make it here.
 
 (defvar suntool-map (make-sparse-keymap)
   "*Keymap for Emacstool bindings.")
@@ -203,10 +200,10 @@
 (define-key suntool-map "bl" 'redraw-display)		; Again
 (define-key suntool-map "cl" 'list-buffers)		; Props
 (define-key suntool-map "dl" 'undo)			; Undo
-(define-key suntool-map "el" 'ignore-key)		; Expose-Open
+(define-key suntool-map "el" 'ignore)			; Expose-Open
 (define-key suntool-map "fl" 'sun-select-region)	; Put
 (define-key suntool-map "f," 'copy-region-as-kill)	; C-Put
-(define-key suntool-map "gl" 'ignore-key)		; Open-Open
+(define-key suntool-map "gl" 'ignore)			; Open-Open
 (define-key suntool-map "hl" 'sun-yank-selection)	; Get
 (define-key suntool-map "h," 'yank)			; C-Get
 (define-key suntool-map "il" 'research-forward)		; Find
@@ -214,41 +211,42 @@
 (define-key suntool-map "i\M-l" 'research-backward)	; M-Find
 (define-key suntool-map "i\M-," 're-search-backward)	; C-M-Find
 
-(define-key suntool-map "jL" 'yank)			; DELETE        
+(define-key suntool-map "jL" 'yank)			; DELETE
 (define-key suntool-map "jl" 'kill-region-and-unmark)	; Delete
 (define-key suntool-map "j\M-l" 'exchange-point-and-mark); M-Delete
-(define-key suntool-map "j," 
-  '(lambda () (interactive) (pop-mark 1)))		; C-Delete
+(define-key suntool-map "j,"
+  (lambda () (interactive) (pop-mark)))		; C-Delete
 
 (define-key suntool-map "fT" 'shrink-window-horizontally)	; T6
 (define-key suntool-map "gT" 'enlarge-window-horizontally)	; T7
 (define-key suntool-map "ft" 'shrink-window)			; t6
 (define-key suntool-map "gt" 'enlarge-window)			; t7
-(define-key suntool-map "cT" '(lambda(n) (interactive "p") (scroll-down n)))
-(define-key suntool-map "dT" '(lambda(n) (interactive "p") (scroll-up n)))
+(define-key suntool-map "cT" (lambda (n) (interactive "p") (scroll-down n)))
+(define-key suntool-map "dT" (lambda (n) (interactive "p") (scroll-up n)))
 (define-key suntool-map "ct" 'scroll-down-in-place)		; t3
 (define-key suntool-map "dt" 'scroll-up-in-place)		; t4
 (define-key ctl-x-map "*" suntool-map)
 
-;;; Since .emacs gets loaded before this file, a hook is supplied
-;;; for you to put your own bindings in.
+;; Since .emacs gets loaded before this file, a hook is supplied
+;; for you to put your own bindings in.
 
 (defvar suntool-map-hooks nil
   "List of forms to evaluate after setting suntool-map.")
 
-(let ((hooks suntool-map-hooks))
-  (while hooks
-    (eval (car hooks))
-    (setq hooks (cdr hooks))
-    ))
+(when suntool-map-hooks
+  (message "suntool-map-hooks is obsolete!  Use term-setup-hook instead!")
+  (let ((hooks suntool-map-hooks))
+    (while hooks
+      (eval (car hooks))
+      (setq hooks (cdr hooks)))))
 
-;;;
-;;; If running under emacstool, arrange to call suspend-emacstool
-;;; instead of suspend-emacs.
-;;;
-;;; First mouse blip is a clue that we are in emacstool.
-;;;
-;;; C-x C-@ is the mouse command prefix.
+;;
+;; If running under emacstool, arrange to call suspend-emacstool
+;; instead of suspend-emacs.
+;;
+;; First mouse blip is a clue that we are in emacstool.
+;;
+;; C-x C-@ is the mouse command prefix.
 
 (autoload 'sun-mouse-handler "sun-mouse" 
 	  "Sun Emacstool handler for mouse blips (not loaded)." t)
@@ -259,6 +257,7 @@
   (require 'sun-fns)
   (define-key ctl-x-map "\C-@" 'sun-mouse-handler)
 
+  ;; FIXME: this function does not seem to exist either.  -stef'01
   (if (< (sun-window-init) 0)
       (message "Not a Sun Window")
     (progn
@@ -266,15 +265,13 @@
       (substitute-key-definition 'suspend-emacs 'suspend-emacstool esc-map)
       (substitute-key-definition 'suspend-emacs 'suspend-emacstool ctl-x-map))
       (send-string-to-terminal
-       (concat "\033]lEmacstool - GNU Emacs " emacs-version "\033\\"))
-    ))
+       (concat "\033]lEmacstool - GNU Emacs " emacs-version "\033\\"))))
 
 (defun sun-mouse-once ()
   "Converts to emacstool and sun-mouse-handler on first mouse hit."
   (interactive)
   (emacstool-init)
-  (sun-mouse-handler)			; Now, execute this mouse blip.
-  )
+  (sun-mouse-handler))			; Now, execute this mouse blip.
 (define-key ctl-x-map "\C-@" 'sun-mouse-once)
 
 ;;; sun.el ends here