]> code.delx.au - gnu-emacs/blobdiff - lisp/emulation/edt.el
* faces.el (tty-run-terminal-initialization): function changed (Stefan
[gnu-emacs] / lisp / emulation / edt.el
index 52b083da6a1e634cfefc0f69e00ec17fab3fcefd..11a1c7f03b605e043747ec6b885b9b69cab26aee 100644 (file)
@@ -1,7 +1,7 @@
 ;;; edt.el --- enhanced EDT keypad mode emulation for GNU Emacs
 
 ;;; edt.el --- enhanced EDT keypad mode emulation for GNU Emacs
 
-;; Copyright (C) 1986, 1992, 1993, 1994, 1995, 2000, 2001, 2002, 2003,
-;;   2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1986, 1992-1995, 2000-2013 Free Software Foundation,
+;; Inc.
 
 ;; Author: Kevin Gallagher <Kevin.Gallagher@boeing.com>
 ;; Maintainer: Kevin Gallagher <Kevin.Gallagher@boeing.com>
 
 ;; Author: Kevin Gallagher <Kevin.Gallagher@boeing.com>
 ;; Maintainer: Kevin Gallagher <Kevin.Gallagher@boeing.com>
@@ -49,7 +49,7 @@
 
 ;; You can have the EDT Emulation start up automatically, each time
 ;; you initiate a GNU Emacs session, by adding the following line to
 
 ;; You can have the EDT Emulation start up automatically, each time
 ;; you initiate a GNU Emacs session, by adding the following line to
-;; your .emacs file:
+;; your init file:
 ;;
 ;;    (add-hook term-setup-hook 'edt-emulation-on)
 
 ;;
 ;;    (add-hook term-setup-hook 'edt-emulation-on)
 
@@ -76,7 +76,7 @@
 ;;      default, this feature is enabled, with the top margin set to
 ;;      10% of the window and the bottom margin set to 15% of the
 ;;      window.  To change these settings, you can invoke the function
 ;;      default, this feature is enabled, with the top margin set to
 ;;      10% of the window and the bottom margin set to 15% of the
 ;;      window.  To change these settings, you can invoke the function
-;;      edt-set-scroll-margins in your .emacs file.  For example, the
+;;      edt-set-scroll-margins in your init file.  For example, the
 ;;      following line
 ;;
 ;;           (edt-set-scroll-margins "20%" "25%")
 ;;      following line
 ;;
 ;;           (edt-set-scroll-margins "20%" "25%")
@@ -364,7 +364,7 @@ This means that an edt-user.el file was found in the user's `load-path'.")
 ;;;
 ;;;         (setq edt-keep-current-page-delimiter t)
 ;;;
 ;;;
 ;;;         (setq edt-keep-current-page-delimiter t)
 ;;;
-;;; in your .emacs file.
+;;; in your init file.
 
 (defun edt-page-forward (num)
   "Move forward to just after next page delimiter.
 
 (defun edt-page-forward (num)
   "Move forward to just after next page delimiter.
@@ -1962,14 +1962,14 @@ created."
      Ack!!  You're running the Enhanced EDT Emulation without loading an
      EDT key mapping file.  To create an EDT key mapping file, run the
      edt-mapper program.  It is safest to run it from an Emacs loaded
      Ack!!  You're running the Enhanced EDT Emulation without loading an
      EDT key mapping file.  To create an EDT key mapping file, run the
      edt-mapper program.  It is safest to run it from an Emacs loaded
-     without any of your own customizations found in your .emacs file, etc.
+     without any of your own customizations found in your init file, etc.
      The reason for this is that some user customizations confuse edt-mapper.
      You can do this by quitting Emacs and then invoking Emacs again as
      follows:
 
           emacs -q -l edt-mapper
 
      The reason for this is that some user customizations confuse edt-mapper.
      You can do this by quitting Emacs and then invoking Emacs again as
      follows:
 
           emacs -q -l edt-mapper
 
-     [NOTE:  If you do nothing out of the ordinary in your .emacs file, and
+     [NOTE:  If you do nothing out of the ordinary in your init file, and
      the search for edt-mapper is successful, you can try running it now.]
 
      The library edt-mapper includes these same directions on how to
      the search for edt-mapper is successful, you can try running it now.]
 
      The library edt-mapper includes these same directions on how to
@@ -2072,6 +2072,20 @@ created."
     (setq transient-mark-mode edt-orig-transient-mark-mode))
   (message "Original key bindings restored; EDT Emulation disabled"))
 
     (setq transient-mark-mode edt-orig-transient-mark-mode))
   (message "Original key bindings restored; EDT Emulation disabled"))
 
+(defun edt-default-menu-bar-update-buffers ()
+  ;; Update edt-default-global-map with latest copy of
+  ;; `global-buffers-menu-map' each time `menu-bar-update-buffers'
+  ;; updates global-map.
+  (define-key edt-default-global-map [menu-bar buffer]
+    (cons "Buffers" global-buffers-menu-map)))
+
+(defun edt-user-menu-bar-update-buffers ()
+  ;; We need to update edt-user-global-map with latest copy of
+  ;; `global-buffers-menu-map' each time `menu-bar-update-buffers'
+  ;; updates global-map.
+  (define-key edt-user-global-map [menu-bar buffer]
+    (cons "Buffers" global-buffers-menu-map)))
+
 (defun edt-default-emulation-setup (&optional user-setup)
   "Setup emulation of DEC's EDT editor.
 Optional argument USER-SETUP non-nil means  called from function
 (defun edt-default-emulation-setup (&optional user-setup)
   "Setup emulation of DEC's EDT editor.
 Optional argument USER-SETUP non-nil means  called from function
@@ -2111,10 +2125,8 @@ Optional argument USER-SETUP non-nil means  called from function
     (progn
       (fset 'edt-emulation-on (symbol-function 'edt-select-default-global-map))
       (edt-select-default-global-map)))
     (progn
       (fset 'edt-emulation-on (symbol-function 'edt-select-default-global-map))
       (edt-select-default-global-map)))
