Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!kowalski From: kowalski@svax.cs.cornell.edu (Jeffrey Kowalski) Newsgroups: comp.emacs Subject: EDT/TPU Emulator for GNU Emacs (tpu.el) Message-ID: <34798@cornell.UUCP> Date: 3 Dec 89 00:02:29 GMT Sender: nobody@cornell.UUCP Reply-To: kowalski@svax.cs.cornell.edu (Jeffrey Kowalski) Organization: Cornell Univ. CS Dept, Ithaca NY Lines: 2109 Hack, hack, hack. This represents a serious series of hacks to edt.el (as supplied with GNU Emacs) in order to more closely simulate the edt editor. I was wrong when I called it a TPU emulator. TPU would be tough to emulate in Emacs since TPU is a language. What I meant was that tpu.el simualtes the EDT interface to TPU. Well, with a few extensions. There's a truly nice new style of abbrevs that uses alists. Try typing the partial word "Heu", then GOLD-H a few times. See where the cursor goes? I don't have up to date docs for my toy, but I'll include what I gave the students last semester, along with tpu.el Have fun, mail me bugs, questions, chocolate chip cookies. Jeff CADIF Swamp 172 Hollister Hall Cornell University Ithaca, NY 14853 ---------- GUIDE --------- The long-heralded emulation of the highly acclaimed BOBTPU is here! What is bobtpu? It's simply the most extended editor ever. Written by system programmer par-excellence Bob Covey, it was formerly available only on VMS systems supporting tpu. Now, through the miracle of modern pharmaceuticals, Jeff Kowalski has just completed a complete emulation of the incredible editor under Unix. That's right, UNIX! For the first time ever in the history of CADIF, the Unix user, previously hindered by such evil tortures as vi and ed, will finally be able to complete work! "How can I, so simple an undeserving a student, gain access to the fruits of Jeff's laudable accomplishment?" Well, I will tell you. But first, you must suffer through the incredible mind-expanding description of what the bobtpu emulator can do for you (or you must turn the page). Firstly, the bobtpu emulator (hereafter called bobtpu) is written in elisp, which is the emacs native language. This means that the behind-the-scenes editor is GNU Emacs, not VAX TPU. There are, therefore, a few subtle differences between VMS bobtpu and Unix bobtpu. For the most part, however, you'll probably never notice. If you have questions, you should refer to both the EDT and Emacs guides. Ask the room monitor for them. At the very least, bobtpu is an EDT emulator. That means that the arrows work and the keypad at the right has special meaning, among other things. If you are not familiar with EDT, ask the room monitor for information (a manual or online CAI on VMS). In addition to the basics of EDT, bobtpu provides all of these extras: TERMINOLOGY The GOLD key is the PF1 key on DEC-style keyboards, F9 on SGI style keyboards. It is not a modifier in the same sense as the shift or control keys: you don't hold it down while striking another key, you simply strike it first. Thus GOLD-a means strike PF1, then the letter "a." On the VMS version, GOLD-a and GOLD-A are equivalent. On my unix version, the letters are different, so we have twice the functionality. In general, the lowercase version is the same as the VMS version, while the uppercase version, since it is harder to type, performs an extended operation, or an operation with no query. For example, GOLD-q quits, but asks about saving unsaved files first; GOLD-Q quits without asking. In the cases where case is insignificant, I will represent the sequence as GOLD-[Aa] which means use either case. If you get stuck in some crazy mode, you can type CTRL-G (cancel) to get out. So if you're being prompted for a filename and you don't know why (ie you're lost), just hit a CTRL-G. MULTIPLE FILES It is possible to edit many files at a time. They may be entered using wildcards or lists on the command line. Any files which are not found and do not contain wildcards will be created and marked as modified. You are placed in the first file read/created (if no files are found and all specifications have wildcards, you will be placed in a default buffer). The files are marked for update on exit. A status line shows information about the current buffer, just as in Emacs. The easiest way to move between files is by hitting GOLD-W to "walk" to the next one. GOLD-w will "walk" to the previous one. GOLD-f will ask you for the name of a file to jump to, it will try to find one it has that best matches the name you give. GOLD-F will do the same, but will show the selected buffer in another window. You can add more files to the list (just as if you had included them on the original edit command) by hitting GOLD-e. It will prompt for the file(s), which may contain wildcards/lists. The new files will be marked for update on exit. There is and equivalent line-mode "find-file filespec(s)". GOLD-E will read the file into another window. CTRL-F allows you to specify a new filename to be attached to the current buffer. Hitting GOLD-[Uu] will change the update mode of a buffer. Only those buffers marked with the double star in the status line will be written out on exit. GOLD-[Bb] will generate a list of the current buffers. The list will show a dot in the first column to indicate the current buffer, a star in the second for each buffer that has been modified, and a "%" in the third if the buffer is marked readonly. It also shows the number of characters in each buffer and the filename and mode associated with it. GOLD-[Ii] is a handy shorthand for the line mode "insert-file filename" command. It will prompt for the name of a file, which is included into the current buffer immediately after the current cursor location. The file name specified may contain wildcards and/or lists. GOLD-CTRL-W allows you to have the current versions of all buffers written out (saved), without exiting the editor. GOLD-k will throw away the current buffer and move onto the next, but will ask for confirmation first. GOLD-K doesn't ask. Be really careful... SHELL COMMANDS It is possible to execute shell commands from within the editor, and get the results. Hitting GOLD-[Dd] will prompt you for a shell command, then place you in the shell buffer. The command is executed in a subprocess in that other buffer. Commands which try to take over the screen (such as talk) may not work. DEFINING KEYS Defining keys is almost the same as in EDT, the only major difference is that it executes the keys as you build the definition -- you don't have to try to visualize what the sequence will do. The definitions properly handle repeat counts (even if you use a repeat count on a defined key containing a repeat on some other keys), and execution of a key definition halts immediately if it encounters any error (string not found, move past end of buffer, etc.). SUBSTITUTIONS GOLD-s or GOLD-/ allows you to easily specify a substitution. It will prompt for the old string you want to replace, and the new replacement string. Then, the function will pause at each occurence of the original and wait for a response. Typical responses are "Y" (replace), "N" (don't replace), "Q" (stop replacing). For more information, see the Emacs manual under query-replace. GOLD-S will replace all the old strings with the new ones, without asking for any confirmation. AUTO-TAB When enabled (disabled by default), hitting RETURN will act as if you hit RETURN, followed by appropriate spacing if the resulting line is blank. TAB at the beginning of a line (still in the whitespace) will re-indent the line according to the language you are using. TAB anywhere in the text is still a tab. GOLD-[Aa] is provided as an easy way to toggle autotab mode on and off. OTHER GOLD-DEL (GOLD-BS on some) will remove the current window, if it's not the only one. CTRL-X 1 will make the current window the only one, by removing all the others. Remember, buffers and windows are not the same thing. Don't worry: removing a window doesn't erase that buffer! You can get help at any time by pressing the HELP key on VT200 keyboards, or using "GOLD-KP7 info RETURN" You can get the description of any key's function by using the PF2 key, then pressing a key sequence. Neat, huh? As with normal EDT at CADIF, GOLD-q and GOLD-x provide any easy way to quit without saving any changes or exit & write out all buffers marked update which have been modified. The lowercase versions ask for confirmation if necessary; GOLD-Q and GOLD-X do not. Be careful... GOLD-[Yy] is defined to copy the selected region into the paste buffer. It is similar to the CUT command, but you don't have to paste the text back in, and it doesn't mark the buffer as changing. GOLD-CTRL-L and GOLD-CTRL-U act the same as CHANGE CASE (GOLD-KP1), except that all the text is forced to be lower or upper case instead of switching to the opposite case. GOLD-UP and GOLD-DOWN will move up or down a full screen. GOLD-LEFT and GOLD-RIGHT will ask you for a new screen size, in case your terminal is screwed up. GOLD-SPACE is an undo. You can typically undo about 500 major changes. After that, you're on your own. GOLD-~ swaps the current location with the other end of the selected region, allowing you to check where it is or easily adjust both ends. ADVANCED FUNCTIONS And now some more advanced (pronounced "bizarre") definitions... MARKERS GOLD-. (keyboard period, not the one on the keypad) will set a marker that can be returned to later using GOLD-, (also not the one on the keypad). You may use a repeat count to specify which marker (1 is normally the default). On DEC-style keyboards, the keys F17-F20 retrieve markers 2 through 5 automatically, and GOLD-F17 through GOLD-F20 insert them. Pretty convenient, huh? SEARCH PATTERNS GOLD-' or GOLD-" will allow you to search for a regular expression instead of just a simple string. The pattern matching is relatively powerful, but takes a little practice. See a good Unix manual (ha!) for more details on patterns. After a pattern search is entered, FIND NEXT (PF3) may be used to search with the same pattern. MATCH DELIMITERS The VMS version of bobtpu has special keys for matching delimiters. The unix version does it constantly, by blinking on the matching open delimiter briefly. For example, if you type a closing brace (}) in c-mode, the editor rests the cursor briefly on the mathing opening brace, then returns the cursor to its proper place. COUNTERS There is an internal counter that may be useful. GOLD-= will set the counter to the repeat count, zero if not specified. GOLD-> and GOLD-< will increment and decrement the counter by the repeat count (1 by default). GOLD-# will copy the value of the counter into the buffer using the current format, which is C-like format that may be changed using GOLD-! (the default is %d). GOLD-* inserts the ASCII character corresponding to the counter value (mod 256). TEXT EXPANSION GOLD-h (also DO on VT200-style keyboards or F1 on SGI-styles) will invoke an automatic text expander. This will search a special list for the word which is under the cursor. If it finds a line containing the word (called the key), the word is replaced by a "tag". Repeating will find successive occurrences, replacing the text each time. If no more matches are found, it will restore the original word. For instance, if you enter "open", it might first replace "open" with "HC_Open_Segment ();", then "HC_KOpen_Segment ();", and then return to "open" if requested a third time. Gold-DO or GOLD-H will cause the original text to be restored. Currently, all the HOOPS commands are in the list. If you'd like to add more, I'll provide a facility for doing so. SPELLING CHECKER If spell has been installed on the system it can be invoked to check all or part of a file/buffer. The simplest means of using it is to use GOLD-?. This will cause it to generate Spell as a subprocess and have it check the selected region, or the whole buffer if no region was selected. If any changes are made in Spell and then saved, the changes will be incorporated back into the editor. NUMERIC KEYPAD GOLD-$ toggles between numeric keypad mode (the digits and punctuation characters on the keypad merely insert the corresponding text into the buffer) and function mode (the keypad keys have their normal editing functions). LINE MODE You can enter commands directly to the emulator with GOLD-KP7. You can evaluate elisp s-espressions with GOLD-PF2. ** If for some obscure reason you want plain emacs, ** you can type "GOLD-KP7 cancel-tpu" ** Use "ESC-X use-tpu" to get it back. --------- tpu.el -------- ;;; ;;; ;;; ;;; E D T / B O B T P U ;;; Editor Definitions ;;; Jeff Kowalski ;;; November, 1988 ;;; ;;; Based on the edt.el ;;; ;;; ;; Copyright (C) 1989 Free Software Foundation, Inc. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY. No author or distributor ;; accepts responsibility to anyone for the consequences of using it ;; or for whether it serves any particular purpose or works at all, ;; unless he says so in writing. Refer to the GNU Emacs General Public ;; License for full details. ;; Everyone is granted permission to copy, modify and redistribute ;; GNU Emacs, but only under the conditions described in the ;; GNU Emacs General Public License. A copy of this license is ;; supposed to have been given to you along with GNU Emacs so you ;; can know your rights and responsibilities. It should be in a ;; file named COPYING. Among other things, the copyright notice ;; and this notice must be preserved on all copies. ;;; ;;; ;;; ;;; G L O B A L ;;; K E Y M A P S ;;; ;;; (defvar CSI-map nil "Maps the CSI function keys on the VT100 keyboard. CSI is DEC's name for the sequence [.") (setq CSI-map (make-sparse-keymap)) (defvar APPLE-map nil "Maps the Apple Extended Keyboard function keys. The sequence begins with CTRL-A.") (setq APPLE-map (make-sparse-keymap)) (defvar DCS-map nil "Maps the DCS function keys on the iris-ansi keyboard. DCS is SGI's name for the sequence P.") (setq DCS-map (make-sparse-keymap)) (defvar SS3-map nil "Maps the SS3 function keys on the VT100 keyboard. SS3 is DEC's name for the sequence O.") (setq SS3-map (make-sparse-keymap)) (defvar GOLD-map nil "Maps the function keys on the VT100 keyboard preceeded by PF1. GOLD is the ASCII 7-bit escape sequence OP.") (setq GOLD-map (make-sparse-keymap)) (defvar GOLD-APPLE-map nil "Maps the function keys on the Apple Keyboard preceeded by F9 CTRL-A.") (setq GOLD-APPLE-map (make-sparse-keymap)) (defvar GOLD-CSI-map nil "Maps the function keys on the VT100 keyboard preceeded by GOLD-CSI.") (setq GOLD-CSI-map (make-sparse-keymap)) (defvar GOLD-SS3-map nil "Maps the function keys on the VT100 keyboard preceeded by GOLD-SS3.") (setq GOLD-SS3-map (make-sparse-keymap)) ;;; ;;; ;;; G L O B A L ;;; V A R I A B L E S ;;; ;;; (defvar tpu-global-key-plist nil "Original pre-tpu definitions of global keys, so they may be restored.") (defvar tpu-breadcrumb-plist nil "The set of user-defined markers (breadcrumbs), as a plist.") (defvar tpu-current-expansion nil "The expansion that was last performed.") (defvar tpu-last-expand-point 0 "The position at which the last bob-expand was performed.") (defvar tpu-expand-key "" "The key for which the last expansion was performed.") (defvar tpu-counter 0 "A general-purpose counter available for the user.") (defvar tpu-counter-format "%d" "The format to use to when displaying the tpu-counter.") (defvar tpu-last-replaced-text "" "Last text deleted by an TPU emulation replace command.") (defvar tpu-last-deleted-lines "" "Last text deleted by an TPU emulation line-delete command.") (defvar tpu-last-deleted-words "" "Last text deleted by an TPU emulation word-delete command.") (defvar tpu-last-deleted-chars "" "Last text deleted by an TPU emulation character-delete command.") (defvar tpu-search-last-string "" "Last text searched by the tpu-search commands.") (defvar newline-and-indent-p nil "Predicate: return produces a newline and indent.") ;;; ;;; ;;; U T I L I T I E S ;;; ;;; (defun caar (thingy) (car (car thingy))) (defun cadr (thingy) (car (cdr thingy))) (defun cadar (thingy) (car (cdr (car thingy)))) (defun caddar (thingy) (car (cdr (cdr (car thingy))))) ;;; ;;; Bob-expand ;;; (defun bob-unexpand nil "Cancels current expansion." (interactive) (cond ((and (= (point) tpu-last-expand-point) (string= (cadar tpu-current-expansion) (buffer-substring (- (point) (length (cadar tpu-current-expansion)) (caddar tpu-current-expansion)) (- (point) (caddar tpu-current-expansion))))) (backward-char (caddar tpu-current-expansion)) (backward-delete-char (length (cadar tpu-current-expansion))) (insert tpu-expand-key) (message "Cancelled.") (setq tpu-last-expand-point 0)) (t (message "No expansion to cancel.")))) (defun bob-expand nil "Expand the word before the point." (interactive) (let ((beg (point)) (old-syntax (char-syntax 95)) (not-found t)) (cond ((and (= (point) tpu-last-expand-point) (string= (cadar tpu-current-expansion) (buffer-substring (- (point) (length (cadar tpu-current-expansion)) (caddar tpu-current-expansion)) (- (point) (caddar tpu-current-expansion))))) (backward-char (caddar tpu-current-expansion)) (backward-delete-char (length (cadar tpu-current-expansion))) (setq tpu-current-expansion (cdr tpu-current-expansion))) (t (setq tpu-current-expansion tpu-expansions) (modify-syntax-entry 95 "w") (forward-word -1) (modify-syntax-entry 95 (char-to-string old-syntax)) (setq tpu-expand-key (buffer-substring (point) beg)) (delete-region beg (point)))) (while (and tpu-current-expansion not-found) (if (string-match tpu-expand-key (caar tpu-current-expansion)) (setq not-found nil) (setq tpu-current-expansion (cdr tpu-current-expansion)))) (cond (tpu-current-expansion (insert (cadar tpu-current-expansion)) (forward-char (caddar tpu-current-expansion)) (setq tpu-last-expand-point (point))) (t (insert tpu-expand-key) (message "Not found.") (setq tpu-last-expand-point 0))))) ;;; ;;; Breadcrumbs ;;; (defun drop-breadcrumb (num) "Drops a breadcrumb that can be returned to later with goto-breadcrumb." (interactive "p") (put tpu-breadcrumb-plist num (list (current-buffer) (point))) (message "Mark %d set." num)) (defun goto-breadcrumb (num) "Returns to a breadcrumb set with goto-breadcrumb." (interactive "p") (cond ((get tpu-breadcrumb-plist num) (switch-to-buffer (car (get tpu-breadcrumb-plist num))) (goto-char (cadr (get tpu-breadcrumb-plist num))) (message "mark %d found." num)) (t (message "mark %d not found." num)))) (defun drop-breadcrumb-2 nil "drops breadcrumb number 2 at the point." (interactive) (drop-breadcrumb 2)) (defun drop-breadcrumb-3 nil "drops breadcrumb number 3 at the point." (interactive) (drop-breadcrumb 3)) (defun drop-breadcrumb-4 nil "drops breadcrumb number 4 at the point." (interactive) (drop-breadcrumb 4)) (defun drop-breadcrumb-5 nil "drops breadcrumb number 5 at the point." (interactive) (drop-breadcrumb 5)) (defun goto-breadcrumb-2 nil "goto breadcrumb number 2." (interactive) (goto-breadcrumb 2)) (defun goto-breadcrumb-3 nil "goto breadcrumb number 3." (interactive) (goto-breadcrumb 3)) (defun goto-breadcrumb-4 nil "goto breadcrumb number 4." (interactive) (goto-breadcrumb 4)) (defun goto-breadcrumb-5 nil "goto breadcrumb number 5." (interactive) (goto-breadcrumb 5)) ;;; ;;; miscellaneous ;;; (defun replace-global-key (key func) "Saves the current global key definition and replaces it with a new one." (interactive) (if (not (get tpu-global-key-plist key)) (put tpu-global-key-plist key func)) (define-key global-map key func)) (defun restore-global-key (key) "Restores the original definition of a global key." (interactive) (define-key global-map key (get tpu-global-key-plist key))) (defun case-flip (num) "Change the case of the character under the cursor or region. accepts a prefix argument of the number of characters to invert." (interactive "p") (if (mark) (let ((end (max (mark) (point))) (point-save (point))) (goto-char (min (point) (mark))) (while (not (eq (point) end)) (funcall (if (<= ?a (following-char)) 'upcase-region 'downcase-region) (point) (1+ (point))) (forward-char 1)) (goto-char point-save)) (progn (if (string= tpu-direction-string " backup") (backward-char num)) (while (> num 0) (funcall (if (<= ?a (following-char)) 'upcase-region 'downcase-region) (point) (1+ (point))) (forward-char 1) (setq num (1- num)))))) (defun indent-or-fill-region nil "fill region in text modes, indent region in programming language modes." (interactive) (if (string= paragraph-start "^$\\|^ ") (indent-region (point) (mark) nil) (fill-region (point) (mark)))) (defun mark-section-wisely nil "mark the section in a manner consistent with the major-mode. uses mark-defun for emacs-lisp, lisp, mark-c-function for c, and mark-paragraph for other modes." (interactive) (cond ((eq major-mode 'emacs-lisp-mode) (mark-defun)) ((eq major-mode 'lisp-mode) (mark-defun)) ((eq major-mode 'c-mode) (mark-c-function)) (t (mark-paragraph)))) (defun update-mode-line nil "make sure mode-line in the current buffer reflects all changes." (set-buffer-modified-p (buffer-modified-p)) (sit-for 0)) (defun reset-screen-size (height width) "sets screen size." (interactive "nnew screen height: \nnnew screen width: ") (set-screen-height height) (set-screen-width width)) (defun toggle-newline-and-indent nil "toggle between 'newline and indent' and 'simple newline'." (interactive) (cond (newline-and-indent-p (setq newline-and-indent-p-string "") (setq newline-and-indent-p nil) (global-set-key "\c-m" 'newline)) (t (setq newline-and-indent-p-string " autoindent") (setq newline-and-indent-p t) (global-set-key "\c-m" 'newline-and-indent))) (update-mode-line)) (defun spell-check nil "checks the spelling of the region, or of the entire buffer if no region is selected." (interactive) (cond ((= (point) (mark)) (spell-buffer)) (t (spell-region (point) (mark))))) (defun report-position nil "prints a message in the minibuffer that shows the current position of the point in the buffer." (interactive) (message "char %d line %d %d%%" (point) (1+ (count-lines 1 (point))) (/ (* 100 (point)) (point-max)))) (defun unset-mark-command nil "Remove current mark." (interactive) (setq mark-ring nil) (set-mark nil) (message "Mark unset.")) (defun quit-emacs-now nil "Go away. Now. Just g o a w a y." (interactive) (kill-emacs t)) ;;; ;;; Auto-insert ;;; (defun insert-escape nil "Inserts an escape character, and so becomes the escape-key alias." (interactive) (insert "\e")) (defun insert-formfeed nil "Inserts a formfeed character." (interactive) (insert "\C-L")) ;;; ;;; Define key ;;; (defun end-define-macro-key nil "Ends the current macro definition" (interactive) (end-kbd-macro nil) (global-set-key defining-key last-kbd-macro) (global-set-key "\eOM" 'newline)) (defun define-macro-key (key) "Bind a set of keystrokes to a single key." (interactive "kKey to define: ") (setq defining-key key) (global-set-key "\eOM" 'end-define-macro-key) (start-kbd-macro nil)) ;;; ;;; Counter ;;; (defun set-counter nil "Set the internal counter to the repeat count." (interactive) (message "Counter set to %d." (setq tpu-counter current-prefix-arg))) (defun region-length-to-counter nil "Sets the counter to the length of the region." (interactive) (cond ((mark) (message "Counter set to %d." (setq tpu-counter (- (max (point) (mark)) (min (point) (mark)))))) (t (message "The mark is not set now; no select range is active.")))) (defun decr-counter nil "Decrement the internal counter by the repeat count, or by one if no repeat count is defined." (interactive) (message "Counter set to %d." (setq tpu-counter (- tpu-counter (or current-prefix-arg 1))))) (defun incr-counter nil "Increment the internal counter by the repeat count, or by one if no repeat count is defined." (interactive) (message "Counter set to %d." (setq tpu-counter (+ tpu-counter (or current-prefix-arg 1))))) (defun change-counter-format (fmt) "Changes the display format for use when inserting the internal tpu counter. You may use standard C format expressions." (interactive "sFormat (C-like):") (setq tpu-counter-format fmt)) (defun insert-counter nil "Inserts the internal tpu counter using the tpu counter format." (interactive) (insert (format tpu-counter-format tpu-counter))) (defun insert-counter-as-char nil "Inserts the character value (mod 256) of the internal tpu counter." (interactive) (insert (mod tpu-counter 256))) ;;; ;;; Buffer ;;; (defun set-buffer-clean nil "Toggles the update mode of the buffer." (interactive) (set-buffer-modified-p (not (buffer-modified-p)))) (defun kill-this-buffer nil "Kills the current buffer, but ask first." (interactive) (if (y-or-n-p (format "Really kill %s? " (current-buffer))) (kill-buffer (current-buffer)))) (defun kill-this-buffer-now nil "Kills the current buffer without asking." (interactive) (kill-buffer (current-buffer))) (defun save-all-buffers-kill-emacs nil "Save all buffers and exit emacs." (interactive) (setq trim-versions-without-asking t) (save-buffers-kill-emacs t)) (defun write-current-buffers nil "Save all modified buffers without exiting." (interactive) (save-some-buffers t)) (defun next-buffer nil "Go to next buffer in ring." (interactive) (switch-to-buffer (car (reverse (buffer-list))))) (defun switch-to-last-buffer nil "Go to most recent buffer in ring." (interactive) (switch-to-buffer (cadr (buffer-list)))) ;;; ;;; Repeat count ;;; (defun repeat-command-0 nil "Repeats the following keystroke." (interactive) (prefix-arg-internal 48 nil nil)) (defun repeat-command-1 nil "Repeats the following keystroke." (interactive) (prefix-arg-internal 49 nil nil)) (defun repeat-command-2 nil "Repeats the following keystroke." (interactive) (prefix-arg-internal 50 nil nil)) (defun repeat-command-3 nil "Repeats the following keystroke." (interactive) (prefix-arg-internal 51 nil nil)) (defun repeat-command-4 nil "Repeats the following keystroke." (interactive) (prefix-arg-internal 52 nil nil)) (defun repeat-command-5 nil "Repeats the following keystroke." (interactive) (prefix-arg-internal 53 nil nil)) (defun repeat-command-6 nil "Repeats the following keystroke." (interactive) (prefix-arg-internal 54 nil nil)) (defun repeat-command-7 nil "Repeats the following keystroke." (interactive) (prefix-arg-internal 55 nil nil)) (defun repeat-command-8 nil "Repeats the following keystroke." (interactive) (prefix-arg-internal 56 nil nil)) (defun repeat-command-9 nil "Repeats the following keystroke." (interactive) (prefix-arg-internal 57 nil nil)) (defun repeat-command-- nil "Repeats the following keystroke." (interactive) (prefix-arg-internal 45 nil nil)) ;;; ;;; Search ;;; (defun tpu-search-forward (pat) "Search for a string." (interactive "sSearch: ") (setq tpu-search-last-string (if (not (string= "" pat)) pat (read-string "Search: "))) (search-forward tpu-search-last-string)) (defun tpu-search-backward (pat) "Search for a string." (interactive "sSearch: ") (setq tpu-search-last-string (if (not (string= "" pat)) pat (read-string "Search: "))) (search-backward tpu-search-last-string)) (defun search-again-forward nil "Search for the same string as last time." (interactive) (tpu-search-forward tpu-search-last-string)) (defun search-again-backward nil "Search for the same string as last time." (interactive) (tpu-search-backward tpu-search-last-string)) ;;; ;;; Delete ;;; (defun delete-current-line (num) "Delete one or specified number of lines after point. This includes the newline character at the end of each line. They are saved for the TPU undelete-lines command." (interactive "p") (let ((beg (point))) (forward-line num) (if (not (eq (preceding-char) ?\n)) (insert "\n")) (setq tpu-last-deleted-lines (buffer-substring beg (point))) (delete-region beg (point)))) (defun delete-to-eol (num) "Delete text up to end of line. With argument, delete up to to Nth line-end past point. They are saved for the TPU undelete-lines command." (interactive "p") (let ((beg (point))) (forward-char 1) (end-of-line num) (setq tpu-last-deleted-lines (buffer-substring beg (point))) (delete-region beg (point)))) (defun delete-to-bol (num) "Delete text back to beginning of line. With argument, delete up to to Nth line-end past point. They are saved for the TPU undelete-lines command." (interactive "p") (let ((beg (point))) (backward-char 1) (beginning-of-line num) (setq tpu-last-deleted-lines (buffer-substring (point) beg)) (delete-region (point) beg))) (defun delete-current-word (num) "Delete one or specified number of words after point. They are saved for the TPU undelete-words command." (interactive "p") (let ((beg (point))) (forward-word num) (setq tpu-last-deleted-words (buffer-substring beg (point))) (delete-region beg (point)))) (defun delete-previous-word (num) "Delete one or specified number of words before point. They are saved for the TPU undelete-words command." (interactive "p") (let ((beg (point))) (forward-word (- num)) (setq tpu-last-deleted-words (buffer-substring (point) beg)) (delete-region beg (point)))) (defun delete-current-char (num) "Delete one or specified number of characters after point. They are saved for the TPU undelete-chars command." (interactive "p") (setq tpu-last-deleted-chars (buffer-substring (point) (min (point-max) (+ (point) num)))) (delete-region (point) (min (point-max) (+ (point) num)))) (defun delete-previous-char (num) "Delete one or specified number of characters before point. They are saved for the TPU undelete-chars command." (interactive "p") (setq tpu-last-deleted-chars (buffer-substring (max (point-min) (- (point) num)) (point))) (delete-region (max (point-min) (- (point) num)) (point))) (defun append-region nil "Deletes selected region and appends it to the current kill ring entry." (interactive) (append-next-kill) (kill-region (mark) (point))) ;;; ;;; Undelete ;;; (defun replace nil "Deletes text in selected range and replaces it with contents of kill ring." (interactive) (setq tpu-last-replaced-text (buffer-substring (point) (mark))) (delete-region (point) (mark)) (yank)) (defun undelete-lines nil "Yank lines deleted by last TPU line-deletion command." (interactive) (insert tpu-last-deleted-lines)) (defun undelete-words nil "Yank words deleted by last TPU word-deletion command." (interactive) (insert tpu-last-deleted-words)) (defun undelete-chars nil "Yank characters deleted by last TPU character-deletion command." (interactive) (insert tpu-last-deleted-chars)) ;;; ;;; Position ;;; (defun next-end-of-line (num) "Move to end of line; if at end, move to end of next line. Accepts a prefix argument for the number of lines to move." (interactive "p") (forward-char) (end-of-line num)) (defun next-beginning-of-line (num) "Move to beginning of line; if at beginning, move to beginning of next line. Accepts a prefix argument for the number of lines to move." (interactive "p") (backward-char) (beginning-of-line num)) (defun previous-end-of-line (num) "Move EOL upward. Accepts a prefix argument for the number of lines to move." (interactive "p") (end-of-line (- 1 num))) (defun forward-to-word (num) "Move to next word-beginning, or to Nth following word-beginning." (interactive "p") (forward-word (1+ num)) (forward-word -1)) (defun backward-to-word (num) "Move back to word-end, or to Nth word-end seen." (interactive "p") (forward-word (- (1+ num))) (forward-word 1)) (defun backward-line (num) "Move point to start of previous line. Prefix argument serves as repeat-count." (interactive "p") (forward-line (- num))) (defun next-paragraph (num) "Move to beginning of the next indented paragraph. Accepts a prefix argument for the number of paragraphs." (interactive "p") (while (> num 0) (next-line 1) (forward-paragraph) (previous-line 1) (if (eolp) (next-line 1)) (setq num (1- num)))) (defun previous-paragraph (num) "Move to beginning of previous indented paragraph. Accepts a prefix argument for the number of paragraphs." (interactive "p") (while (> num 0) (backward-paragraph) (previous-line 1) (if (eolp) (next-line 1)) (setq num (1- num)))) (defun move-to-beginning nil "Move cursor to the beginning of buffer, but don't set the mark." (interactive) (goto-char (point-min))) (defun move-to-end nil "Move cursor to the end of buffer, but don't set the mark." (interactive) (goto-char (point-max))) (defun goto-percent (perc) "Move point to ARG percentage of the buffer." (interactive "NGoto-percentage: ") (if (or (> perc 100) (< perc 0)) (error "Percentage %d out of range 0 < percent < 100" perc) (goto-char (/ (* (point-max) perc) 100)))) ;;; ;;; Window ;;; (defun scroll-window-down (num) "Scroll the display down a window-full. Accepts a prefix argument for the number of window-fulls to scroll." (interactive "p") (scroll-down (- (* (window-height) num) 2))) (defun scroll-window-up (num) "Scroll the display up a window-full. Accepts a prefix argument for the number of window-fulls to scroll." (interactive "p") (scroll-up (- (* (window-height) num) 2))) (defun beginning-of-window nil "Home cursor to top of window." (interactive) (move-to-window-line 0)) (defun line-to-bottom-of-window nil "Move the current line to the bottom of the window." (interactive) (recenter -1)) (defun line-to-top-of-window nil "Move the current line to the top of the window." (interactive) (recenter 0)) ;;; ;;; Keyboard-style specific ;;; (defun DEC-mode nil "Defines the DEC style keyboard." (interactive) (define-key global-map "\C-h" 'next-beginning-of-line) ; ^H (BS) (define-key CSI-map "C" 'backward-char) ; right (define-key CSI-map "D" 'forward-char) ; left ) (defun SGI-mode nil "Defines the SGI style keyboard." (interactive) (define-key global-map "\C-h" 'backward-delete-char) ; ^H (BS) (define-key CSI-map "C" 'forward-char) ; left (define-key CSI-map "D" 'backward-char) ; right (define-key CSI-map "001q" 'bob-expand) ; F1 IRIS4D ) ;;; ;;; Direction ;;; (defun advance-direction nil "Set TPU Advance mode so keypad commands move forward." (interactive) (setq tpu-direction-string " advance") (define-key CSI-map "1~" 'isearch-forward) ; Find (define-key SS3-map "R" 'search-again-forward) ; PF3 (define-key APPLE-map "J\C-M" 'search-again-forward) ; Apple F11 (define-key SS3-map "p" 'forward-line) ; KP0 (define-key SS3-map "q" 'forward-to-word) ; KP1 (define-key SS3-map "r" 'next-end-of-line) ; KP2 (define-key SS3-map "s" 'forward-char) ; KP3 (define-key SS3-map "w" 'next-paragraph) ; KP7 (define-key SS3-map "x" 'scroll-window-up) ; KP8 (define-key GOLD-map "'" 'isearch-forward-regexp) ; ' (define-key GOLD-map "\"" 'isearch-forward-regexp) ; " (define-key GOLD-SS3-map "R" 'tpu-search-forward) ; PF3 (define-key GOLD-APPLE-map "J\C-M" 'tpu-search-forward) ; Apple F11 (update-mode-line)) (defun backup-direction nil "Set TPU Backup mode so keypad commands move backward." (interactive) (setq tpu-direction-string " backup") (define-key CSI-map "1~" 'isearch-backward) ; Find (define-key SS3-map "R" 'search-again-backward) ; PF3 (define-key APPLE-map "J\C-M" 'search-again-backward) ; Apple F11 (define-key SS3-map "p" 'backward-line) ; KP0 (define-key SS3-map "q" 'backward-to-word) ; KP1 (define-key SS3-map "r" 'previous-end-of-line) ; KP2 (define-key SS3-map "s" 'backward-char) ; KP3 (define-key SS3-map "w" 'previous-paragraph) ; KP7 (define-key SS3-map "x" 'scroll-window-down) ; KP8 (define-key GOLD-map "'" 'isearch-backward-regexp) ; ' (define-key GOLD-map "\"" 'isearch-backward-regexp) ; " (define-key GOLD-SS3-map "R" 'tpu-search-backward) ; PF3 (define-key GOLD-APPLE-map "J\C-M" 'tpu-search-backward) ; Apple F11 (update-mode-line)) ;;; ;;; APPLE-map key definitions ;;; (define-key APPLE-map "@\C-M" 'undo) ; APPLE F1 (define-key APPLE-map "A\C-M" 'kill-region) ; APPLE F2 (define-key APPLE-map "B\C-M" 'copy-region-as-kill) ; APPLE F3 (define-key APPLE-map "C\C-M" 'yank) ; APPLE F4 (define-key APPLE-map "D\C-M" 'goto-breadcrumb-2) ; APPLE F5 (define-key APPLE-map "E\C-M" 'goto-breadcrumb-3) ; APPLE F6 (define-key APPLE-map "F\C-M" 'goto-breadcrumb-4) ; APPLE F7 (define-key APPLE-map "G\C-M" 'goto-breadcrumb-5) ; APPLE F8 ; ; APPLE F9 (define-key APPLE-map "I\C-M" 'describe-key) ; APPLE F10 ; ; APPLE F11 (define-key APPLE-map "K\C-M" 'delete-current-line) ; APPLE F12 (define-key APPLE-map "L\C-M" nil) ; APPLE F13 (define-key APPLE-map "M\C-M" nil) ; APPLE F14 (define-key APPLE-map "N\C-M" nil) ; APPLE F15 (define-key APPLE-map "O\C-M" 'backward-delete-char) ; APPLE Del (define-key APPLE-map "P\C-M" 'move-to-end) ; APPLE End (define-key APPLE-map "Q\C-M" 'scroll-window-up) ; APPLE Page Down (define-key APPLE-map "R\C-M" 'apropos) ; APPLE Help (define-key APPLE-map "S\C-M" 'move-to-beginning) ; APPLE Home (define-key APPLE-map "T\C-M" 'scroll-window-down) ; APPLE Page Up ;;; ;;; GOLD-APPLE-map key definitions ;;; (define-key GOLD-APPLE-map "@\C-M" nil) ; APPLE F1 (define-key GOLD-APPLE-map "A\C-M" nil) ; APPLE F2 (define-key GOLD-APPLE-map "B\C-M" nil) ; APPLE F3 (define-key GOLD-APPLE-map "C\C-M" nil) ; APPLE F4 (define-key GOLD-APPLE-map "D\C-M" 'drop-breadcrumb-2) ; APPLE F5 (define-key GOLD-APPLE-map "E\C-M" 'drop-breadcrumb-3) ; APPLE F6 (define-key GOLD-APPLE-map "F\C-M" 'drop-breadcrumb-4) ; APPLE F7 (define-key GOLD-APPLE-map "G\C-M" 'drop-breadcrumb-5) ; APPLE F8 (define-key GOLD-APPLE-map "H\C-M" 'mark-section-wisely) ; APPLE F9 (define-key GOLD-APPLE-map "I\C-M" 'eval-expression) ; APPLE F10 ; ; APPLE F11 (define-key GOLD-APPLE-map "K\C-M" 'undelete-lines) ; APPLE F12 (define-key GOLD-APPLE-map "L\C-M" nil) ; APPLE F13 (define-key GOLD-APPLE-map "M\C-M" nil) ; APPLE F14 (define-key GOLD-APPLE-map "N\C-M" nil) ; APPLE F15 (define-key GOLD-APPLE-map "O\C-M" 'backward-delete-char) ; APPLE Del (define-key GOLD-APPLE-map "P\C-M" 'move-to-end) ; APPLE End (define-key GOLD-APPLE-map "Q\C-M" 'scroll-window-up) ; APPLE Page Down (define-key GOLD-APPLE-map "R\C-M" 'apropos) ; APPLE Help (define-key GOLD-APPLE-map "S\C-M" 'move-to-beginning) ; APPLE Home (define-key GOLD-APPLE-map "T\C-M" 'scroll-window-down) ; APPLE Page Up ;;; ;;; CSI-map key definitions ;;; (define-key CSI-map "A" 'previous-line) ; up (define-key CSI-map "B" 'next-line) ; down ;; left and right are defined in DEC-mode and SGI-mode (define-key CSI-map "H" 'move-to-beginning) ; Home IRIS4D (define-key CSI-map "P" 'backward-delete-char) ; Delete IRIS4D (define-key CSI-map "2~" 'yank) ; Insert Here (define-key CSI-map "3~" 'kill-region) ; Remove (define-key CSI-map "4~" 'set-mark-command) ; Select (define-key CSI-map "5~" 'scroll-window-down) ; Prev Screen (define-key CSI-map "6~" 'scroll-window-up) ; Next Screen (define-key CSI-map "11~" 'nil) ; F1 (define-key CSI-map "12~" 'nil) ; F2 (define-key CSI-map "13~" 'nil) ; F3 (define-key CSI-map "14~" 'nil) ; F4 (define-key CSI-map "15~" 'nil) ; F5 (define-key CSI-map "17~" 'nil) ; F6 (define-key CSI-map "18~" 'nil) ; F7 (define-key CSI-map "19~" 'nil) ; F8 (define-key CSI-map "20~" 'nil) ; F9 (define-key CSI-map "21~" 'nil) ; F10 (define-key CSI-map "23~" 'insert-escape) ; F11 (ESC) (define-key CSI-map "24~" 'next-beginning-of-line) ; F12 (BS) (define-key CSI-map "25~" 'delete-previous-word) ; F13 (LF) (define-key CSI-map "26~" 'nil) ; F14 (define-key CSI-map "28~" 'apropos) ; HELP (define-key CSI-map "29~" 'bob-expand) ; DO (define-key CSI-map "31~" 'goto-breadcrumb-2) ; F17 (define-key CSI-map "32~" 'goto-breadcrumb-3) ; F18 (define-key CSI-map "33~" 'goto-breadcrumb-4) ; F19 (define-key CSI-map "34~" 'goto-breadcrumb-5) ; F20 (define-key CSI-map "001q" 'SGI-mode) ; F1 IRIS4D (define-key CSI-map "002q" nil) ; F2 IRIS4D (define-key CSI-map "003q" nil) ; F3 IRIS4D (define-key CSI-map "004q" nil) ; F4 IRIS4D (define-key CSI-map "005q" nil) ; F5 IRIS4D (define-key CSI-map "006q" nil) ; F6 IRIS4D (define-key CSI-map "007q" nil) ; F7 IRIS4D (define-key CSI-map "008q" nil) ; F8 IRIS4D (define-key CSI-map "009q" nil) ; F9 IRIS4D* (define-key CSI-map "010q" nil) ; F10 IRIS4D* (define-key CSI-map "011q" nil) ; F11 IRIS4D* (define-key CSI-map "012q" nil) ; F12 IRIS4D* (define-key CSI-map "139q" 'yank) ; Insert IRIS4D (define-key CSI-map "146q" 'move-to-end) ; End IRIS4D (define-key CSI-map "150q" 'scroll-window-down) ; PgUp IRIS4D (define-key CSI-map "154q" 'scroll-window-up) ; PgDn IRIS4D (define-key CSI-map "209q" nil) ; PrScr IRIS4D (define-key CSI-map "213q" nil) ; ScrLck IRIS4D (define-key CSI-map "217q" nil) ; Pause IRIS4D ;;; ;;; SS3-map key definitions ;;; (define-key SS3-map "A" 'previous-line) ; up (define-key SS3-map "B" 'next-line) ; down (define-key SS3-map "C" 'forward-char) ; right (define-key SS3-map "D" 'backward-char) ; left (define-key SS3-map "Q" 'describe-key) ; PF2 (define-key SS3-map "S" 'delete-current-line) ; PF4 (define-key SS3-map "X" 'describe-key) ; Apple KP= (define-key SS3-map "j" 'delete-current-line) ; Apple KP* (define-key SS3-map "k" 'delete-current-char) ; Apple KP+ (define-key SS3-map "l" 'delete-current-char) ; KP, (define-key SS3-map "m" 'delete-current-word) ; KP- (define-key SS3-map "n" 'set-mark-command) ; KP. (define-key SS3-map "t" 'advance-direction) ; KP4 (define-key SS3-map "u" 'backup-direction) ; KP5 (define-key SS3-map "v" 'kill-region) ; KP6 (define-key SS3-map "y" 'append-region) ; KP9 ;;; ;;; GOLD-map key definitions ;;; ;(define-key GOLD-map "\C-A" 'nil) ; ^A (define-key GOLD-map "\C-B" 'nil) ; ^B (define-key GOLD-map "\C-C" 'nil) ; ^C (define-key GOLD-map "\C-D" 'nil) ; ^D (define-key GOLD-map "\C-E" 'nil) ; ^E (define-key GOLD-map "\C-F" 'nil) ; ^F (define-key GOLD-map "\C-g" 'keyboard-quit) ; safety first (define-key GOLD-map "\C-h" 'delete-other-windows) ; BS (define-key GOLD-map "\C-i" 'other-window) ; TAB ;(define-key GOLD-map "\C-J" 'nil) ; ^J (define-key GOLD-map "\C-K" 'nil) ; ^K (define-key GOLD-map "\C-l" 'downcase-region) ; ^L (define-key GOLD-map "\C-M" 'nil) ; ^M (define-key GOLD-map "\C-N" 'nil) ; ^N (define-key GOLD-map "\C-O" 'nil) ; ^O (define-key GOLD-map "\C-P" 'nil) ; ^P (define-key GOLD-map "\C-Q" 'nil) ; ^Q (define-key GOLD-map "\C-R" 'nil) ; ^R (define-key GOLD-map "\C-S" 'nil) ; ^S (define-key GOLD-map "\C-T" 'nil) ; ^T (define-key GOLD-map "\C-u" 'upcase-region) ; ^U (define-key GOLD-map "\C-V" 'nil) ; ^V (define-key GOLD-map "\C-w" 'write-current-buffers) ; ^W (define-key GOLD-map "\C-X" 'nil) ; ^X (define-key GOLD-map "\C-Y" 'nil) ; ^Y (define-key GOLD-map "\C-Z" 'nil) ; ^Z (define-key GOLD-map " " 'undo) ; SPC (define-key GOLD-map "!" 'change-counter-format) ; ! (define-key GOLD-map "#" 'insert-counter) ; # (define-key GOLD-map "$" nil) ; $ (define-key GOLD-map "%" 'goto-percent) ; % (define-key GOLD-map "&" nil) ; & (define-key GOLD-map "(" nil) ; ( (define-key GOLD-map ")" nil) ; ) (define-key GOLD-map "*" 'insert-counter-as-char) ; * (define-key GOLD-map "+" 'region-length-to-counter) ; + (define-key GOLD-map "," 'goto-breadcrumb) ; , (define-key GOLD-map "-" 'repeat-command--) ; - (define-key GOLD-map "." 'drop-breadcrumb) ; . (define-key GOLD-map "/" 'query-replace) ; / (define-key GOLD-map "0" 'repeat-command-0) ; 0 (define-key GOLD-map "1" 'repeat-command-1) ; 1 (define-key GOLD-map "2" 'repeat-command-2) ; 2 (define-key GOLD-map "3" 'repeat-command-3) ; 3 (define-key GOLD-map "4" 'repeat-command-4) ; 4 (define-key GOLD-map "5" 'repeat-command-5) ; 5 (define-key GOLD-map "6" 'repeat-command-6) ; 6 (define-key GOLD-map "7" 'repeat-command-7) ; 7 (define-key GOLD-map "8" 'repeat-command-8) ; 8 (define-key GOLD-map "9" 'repeat-command-9) ; 9 (define-key GOLD-map ":" nil) ; : (define-key GOLD-map ";" nil) ; ; (define-key GOLD-map "<" 'decr-counter) ; < (define-key GOLD-map "=" 'set-counter) ; = (define-key GOLD-map ">" 'incr-counter) ; > (define-key GOLD-map "?" 'spell-check) ; ? (define-key GOLD-map "A" 'toggle-newline-and-indent) ; A (define-key GOLD-map "B" 'buffer-menu) ; B (define-key GOLD-map "D" 'shell-command) ; D (define-key GOLD-map "E" 'find-file-other-window) ; E (define-key GOLD-map "F" 'switch-to-buffer-other-window) ; F (define-key GOLD-map "H" 'bob-unexpand) ; H (define-key GOLD-map "I" 'insert-file) ; I (define-key GOLD-map "K" 'kill-this-buffer-now) ; K (define-key GOLD-map "L" 'report-position) ; L (define-key GOLD-map "M" 'switch-to-last-buffer) ; M (define-key GOLD-map "N" 'next-error) ; N (define-key GOLD-map "O" 'shell-command) ; O (define-key GOLD-map "P" 'lpr-buffer) ; P (define-key GOLD-map "Q" 'quit-emacs-now) ; Q (define-key GOLD-map "R" 'revert-file) ; R (define-key GOLD-map "S" 'replace-string) ; S (define-key GOLD-map "U" 'set-buffer-clean) ; U (define-key GOLD-map "V" 'find-file-other-window) ; V (define-key GOLD-map "W" 'other-window) ; W (define-key GOLD-map "X" 'save-buffers-kill-emacs) ; X (define-key GOLD-map "Y" 'copy-region-as-kill) ; Y (define-key GOLD-map "Z" 'suspend-emacs) ; Z (define-key GOLD-map "[" 'blink-matching-open) ; [ (define-key GOLD-map "\\" nil) ; \ (define-key GOLD-map "]" 'blink-matching-open) ; ] (define-key GOLD-map "^" nil) ; ^ (define-key GOLD-map "_" 'split-window-vertically) ; - (define-key GOLD-map "`" 'what-line) ; ` (define-key GOLD-map "a" 'toggle-newline-and-indent) ; a (define-key GOLD-map "b" 'buffer-menu) ; b (define-key GOLD-map "d" 'shell-command) ; d (define-key GOLD-map "e" 'find-file) ; e (define-key GOLD-map "f" 'switch-to-buffer) ; f (define-key GOLD-map "h" 'bob-expand) ; h (define-key GOLD-map "i" 'insert-file) ; i (define-key GOLD-map "k" 'kill-this-buffer) ; k (define-key GOLD-map "l" 'goto-line) ; l (define-key GOLD-map "m" 'switch-to-last-buffer) ; m (define-key GOLD-map "n" 'next-error) ; n (define-key GOLD-map "o" 'shell-command) ; o (define-key GOLD-map "p" 'lpr-region) ; p (define-key GOLD-map "q" 'kill-emacs) ; q (define-key GOLD-map "r" 'revert-file) ; r (define-key GOLD-map "s" 'query-replace) ; s (define-key GOLD-map "u" 'set-buffer-clean) ; u (define-key GOLD-map "v" 'find-file-other-window) ; v (define-key GOLD-map "w" 'next-buffer) ; w (define-key GOLD-map "x" 'save-all-buffers-kill-emacs) ; x (define-key GOLD-map "y" 'copy-region-as-kill) ; y (define-key GOLD-map "z" 'suspend-emacs) ; z (define-key GOLD-map "{" 'nil) ; { (define-key GOLD-map "|" 'split-window-horizontally) ; | (define-key GOLD-map "}" 'nil) ; } (define-key GOLD-map "~" 'exchange-point-and-mark) ; ~ (define-key GOLD-map "\177" 'delete-window) ;