Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!rochester!udel!burdvax!bpa!cbmvax!snark!eric From: eric@snark.UUCP Newsgroups: comp.emacs Subject: Re: UNIXPC emacs Message-ID: <135@snark.UUCP> Date: Mon, 24-Aug-87 10:39:30 EDT Article-I.D.: snark.135 Posted: Mon Aug 24 10:39:30 1987 Date-Received: Sat, 29-Aug-87 16:25:55 EDT References: <6622@eddie.MIT.EDU> <14104@topaz.rutgers.edu> <49@nancy.UUCP> Organization: Thyrsus Enterprises, Malvern PA 19355 Lines: 210 Summary: Here's how to do it. Discussion: <1832@super.upenn.edu> In article <259@cogent.UUCP>, mark@cogent.UUCP (Captain Neptune) writes: > >Does anyone have full-fledged 18.47 gnuemacs running (i.e., not microemacs) > >on an at&t UNIXPC > > Please post responses to this question, as myself and others are also > interested. O.K., here's how to do it. -------------------------------snip,snip,snip-------------------------------- Version: 18.41 Environment: AT&T 3B1 running the 3.5 system set and development tools. 1) Configuration glitches: I used "m-7300.h" and "s-5.2.h". I made the following modifications: #undef ADDR_CORRECT /* simply to suppress "redefined" msg */ #define LD_SWITCH_MACHINE -s -N /* permit unexec() to run properly */ #define SWITCH_ENUM_BUG /* Some "bug"! */ 2) Compilation glitches: In unexec.c, the compiler's code generator gets confused by the expressions used to compute bss_start and bss_end and generates incorrect assembler code. Here is the fix. The NOSCREWUP code is the original. 446a447 > #ifdef NOSCREWUP 447a449,452 > #else > bss_end = ADDR_CORRECT(sbrk(0)) + pagemask; > bss_end &= ~pagemask; > #endif 452c457,464 < bss_start = (ADDR_CORRECT (bss_start) + pagemask) & ~pagemask; /* (Up) to page bdry. */ --- > > /* (Up) to page bdry. */ > #ifdef NOSCREWUP > bss_start = (ADDR_CORRECT (bss_start) + pagemask) & ~pagemask; > #else > bss_start = ADDR_CORRECT(bss_start) + pagemask; > bss_start &= ~pagemask; > #endif 3) Lisp bogosities: The lpr package needs some trivial munging to work on System V, where the spooler is called 'lp'. The code should be conditional on the system-type variable; I won't even bother with a diff, it's like a 2 line change. And here's a terminal-support package for the AT&T 7300/3B1 console, which calls itself an 's4' (Convergent Technology's original code name for the machine was 'Safari 4'). XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ;; Map s4 function key escape sequences ;; into the standard slots in function-keymap where we can; ;; set up terminal-specific bindings where we must (require 'keypad) ;; First, map as many keys as possible to terminal-independent keycaps (defvar META-RB-map nil "The META-RB-map maps the ESC-[ function keys on the s4 keyboard.") (if (not META-RB-map) (progn (setq META-RB-map (lookup-key global-map "\e[")) (if (not (keymapp META-RB-map)) (setq META-RB-map (make-sparse-keymap))) ;; [ commands (setup-terminal-keymap META-RB-map '(("A" . ?u) ; up arrow ("B" . ?d) ; down-arrow ("C" . ?r) ; right-arrow ("D" . ?l) ; left-arrow ("U" . ?N) ; 'Page' -> next page ("V" . ?P) ; 'Shift-Page' -> prev page ("H" . ?h) ; 'Home' -> home-key ;; ("J" . ??) ; 'Clear' -> unmapped )))) (defun enable-arrow-keys () "Enable the use of the s4 arrow keys for cursor motion. Because of the nature of the s4, this unavoidably breaks the standard Emacs command ESC [; therefore, it is not done by default, but only if you give this command in your .emacs." (global-set-key "\e[" META-RB-map)) (defvar META-N-map nil "META-N-map maps the ESC-N function keys on the s4 keyboard.") (if (not META-N-map) (progn (setq META-N-map (lookup-key global-map "\eN")) (if (not (keymapp META-N-map)) (setq META-N-map (make-sparse-keymap))) ;; N commands (setup-terminal-keymap META-N-map '( ("a" . ?C) ; 'Rfrsh' -> redraw screen ;; ("A" . ??) ; 'Clear' -> unmapped ;; ("c" . ??) ; 'Move' -> unmapped ;; ("d" . ??) ; 'Copy' -> unmapped ;; ("B" . ??) ; 'Shift-Beg' -> unmapped ;; ("M" . ??) ; 'Shift-Home' -> unmapped ;; ("N" . ??) ; 'Shift-End' -> unmapped ("e" . ?k) ; 'Dlete' -> generic delete (kill-region) ("f" . ?.) ; 'Dlete Char' -> keypad . ("g" . ?1) ; 'Prev' -> keypad 1 (backward-word) ("h" . ?3) ; 'Next' -> keypad 3 (forward-word) ("i" . ?s) ; 'Mark' -> select ;; ("I" . ??) ; 'Select' -> MAPPED BELOW ;; ("j" . ??) ; 'Input Mode' -> unmapped )) (define-key global-map "\eN" META-N-map))) (defvar META-O-map nil "META-O-map maps the META-O function keys on the s4 keyboard.") (if (not META-O-map) (progn (setq META-O-map (lookup-key global-map "\eO")) (if (not (keymapp META-O-map)) (setq META-O-map (make-sparse-keymap))) ;; O commands (setup-terminal-keymap META-O-map '( ("a" . ?E) ; 'Clear-Line' -> Clear to EOL ("A" . ?S) ; 'Shift-Clear-Line' -> Clear to EOS ("b" . ?\C-@) ; 'Ref' -> function key 0 ("c" . ?\C-a) ; 'F1' -> function key 1 ("d" . ?\C-b) ; 'F2' -> function key 2 ("e" . ?\C-c) ; 'F3' -> function key 3 ("f" . ?\C-d) ; 'F4' -> function key 4 ("g" . ?\C-e) ; 'F5' -> function key 5 ("h" . ?\C-f) ; 'F6' -> function key 6 ("i" . ?\C-g) ; 'F7' -> function key 7 ("j" . ?\C-h) ; 'F8' -> function key 8 ;; ("k" . ??) ; 'Exit' -> MAPPED BELOW ("m" . ??) ; 'Help' -> help-command ;; ("n" . ??) ; 'Creat' -> unmapped ;; ("o" . ??) ; 'Save' -> MAPPED BELOW ;; ("r" . ??) ; 'Opts' -> unmapped ;; ("s" . ??) ; 'Undo' -> MAPPED BELOW ("t" . ?x) ; 'Redo' -> 'do' key ;; ("u" . ??) ; 'Cmd' -> MAPPED BELOW ;; ("v" . ??) ; 'Open' -> MAPPED BELOW ;; ("V" . ??) ; 'Close' -> unmapped ;; ("w" . ??) ; 'Cancel' -> MAPPED BELOW ("x" . ?f) ; 'Find' -> find/replace ;; ("y" . ??) ; 'Rplac' -> MAPPED BELOW ;; ("z" . ??) ; 'Print' -> MAPPED BELOW )) (define-key global-map "\eO" META-O-map))) (defvar META-P-map nil "META-P-map maps the META-P function keys on the s4 keyboard.") (if (not META-P-map) (progn (setq META-P-map (lookup-key global-map "\eP")) (if (not (keymapp META-P-map)) (setq META-P-map (make-sparse-keymap))) ;; P commands (setup-terminal-keymap META-P-map '( ("a" . ?1) ; Ctrl-1 -> keypad 1 ("b" . ?2) ; Ctrl-2 -> keypad 2 ("c" . ?3) ; Ctrl-3 -> keypad 3 ("d" . ?4) ; Ctrl-4 -> keypad 4 ("e" . ?5) ; Ctrl-5 -> keypad 5 ("f" . ?6) ; Ctrl-6 -> keypad 6 ("g" . ?7) ; Ctrl-7 -> keypad 7 ("h" . ?8) ; Ctrl-8 -> keypad 8 ("i" . ?9) ; Ctrl-9 -> keypad 9 ("j" . ?0) ; Ctrl-0 -> keypad 0 ("k" . ?-) ; Ctrl-- -> keypad - )) (define-key global-map "\eP" META-P-map))) ;; Now do terminal-specific mappings of keys with no standard-keycap equivalent (define-key esc-map "9" 'beginning-of-buffer) ;'Begin' (define-key esc-map "0" 'end-of-buffer) ;'End' (define-key META-N-map "I" 'narrow-region) ;'Select' (define-key META-O-map "k" 'save-buffers-kill-emacs) ;'Exit' (define-key META-O-map "o" 'save-buffer) ;'Save' (define-key META-O-map "s" 'undo) ;'Undo' (define-key META-O-map "u" 'execute-extended-command) ;'Cmd' (define-key META-O-map "v" 'find-file) ;'Open' (define-key META-O-map "w" 'keyboard-quit) ;'Cancl' (define-key META-O-map "y" 'regexp-replace) ;'Rplac' (define-key META-O-map "z" 'lpr-buffer) ;'Print' XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -------------------------------snip,snip,snip-------------------------------- Eric S. Raymond UUCP: {{seismo,ihnp4,rutgers}!cbmvax,sdcrdcf!burdvax,vu-vlsi}!snark!eric Post: 22 South Warren Avenue, Malvern, PA 19355 Phone: (215)-296-5718 -- Eric S. Raymond UUCP: {{seismo,ihnp4,rutgers}!cbmvax,sdcrdcf!burdvax,vu-vlsi}!snark!eric Post: 22 South Warren Avenue, Malvern, PA 19355 Phone: (215)-296-5718