-  ;; We need to share `global-buffers-menu-map' with the saved global
-  ;; keymap, because `menu-bar-update-buffers' directly changes it.
-  (define-key (current-global-map) [menu-bar buffer]
-    (cons "Buffers" global-buffers-menu-map)))
+  ;; Keep the menu bar Buffers menu up-to-date in edt-default-global-map.
+  (add-hook 'menu-bar-update-hook 'edt-default-menu-bar-update-buffers))
 
 (defun edt-user-emulation-setup ()
   "Setup user custom emulation of DEC's EDT editor."
 
 (defun edt-user-emulation-setup ()
   "Setup user custom emulation of DEC's EDT editor."
@@ -2135,7 +2147,9 @@ Optional argument USER-SETUP non-nil means  called from function
   ;; See Info node `edt' for more details, and sample edt-user.el file.
   (if (fboundp 'edt-setup-user-bindings)
       (edt-setup-user-bindings))
   ;; See Info node `edt' for more details, and sample edt-user.el file.
   (if (fboundp 'edt-setup-user-bindings)
       (edt-setup-user-bindings))
-  (edt-select-user-global-map))
+  (edt-select-user-global-map)
+  ;; Keep the menu bar Buffers menu up-to-date in edt-user-global-map.
+  (add-hook 'menu-bar-update-hook 'edt-user-menu-bar-update-buffers))
 
 (defun edt-select-default-global-map()
   "Select default EDT emulation key bindings."
 
 (defun edt-select-default-global-map()
   "Select default EDT emulation key bindings."
@@ -2363,7 +2377,7 @@ Argument GOLD-BINDING is the Emacs function to be bound to GOLD <KEY>."
   (edt-bind-gold-key-default  "\C-h" 'help-for-help); Just in case.
   (edt-bind-gold-key-default  [f1] 'help-for-help)
   (edt-bind-gold-key-default  [help] 'help-for-help)
   (edt-bind-gold-key-default  "\C-h" 'help-for-help); Just in case.
   (edt-bind-gold-key-default  [f1] 'help-for-help)
   (edt-bind-gold-key-default  [help] 'help-for-help)
-  (edt-bind-gold-key-default  "\C-\\" 'split-window-vertically)
+  (edt-bind-gold-key-default  "\C-\\" 'split-window-below)
 
   ;; GOLD bindings for regular keys.
   (edt-bind-gold-key-default "a" 'edt-key-not-assigned)
 
   ;; GOLD bindings for regular keys.
   (edt-bind-gold-key-default "a" 'edt-key-not-assigned)
@@ -2485,7 +2499,7 @@ Argument GOLD-BINDING is the Emacs function to be bound to GOLD <KEY>."
   F10: Cut Rectangle
 G-F10: Paste Rectangle
   F11: ESC
   F10: Cut Rectangle
 G-F10: Paste Rectangle
   F11: ESC
-  F12: Begining of Line           +----------+----------+----------+----------+
+  F12: Beginning of Line          +----------+----------+----------+----------+
 G-F12: Delete Other Windows       |   GOLD   |   HELP   |  FNDNXT  |  DEL L   |
   F13: Delete to Begin of Word    |   (PF1)  |   (PF2)  |   (PF3)  |  (PF4)   |
  HELP: Keypad Help                |Mark Wisel|Desc Funct|   FIND   |  UND L   |
 G-F12: Delete Other Windows       |   GOLD   |   HELP   |  FNDNXT  |  DEL L   |
   F13: Delete to Begin of Word    |   (PF1)  |   (PF2)  |   (PF3)  |  (PF4)   |
  HELP: Keypad Help                |Mark Wisel|Desc Funct|   FIND   |  UND L   |