emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rxvt vs xterm keybindings


From: Dan Nicolaescu
Subject: Re: rxvt vs xterm keybindings
Date: Mon, 25 Jul 2005 11:38:57 -0700

"Richard M. Stallman" <address@hidden> writes:

  >     This actually brings us a step closer to another proposal that is
  >     needed for the multi-tty branch: each one of the term/*.el files
  >     should define an autoloaded function called
  >     TERMNAME-initialize-terminal. Then when emacs wants to initialize a
  >     terminal TERMNAME it does something like:
  >     (if (fboundp 'TERMNAME-initialize-terminal)
  >     (TERMNAME-initialize-terminal))
  >     instead of having the terminal initialization performed (as it is
  >     currently done) by doing (load "term/TERMNAME") 
  > 
  > This seems like a good idea.  If an autoloadable terminal-specific
  > function exists for TERMNAME, fboundp will return t.  Otherwise it
  > will return nil.

I implemented this. The patch is below, it seems to work fine. 
I did not write new documentation, I will do it if you agree with this
patch. 

I am not very happy with the name of the function use to initialize
the terminals:  TERMNAME-initialize-terminal. I would appreciate
better ideas. (maybe use initialize-terminal-TERMNAME ?)

The diff is with -w so that the changes are minimized. It's mostly
mechanical (create one -initialize-terminal function in each term/*.el
file, and move all the toplevel forms inside that function).
startup.el was changed to not load the terminal files, but to call the
corresponding -initialize-terminal function. 

I needed to add "term" to subdirs.el:normal-top-level-add-to-load-path 
because the autoloads are generated like this: 

;;;### (autoloads (xterm-initialize-terminal) "xterm" "term/xterm.el"
;;;;;;  (17125 1209))
;;; Generated autoloads from term/xterm.el

(autoload (quote xterm-initialize-terminal) "xterm" "\
Not documented

\(fn)" nil nil)


Given that the "term" subdirectory is not currently in load-path, I
would have expected the autoload call to be:

(autoload (quote xterm-initialize-terminal) "term/xterm" "\...


Please let me know what you think.


Index: apollo.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/term/apollo.el,v
retrieving revision 1.9
diff -c -3 -p -w -r1.9 apollo.el
*** apollo.el   1 Sep 2003 15:45:36 -0000       1.9
--- apollo.el   25 Jul 2005 17:51:55 -0000
***************
*** 1,6 ****
  ;; -*- no-byte-compile: t -*-
  
! (load "term/vt100" nil t)
  
  ;;; arch-tag: c72f446f-e6b7-4749-90a4-bd68632adacf
  ;;; apollo.el ends here
--- 1,8 ----
  ;; -*- no-byte-compile: t -*-
+ ;;;###autoload
+ (defun apollo-initialize-terminal ()
    
!   (load "term/vt100" nil t))
  
  ;;; arch-tag: c72f446f-e6b7-4749-90a4-bd68632adacf
  ;;; apollo.el ends here
Index: bobcat.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/term/bobcat.el,v
retrieving revision 1.10
diff -c -3 -p -w -r1.10 bobcat.el
*** bobcat.el   26 Mar 2005 16:22:59 -0000      1.10
--- bobcat.el   25 Jul 2005 17:51:55 -0000
***************
*** 1,7 ****
  ;; -*- no-byte-compile: t -*-
! ;;; HP terminals usually encourage using ^H as the rubout character
  (keyboard-translate ?\177 ?\^h)
! (keyboard-translate ?\^h ?\177)
  
  ;;; arch-tag: 754e4520-0a3e-4e6e-8ca5-9481b1f85cf7
  ;;; bobcat.el ends here
--- 1,10 ----
  ;; -*- no-byte-compile: t -*-
! 
! ;;;###autoload
! (defun bobcat-initialize-terminal ()
!   ;; HP terminals usually encourage using ^H as the rubout character
    (keyboard-translate ?\177 ?\^h)
!   (keyboard-translate ?\^h ?\177))
  
  ;;; arch-tag: 754e4520-0a3e-4e6e-8ca5-9481b1f85cf7
  ;;; bobcat.el ends here
Index: cygwin.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/term/cygwin.el,v
retrieving revision 1.1
diff -c -3 -p -w -r1.1 cygwin.el
*** cygwin.el   22 Jul 2005 17:11:04 -0000      1.1
--- cygwin.el   25 Jul 2005 17:51:55 -0000
***************
*** 1,6 ****
  ;;; cygwin.el --- support for the Cygwin terminal -*- no-byte-compile: t -*-
  
  ;;; The Cygwin terminal can't really display underlines.
! (tty-no-underline)
  
  ;;; cygwin.el ends here
--- 1,9 ----
  ;;; cygwin.el --- support for the Cygwin terminal -*- no-byte-compile: t -*-
  
  ;;; The Cygwin terminal can't really display underlines.
! 
! ;;;###autoload
! (defun cygwin-initialize-terminal ()
!   (tty-no-underline))
  
  ;;; cygwin.el ends here
Index: iris-ansi.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/term/iris-ansi.el,v
retrieving revision 1.6
diff -c -3 -p -w -r1.6 iris-ansi.el
*** iris-ansi.el        4 Jul 2005 16:49:23 -0000       1.6
--- iris-ansi.el        25 Jul 2005 17:51:55 -0000
***************
*** 25,30 ****
--- 25,32 ----
  
  ;;; Code:
  
+ (defun iris-ansi-initialize-terminal ()
+ 
  (define-key function-key-map "\e[120q" [S-escape])
  (define-key function-key-map "\e[121q" [C-escape])
  
***************
*** 89,96 ****
  (define-key function-key-map "\e[048q" [M-f12])
  
  
! (define-key function-key-map "\e[057q" [C-`])
! (define-key function-key-map "\e[115q" [M-`])
  
  (define-key function-key-map "\e[049q" [?\C-1])
  (define-key function-key-map "\e[058q" [?\M-1])
--- 91,98 ----
  (define-key function-key-map "\e[048q" [M-f12])
  
  
! (define-key function-key-map "\e[057q" [?\C-`])
! (define-key function-key-map "\e[115q" [?\M-`])
  
  (define-key function-key-map "\e[049q" [?\C-1])
  (define-key function-key-map "\e[058q" [?\M-1])
***************
*** 320,326 ****
  
  (define-key function-key-map "\e[P" [delete])
  (define-key function-key-map "\e[196q" [C-delete])
! (define-key function-key-map "\e[197q" [M-delete])
  
  ;;; arch-tag: b1d0e73a-bb7d-47be-9fb2-6fb126469a1b
  ;;; iris-ansi.el ends here
--- 322,328 ----
  
  (define-key function-key-map "\e[P" [delete])
  (define-key function-key-map "\e[196q" [C-delete])
! (define-key function-key-map "\e[197q" [M-delete]))
  
  ;;; arch-tag: b1d0e73a-bb7d-47be-9fb2-6fb126469a1b
  ;;; iris-ansi.el ends here
Index: linux.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/term/linux.el,v
retrieving revision 1.7
diff -c -3 -p -w -r1.7 linux.el
*** linux.el    17 Jun 2005 14:13:47 -0000      1.7
--- linux.el    25 Jul 2005 17:51:55 -0000
***************
*** 1,6 ****
--- 1,9 ----
  ;; -*- no-byte-compile: t -*-
  ;; The Linux console handles Latin-1 by default.
  
+ ;;;###autoload
+ ;;;###autoload
+ (defun linux-initialize-terminal ()
    (unless (terminal-coding-system)
      (set-terminal-coding-system 'iso-latin-1))
  
***************
*** 13,19 ****
  
  (let ((value (current-input-mode)))
    ;; The third arg only matters in that it is not t or nil.
!   (set-input-mode (nth 0 value) (nth 1 value) 'iso-latin-1 (nth 3 value)))
  
  ;;; arch-tag: 5d0c4f63-739b-4862-abf3-041fe42adb8f
  ;;; linux.el ends here
--- 16,22 ----
  
    (let ((value (current-input-mode)))
      ;; The third arg only matters in that it is not t or nil.
!     (set-input-mode (nth 0 value) (nth 1 value) 'iso-latin-1 (nth 3 value))))
  
  ;;; arch-tag: 5d0c4f63-739b-4862-abf3-041fe42adb8f
  ;;; linux.el ends here
Index: news.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/term/news.el,v
retrieving revision 1.17
diff -c -3 -p -w -r1.17 news.el
*** news.el     4 Jul 2005 16:49:23 -0000       1.17
--- news.el     25 Jul 2005 17:51:55 -0000
***************
*** 28,33 ****
--- 28,36 ----
  
  ;;; Code:
  
+ ;;;###autoload
+ (defun news-initialize-terminal ()
+   
    (if (boundp 'news-fkey-prefix)
        nil
      ;; The terminal initialization should already have set up some keys
***************
*** 68,74 ****
    (define-key news-fkey-prefix "t" [kp-4])
    (define-key news-fkey-prefix "v" [kp-6])
    (define-key news-fkey-prefix "x" [kp-8])
!   )
  
  ;;; arch-tag: bfe141a0-623b-4b42-b753-5d9353776c5e
  ;;; news.el ends here
--- 71,77 ----
      (define-key news-fkey-prefix "t" [kp-4])
      (define-key news-fkey-prefix "v" [kp-6])
      (define-key news-fkey-prefix "x" [kp-8])
!     ))
  
  ;;; arch-tag: bfe141a0-623b-4b42-b753-5d9353776c5e
  ;;; news.el ends here
Index: rxvt.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/term/rxvt.el,v
retrieving revision 1.7
diff -c -3 -p -w -r1.7 rxvt.el
*** rxvt.el     22 Jul 2005 17:11:04 -0000      1.7
--- rxvt.el     25 Jul 2005 17:51:55 -0000
***************
*** 1,6 ****
  ;;; rxvt.el --- define function key sequences and standard colors for rxvt
  
! ;; Copyright (C) 2002 Free Software Foundation, Inc.
  
  ;; Author: Eli Zaretskii
  ;; Keywords: terminals
--- 1,6 ----
  ;;; rxvt.el --- define function key sequences and standard colors for rxvt
  
! ;; Copyright (C) 2002, 2005 Free Software Foundation, Inc.
  
  ;; Author: Eli Zaretskii
  ;; Keywords: terminals
***************
*** 26,39 ****
  
  ;;; Code:
  
! ;;; The terminal intialization C code file might have initialized
! ;;; function keys F11->F42 from the termcap/terminfo information.  On
! ;;; a PC-style keyboard these keys correspond to
! ;;; MODIFIER-FUNCTION_KEY, where modifier is S-, C-, C-S-.  The
! ;;; code here subsitutes the corresponding defintions in
! ;;; function-key-map. This substitution is needed because if a key
! ;;; definition if found in function-key-map, there are no further
! ;;; lookups in other keymaps.
  (substitute-key-definition [f11] [S-f1] function-key-map) 
  (substitute-key-definition [f12] [S-f2] function-key-map)
  (substitute-key-definition [f13] [S-f3] function-key-map)
--- 26,42 ----
  
  ;;; Code:
  
! ;;;###autoload
! (defun rxvt-initialize-terminal ()
! 
!   ;; The terminal intialization C code file might have initialized
!   ;; function keys F11->F42 from the termcap/terminfo information.  On
!   ;; a PC-style keyboard these keys correspond to
!   ;; MODIFIER-FUNCTION_KEY, where modifier is S-, C-, C-S-.  The
!   ;; code here subsitutes the corresponding defintions in
!   ;; function-key-map. This substitution is needed because if a key
!   ;; definition if found in function-key-map, there are no further
!   ;; lookups in other keymaps.
    (substitute-key-definition [f11] [S-f1] function-key-map) 
    (substitute-key-definition [f12] [S-f2] function-key-map)
    (substitute-key-definition [f13] [S-f3] function-key-map)
***************
*** 156,161 ****
--- 159,170 ----
      (set-keymap-parent map (keymap-parent function-key-map))
      (set-keymap-parent function-key-map map))
  
+   ;; Initialize colors and background mode.
+   (rxvt-register-default-colors)
+   (rxvt-set-background-mode)
+   ;; This recomputes all the default faces given the colors we've just set up.
+   (tty-set-up-initial-frame-faces))
+ 
  ;; Set up colors, for those versions of rxvt that support it.
  (defvar rxvt-standard-colors
    ;; The names of the colors in the comments taken from the rxvt.1 man
*************** for the currently selected frame."
*** 227,238 ****
             (* (apply '+ (car (cddr (nth 15 rxvt-standard-colors)))) 0.6))
          (setq default-frame-background-mode 'dark)))
      (frame-set-background-mode (selected-frame))))
- 
- ;; Do it!
- (rxvt-register-default-colors)
- (rxvt-set-background-mode)
- ;; This recomputes all the default faces given the colors we've just set up.
- (tty-set-up-initial-frame-faces)
  
  ;;; arch-tag: 20cf2fb6-6318-4bab-9dbf-1d15048f2257
  ;;; rxvt.el ends here
--- 236,241 ----
Index: sun.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/term/sun.el,v
retrieving revision 1.16
diff -c -3 -p -w -r1.16 sun.el
*** sun.el      4 Jul 2005 16:49:23 -0000       1.16
--- sun.el      25 Jul 2005 17:51:55 -0000
***************
*** 93,98 ****
--- 93,155 ----
  ;;
  
  (defvar sun-raw-prefix (make-sparse-keymap))
+ 
+ ;; 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.")
+ 
+ 
+ ;;; 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?
+ ;;
+ 
+ ;; 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.")
+ 
+ 
+ ;; 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.")
+ 
+ ;;
+ ;; 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)
+ 
+ ;;;###autoload
+ (defun sun-initialize-terminal ()
+ 
    (define-key function-key-map "\e[" sun-raw-prefix)
  
    (define-key sun-raw-prefix "210z" [r3])
***************
*** 145,157 ****
  (global-set-key [f6]  'shrink-window)
  (global-set-key [f7]  'enlarge-window)
  
- 
- ;; 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.")
- 
  (when sun-raw-prefix-hooks
    (message "sun-raw-prefix-hooks is obsolete!  Use term-setup-hook instead!")
    (let ((hooks sun-raw-prefix-hooks))
--- 202,207 ----
***************
*** 159,193 ****
        (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?
- ;;
- 
- ;; 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.")
- 
  (define-key suntool-map "gr" 'beginning-of-buffer)    ; r7
  (define-key suntool-map "iR" 'backward-page)          ; R9
  (define-key suntool-map "ir" 'scroll-down)            ; r9
--- 209,214 ----
***************
*** 227,238 ****
  (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.
- 
- (defvar suntool-map-hooks nil
-   "List of forms to evaluate after setting suntool-map.")
- 
  (when suntool-map-hooks
    (message "suntool-map-hooks is obsolete!  Use term-setup-hook instead!")
    (let ((hooks suntool-map-hooks))
--- 248,253 ----
***************
*** 240,255 ****
        (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.
! 
! (autoload 'sun-mouse-handler "sun-mouse"
!         "Sun Emacstool handler for mouse blips (not loaded)." t)
  
  (defun emacstool-init ()
    "Set up Emacstool window, if you know you are in an emacstool."
--- 255,261 ----
        (eval (car hooks))
        (setq hooks (cdr hooks)))))
    
!   (define-key ctl-x-map "\C-@" 'sun-mouse-once))
  
  (defun emacstool-init ()
    "Set up Emacstool window, if you know you are in an emacstool."
***************
*** 272,278 ****
    (interactive)
    (emacstool-init)
    (sun-mouse-handler))                        ; Now, execute this mouse blip.
- (define-key ctl-x-map "\C-@" 'sun-mouse-once)
  
  ;;; arch-tag: db761d47-fd7d-42b4-aae1-04fa116b6ba6
  ;;; sun.el ends here
--- 278,283 ----
Index: tvi970.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/term/tvi970.el,v
retrieving revision 1.11
diff -c -3 -p -w -r1.11 tvi970.el
*** tvi970.el   4 Jul 2005 16:49:23 -0000       1.11
--- tvi970.el   25 Jul 2005 17:51:55 -0000
***************
*** 28,33 ****
--- 28,36 ----
  
  ;;; Code:
  
+ ;;;###autoload
+ (defun tvi970-initialize-terminal ()
+ 
    (or (lookup-key function-key-map "\e[")
        (define-key function-key-map "\e[" (make-keymap)))
    ;; (or (lookup-key function-key-map "\eO")
***************
*** 99,104 ****
--- 102,108 ----
        (vector (intern (format "S-f%d" (1+ i)))))
        (setq i (1+ i))))
  
+   (tvi970-set-keypad-mode 1))
  
  ;;; Should keypad numbers send ordinary digits or distinct escape sequences?
  (defvar tvi970-keypad-numeric nil
*************** With a negative argument, select numeric
*** 120,127 ****
            (not tvi970-keypad-numeric)
          (> (prefix-numeric-value arg) 0)))
    (send-string-to-terminal (if tvi970-keypad-numeric "\e=" "\e>")))
- 
- (tvi970-set-keypad-mode 1)
  
  ;;; arch-tag: c1334cf0-1462-41c3-a963-c077d175f8f0
  ;;; tvi970.el ends here
--- 124,129 ----
Index: vt100.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/term/vt100.el,v
retrieving revision 1.16
diff -c -3 -p -w -r1.16 vt100.el
*** vt100.el    4 Jul 2005 16:49:23 -0000       1.16
--- vt100.el    25 Jul 2005 17:51:55 -0000
***************
*** 36,42 ****
  ;;; Code:
  
  ;; Set up function-key-map entries that termcap and terminfo don't know.
! (load "term/lk201" nil t)
  
  ;;; Controlling the screen width.
  (defvar vt100-wide-mode (= (frame-width) 132)
--- 36,47 ----
  ;;; Code:
  
  ;; Set up function-key-map entries that termcap and terminfo don't know.
! 
! 
! ;;;###autoload
! (defun vt100-initialize-terminal ()
! 
!   (load "term/lk201" nil t))
    
  ;;; Controlling the screen width.
  (defvar vt100-wide-mode (= (frame-width) 132)
Index: vt102.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/term/vt102.el,v
retrieving revision 1.4
diff -c -3 -p -w -r1.4 vt102.el
*** vt102.el    1 Sep 2003 15:45:36 -0000       1.4
--- vt102.el    25 Jul 2005 17:51:55 -0000
***************
*** 1,6 ****
  ;; -*- no-byte-compile: t -*-
  
! (load "term/vt100" nil t)
  
  ;;; arch-tag: 6e839cfc-125a-4574-82f1-c23a51f7c50f
  ;;; vt102.el ends here
--- 1,9 ----
  ;; -*- no-byte-compile: t -*-
  
! ;;;###autoload
! (defun vt102-initialize-terminal ()
!   
!   (load "term/vt100" nil t))
  
  ;;; arch-tag: 6e839cfc-125a-4574-82f1-c23a51f7c50f
  ;;; vt102.el ends here
Index: vt125.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/term/vt125.el,v
retrieving revision 1.4
diff -c -3 -p -w -r1.4 vt125.el
*** vt125.el    1 Sep 2003 15:45:36 -0000       1.4
--- vt125.el    25 Jul 2005 17:51:55 -0000
***************
*** 1,6 ****
  ;; -*- no-byte-compile: t -*-
  
! (load "term/vt100" nil t)
  
  ;;; arch-tag: 1d92d70f-dd55-4a1d-9088-e215a4883801
  ;;; vt125.el ends here
--- 1,9 ----
  ;; -*- no-byte-compile: t -*-
  
! ;;;###autoload
! (defun vt125-initialize-terminal ()
!   
!   (load "term/vt100" nil t))
  
  ;;; arch-tag: 1d92d70f-dd55-4a1d-9088-e215a4883801
  ;;; vt125.el ends here
Index: vt200.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/term/vt200.el,v
retrieving revision 1.13
diff -c -3 -p -w -r1.13 vt200.el
*** vt200.el    1 Sep 2003 15:45:36 -0000       1.13
--- vt200.el    25 Jul 2005 17:51:55 -0000
***************
*** 1,10 ****
  ;; -*- no-byte-compile: t -*-
  ;; For our purposes we can treat the vt200 and vt100 almost alike.
  ;; Most differences are handled by the termcap entry.
- (load "term/vt100" nil t)
  
  ;; Make F11 an escape key.
! (define-key function-key-map "\e[23~" [?\e])
  
  ;;; arch-tag: 0f78f583-9f32-4237-b106-28bcfff21d89
  ;;; vt200.el ends here
--- 1,13 ----
  ;; -*- no-byte-compile: t -*-
  ;; For our purposes we can treat the vt200 and vt100 almost alike.
  ;; Most differences are handled by the termcap entry.
  
+ ;;;###autoload
+ (defun vt200-initialize-terminal ()
+   
+   (load "term/vt100" nil t)
    ;; Make F11 an escape key.
!   (define-key function-key-map "\e[23~" [?\e]))
  
  ;;; arch-tag: 0f78f583-9f32-4237-b106-28bcfff21d89
  ;;; vt200.el ends here
Index: vt201.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/term/vt201.el,v
retrieving revision 1.5
diff -c -3 -p -w -r1.5 vt201.el
*** vt201.el    1 Sep 2003 15:45:36 -0000       1.5
--- vt201.el    25 Jul 2005 17:51:55 -0000
***************
*** 1,10 ****
  ;; -*- no-byte-compile: t -*-
  ;; For our purposes we can treat the vt200 and vt100 almost alike.
  ;; Most differences are handled by the termcap entry.
! (load "term/vt100" nil t)
  
  ;; Make F11 an escape key.
! (define-key function-key-map "\e[23~" [?\e])
  
  ;;; arch-tag: a6abb38f-60ea-449e-a9e9-3fb8572c52ae
  ;;; vt201.el ends here
--- 1,12 ----
  ;; -*- no-byte-compile: t -*-
  ;; For our purposes we can treat the vt200 and vt100 almost alike.
  ;; Most differences are handled by the termcap entry.
! ;;;###autoload
! (defun vt201-initialize-terminal ()
    
+   (load "term/vt100" nil t)
    ;; Make F11 an escape key.
!   (define-key function-key-map "\e[23~" [?\e]))
  
  ;;; arch-tag: a6abb38f-60ea-449e-a9e9-3fb8572c52ae
  ;;; vt201.el ends here
Index: vt220.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/term/vt220.el,v
retrieving revision 1.5
diff -c -3 -p -w -r1.5 vt220.el
*** vt220.el    1 Sep 2003 15:45:36 -0000       1.5
--- vt220.el    25 Jul 2005 17:51:55 -0000
***************
*** 1,10 ****
  ;; -*- no-byte-compile: t -*-
  ;; For our purposes we can treat the vt200 and vt100 almost alike.
  ;; Most differences are handled by the termcap entry.
! (load "term/vt100" nil t)
  
  ;; Make F11 an escape key.
! (define-key function-key-map "\e[23~" [?\e])
  
  ;;; arch-tag: 98fc4867-a20d-46a1-a276-d7be31e49871
  ;;; vt220.el ends here
--- 1,12 ----
  ;; -*- no-byte-compile: t -*-
  ;; For our purposes we can treat the vt200 and vt100 almost alike.
  ;; Most differences are handled by the termcap entry.
! ;;;###autoload
! (defun vt220-initialize-terminal ()
    
+   (load "term/vt100" nil t)
    ;; Make F11 an escape key.
!   (define-key function-key-map "\e[23~" [?\e]))
  
  ;;; arch-tag: 98fc4867-a20d-46a1-a276-d7be31e49871
  ;;; vt220.el ends here
Index: vt240.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/term/vt240.el,v
retrieving revision 1.5
diff -c -3 -p -w -r1.5 vt240.el
*** vt240.el    1 Sep 2003 15:45:36 -0000       1.5
--- vt240.el    25 Jul 2005 17:51:55 -0000
***************
*** 1,10 ****
  ;; -*- no-byte-compile: t -*-
  ;; For our purposes we can treat the vt200 and vt100 almost alike.
  ;; Most differences are handled by the termcap entry.
! (load "term/vt100" nil t)
  
  ;; Make F11 an escape key.
! (define-key function-key-map "\e[23~" [?\e])
  
  ;;; arch-tag: d9f88e9c-02dc-49ff-871c-a415f08e4eb7
  ;;; vt240.el ends here
--- 1,12 ----
  ;; -*- no-byte-compile: t -*-
  ;; For our purposes we can treat the vt200 and vt100 almost alike.
  ;; Most differences are handled by the termcap entry.
! ;;;###autoload
! (defun vt240-initialize-terminal ()
    
+   (load "term/vt100" nil t)
    ;; Make F11 an escape key.
!   (define-key function-key-map "\e[23~" [?\e]))
  
  ;;; arch-tag: d9f88e9c-02dc-49ff-871c-a415f08e4eb7
  ;;; vt240.el ends here
Index: vt300.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/term/vt300.el,v
retrieving revision 1.4
diff -c -3 -p -w -r1.4 vt300.el
*** vt300.el    1 Sep 2003 15:45:36 -0000       1.4
--- vt300.el    25 Jul 2005 17:51:55 -0000
***************
*** 1,8 ****
  ;; -*- no-byte-compile: t -*-
! (load "term/vt100" nil t)
  
  ;; Make F11 an escape key.
! (define-key function-key-map "\e[23~" [?\e])
  
  ;;; arch-tag: 876831c9-a6f2-444a-b033-706e6fbc149f
  ;;; vt300.el ends here
--- 1,10 ----
  ;; -*- no-byte-compile: t -*-
! ;;;###autoload
! (defun vt300-initialize-terminal ()
    
+   (load "term/vt100" nil t)
    ;; Make F11 an escape key.
!   (define-key function-key-map "\e[23~" [?\e]))
  
  ;;; arch-tag: 876831c9-a6f2-444a-b033-706e6fbc149f
  ;;; vt300.el ends here
Index: vt320.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/term/vt320.el,v
retrieving revision 1.4
diff -c -3 -p -w -r1.4 vt320.el
*** vt320.el    1 Sep 2003 15:45:36 -0000       1.4
--- vt320.el    25 Jul 2005 17:51:55 -0000
***************
*** 1,8 ****
  ;; -*- no-byte-compile: t -*-
! (load "term/vt100" nil t)
  
  ;; Make F11 an escape key.
! (define-key function-key-map "\e[23~" [?\e])
  
  ;;; arch-tag: f9f4c954-0b9e-45f9-b450-a320d32abd9c
  ;;; vt320.el ends here
--- 1,10 ----
  ;; -*- no-byte-compile: t -*-
! ;;;###autoload
! (defun vt320-initialize-terminal ()
    
+   (load "term/vt100" nil t)
    ;; Make F11 an escape key.
!   (define-key function-key-map "\e[23~" [?\e]))
  
  ;;; arch-tag: f9f4c954-0b9e-45f9-b450-a320d32abd9c
  ;;; vt320.el ends here
Index: vt400.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/term/vt400.el,v
retrieving revision 1.4
diff -c -3 -p -w -r1.4 vt400.el
*** vt400.el    1 Sep 2003 15:45:36 -0000       1.4
--- vt400.el    25 Jul 2005 17:51:55 -0000
***************
*** 1,8 ****
  ;; -*- no-byte-compile: t -*-
! (load "term/vt100" nil t)
  
  ;; Make F11 an escape key.
! (define-key function-key-map "\e[23~" [?\e])
  
  ;;; arch-tag: a70809c5-6b21-42cc-ba20-536683e5e7d5
  ;;; vt400.el ends here
--- 1,10 ----
  ;; -*- no-byte-compile: t -*-
! ;;;###autoload
! (defun vt400-initialize-terminal ()
    
+   (load "term/vt100" nil t)
    ;; Make F11 an escape key.
!   (define-key function-key-map "\e[23~" [?\e]))
  
  ;;; arch-tag: a70809c5-6b21-42cc-ba20-536683e5e7d5
  ;;; vt400.el ends here
Index: vt420.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/term/vt420.el,v
retrieving revision 1.4
diff -c -3 -p -w -r1.4 vt420.el
*** vt420.el    1 Sep 2003 15:45:36 -0000       1.4
--- vt420.el    25 Jul 2005 17:51:55 -0000
***************
*** 1,8 ****
  ;; -*- no-byte-compile: t -*-
! (load "term/vt100" nil t)
  
  ;; Make F11 an escape key.
! (define-key function-key-map "\e[23~" [?\e])
  
  ;;; arch-tag: df2f897c-3a12-4b3c-9259-df089f96c160
  ;;; vt420.el ends here
--- 1,10 ----
  ;; -*- no-byte-compile: t -*-
! ;;;###autoload
! (defun vt420-initialize-terminal ()
    
+   (load "term/vt100" nil t)
    ;; Make F11 an escape key.
!   (define-key function-key-map "\e[23~" [?\e]))
  
  ;;; arch-tag: df2f897c-3a12-4b3c-9259-df089f96c160
  ;;; vt420.el ends here
Index: wyse50.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/term/wyse50.el,v
retrieving revision 1.21
diff -c -3 -p -w -r1.21 wyse50.el
*** wyse50.el   4 Jul 2005 16:49:23 -0000       1.21
--- wyse50.el   25 Jul 2005 17:51:55 -0000
***************
*** 1,6 ****
  ;;; wyse50.el --- terminal support code for Wyse 50 -*- no-byte-compile: t -*-
  
! ;; Copyright (C) 1989, 1993, 1994 Free Software Foundation, Inc.
  
  ;; Author: Daniel Pfeiffer <address@hidden>,
  ;;    Jim Blandy <address@hidden>
--- 1,6 ----
  ;;; wyse50.el --- terminal support code for Wyse 50 -*- no-byte-compile: t -*-
  
! ;; Copyright (C) 1989, 1993, 1994, 2005 Free Software Foundation, Inc.
  
  ;; Author: Daniel Pfeiffer <address@hidden>,
  ;;    Jim Blandy <address@hidden>
***************
*** 37,42 ****
--- 37,44 ----
  
  ;;; Code:
  
+ ;;;###autoload
+ (defun wyse50-initialize-terminal ()
    (define-key function-key-map "\C-a" (make-keymap))
    (mapcar (function (lambda (key-definition)
                      (define-key function-key-map
***************
*** 106,111 ****
--- 108,129 ----
            ("\^a\^i\^m"        [funct-tab])    ;; Not an X keysym
            ))
  
+   ;; Miscellaneous hacks
+ 
+   ;; This is an ugly hack for a nasty problem:
+   ;; Wyse 50 takes one character cell to store video attributes (which seems 
to
+   ;; explain width 79 rather than 80, column 1 is not used!!!).
+   ;; On killing (C-x C-c) the end inverse code (on column 1 of line 24)
+   ;; of the mode line is overwritten AFTER all the y-or-n questions.
+   ;; This causes the attribute to remain in effect until the mode line has
+   ;; scrolled of the screen.  Suspending (C-z) does not cause this problem.
+   ;; On such terminals, Emacs should sacrifice the first and last character of
+   ;; each mode line, rather than a whole screen column!
+   (add-hook 'kill-emacs-hook
+           (function (lambda () (interactive)
+                       (send-string-to-terminal
+                        (concat "\ea23R" (1+ (frame-width)) "C\eG0"))))))
+ 
  (defun enable-arrow-keys ()
    "To be called by term-setup-hook. Overrides 6 Emacs standard keys
  whose functions are then typed as follows:
*************** M-r     M-x move-to-window-line, Funct up-ar
*** 130,152 ****
            ("\C-h"     nil)
            ("\er"      nil)))
    (fset 'enable-arrow-keys nil))
- 
- 
- ;;; Miscellaneous hacks
- 
- ;;; This is an ugly hack for a nasty problem:
- ;;; Wyse 50 takes one character cell to store video attributes (which seems to
- ;;; explain width 79 rather than 80, column 1 is not used!!!).
- ;;; On killing (C-x C-c) the end inverse code (on column 1 of line 24)
- ;;; of the mode line is overwritten AFTER all the y-or-n questions.
- ;;; This causes the attribute to remain in effect until the mode line has
- ;;; scrolled of the screen.  Suspending (C-z) does not cause this problem.
- ;;; On such terminals, Emacs should sacrifice the first and last character of
- ;;; each mode line, rather than a whole screen column!
- (add-hook 'kill-emacs-hook
-         (function (lambda () (interactive)
-                     (send-string-to-terminal
-                      (concat "\ea23R" (1+ (frame-width)) "C\eG0")))))
  
  ;;; arch-tag: b6a05d37-eead-4cf6-b997-0f956c68881c
  ;;; wyse50.el ends here
--- 148,153 ----
Index: xterm.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/term/xterm.el,v
retrieving revision 1.19
diff -c -3 -p -w -r1.19 xterm.el
*** xterm.el    22 Jul 2005 18:40:14 -0000      1.19
--- xterm.el    25 Jul 2005 17:51:56 -0000
***************
*** 26,46 ****
  
  ;;; Code:
  
! ;;; rxvt terminals sometimes set the TERM variable to "xterm", but
! ;;; rxvt's keybindings that are incompatible with xterm's. It is
! ;;; better in that case to load rxvt's terminal initialization file.
  (if (and (getenv "COLORTERM")
         (string-match "\\`rxvt" (getenv "COLORTERM")))
!     (load "term/rxvt")
  
! ;;; The terminal intialization C code file might have initialized
! ;;; function keys F13->F60 from the termcap/terminfo information.  On
! ;;; a PC-style keyboard these keys correspond to
! ;;; MODIFIER-FUNCTION_KEY, where modifier is S-, C, A-, C-S-.  The
! ;;; code here subsitutes the corresponding defintions in
! ;;; function-key-map. This substitution is needed because if a key
! ;;; definition if found in function-key-map, there are no further
! ;;; lookups in other keymaps.
  (substitute-key-definition [f13] [S-f1] function-key-map) 
  (substitute-key-definition [f14] [S-f2] function-key-map)
  (substitute-key-definition [f15] [S-f3] function-key-map)
--- 26,49 ----
  
  ;;; Code:
  
! ;;;###autoload
! (defun xterm-initialize-terminal ()
! 
!   ;; rxvt terminals sometimes set the TERM variable to "xterm", but
!   ;; rxvt's keybindings that are incompatible with xterm's. It is
!   ;; better in that case to use rxvt's initializion function.
    (if (and (getenv "COLORTERM")
           (string-match "\\`rxvt" (getenv "COLORTERM")))
!       (rxvt-initialize-terminal)
  
!     ;; The terminal intialization C code file might have initialized
!     ;; function keys F13->F60 from the termcap/terminfo information.  On
!     ;; a PC-style keyboard these keys correspond to
!     ;; MODIFIER-FUNCTION_KEY, where modifier is S-, C, A-, C-S-.  The
!     ;; code here subsitutes the corresponding defintions in
!     ;; function-key-map. This substitution is needed because if a key
!     ;; definition if found in function-key-map, there are no further
!     ;; lookups in other keymaps.
      (substitute-key-definition [f13] [S-f1] function-key-map) 
      (substitute-key-definition [f14] [S-f2] function-key-map)
      (substitute-key-definition [f15] [S-f3] function-key-map)
***************
*** 250,255 ****
--- 253,263 ----
        (set-keymap-parent map (keymap-parent function-key-map))
        (set-keymap-parent function-key-map map))
  
+     ;; Do it!
+     (xterm-register-default-colors)
+     ;; This recomputes all the default faces given the colors we've just set 
up.
+     (tty-set-up-initial-frame-faces)))
+ 
  ;; Set up colors, for those versions of xterm that support it.
  (defvar xterm-standard-colors
    ;; The names in the comments taken from XTerm-col.ad in the xterm
*************** versions of xterm."
*** 366,376 ****
      ;; right colors, so clear them.
      (clear-face-cache)))
  
- ;; Do it!
- (xterm-register-default-colors)
- ;; This recomputes all the default faces given the colors we've just set up.
- (tty-set-up-initial-frame-faces)
- 
- )
  ;; arch-tag: 12e7ebdd-1e6c-4b25-b0f9-35ace25e855a
  ;;; xterm.el ends here
--- 374,378 ----
Index: startup.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/startup.el,v
retrieving revision 1.369
diff -c -3 -p -w -r1.369 startup.el
*** startup.el  22 Jul 2005 18:44:04 -0000      1.369
--- startup.el  25 Jul 2005 17:52:39 -0000
*************** or `CVS', and any subdirectory that cont
*** 977,990 ****
                window-system
                (null term-file-prefix))
      (let ((term (getenv "TERM"))
!           hyphend)
        (while (and term
!                   (not (load (concat term-file-prefix term) t t)))
!         ;; Strip off last hyphen and what follows, then try again
          (setq term
!               (if (setq hyphend (string-match "[-_][^-_]+$" term))
                    (substring term 0 hyphend)
!                 nil)))))
  
    ;; Update the out-of-memory error message based on user's key bindings
    ;; for save-some-buffers.
--- 977,992 ----
                window-system
                (null term-file-prefix))
      (let ((term (getenv "TERM"))
!           hyphend term-init-func)
        (while (and term
!                 (not (fboundp (setq term-init-func 
!                                     (intern (concat term 
"-initialize-terminal"))))))
              (setq term
!                   (if (setq hyphend (string-match "[-_+][^-_+]+$" term))
                        (substring term 0 hyphend)
!                     nil)))
!           (when (fboundp term-init-func)
!               (funcall term-init-func))))
  
    ;; Update the out-of-memory error message based on user's key bindings
    ;; for save-some-buffers.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]