Article View: gnu.epoch.misc
Article #235Xemacs style keybindings (by request)
From: Bill Voss
Date: Sat, 15 Aug 1992 11:52
Date: Sat, 15 Aug 1992 11:52
71 lines
3155 bytes
3155 bytes
Someone (I forget who) recently asked me to post my bindings, so
here they are. Use, improve, abuse, whatever...
Bill Voss
When I switched from Xemacs to Epoch I wanted Epoch to look as
much like Xemacs as possible. To that end I wrote a tiny little shell
script:
#!/bin/sh
/local/all/epoch -nm ${@} &
which I bound to my window manager's "e" key, and added to the menus
where emacs had previously appeared.
I also added some simple bindings, and wrote a tiny little elisp
function. The guiding idea was that I should normally be able to forget
if I was running Xemacs, or Epoch. Thus the old Xemacs bindings should
appear to work unchanged, especially the old C-xC-c binding. However,
having C-xC-c shut down all of Epoch was unacceptable. I also needed
easy to remember Epoch bindings to popup new windows. So I changed
C-xC-c to only shut down the current window, and made C-zC-c shut down
the entire Epoch process. I also duplicated the old C-xC-f and C-xb
bindings with Epoch versions C-zC-f and C-zb which open new windows.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; From my ~/.emacs file. Tested under Epoch 4.0.1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; This function simulates the old Xemacs \C-x\C-c binding.
;;
(defun my-epoch-delete-or-exit ()
(interactive)
;;
;; If there is only one screen open, behave like Xemacs and shut down.
;;
(if (eq (current-screen) (next-screen))
(save-buffers-kill-emacs)
(progn
;;
;; If there are multiple screens open, just save the file in this
;; screen, and shut this screen down.
;; BUG: This really should handle the possiblity of multiple
;; BUG: files open in a single screen, and not just one file.
;;
(if (buffer-modified-p)
(progn
(if (y-or-n-p (if buffer-file-name
(format "Save file %s? "
buffer-file-name)
(format "Save buffer %s? " (buffer-name))))
(save-buffer))
(message ""))) ;; Work around for Echo Area Bug.
(delete-screen))))
;;
;; I don't want Epoch to give itself airs, so don't auto-raise
;; also add my personal bindings.
;;
(if (boundp 'epoch::version)
(progn
(setq auto-raise-screen nil)
(global-set-key "\C-z\C-f" 'find-file-other-screen)
(global-set-key "\C-zf" 'find-file-other-screen)
(global-set-key "\C-z\C-b" 'find-buffer-other-screen)
(global-set-key "\C-zb" 'find-buffer-other-screen)
(global-set-key "\C-z\C-c" 'save-buffers-kill-emacs)
(global-set-key "\C-z\C-d" 'remove-screen)
(global-set-key "\C-x\C-c" 'my-epoch-delete-or-exit)
)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Technical Details
Message-ID:
<199208152152.AA16665@laslo.cs.uiuc.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cs.uiuc.edu!vossShow Full Headers
Complete Article Headers
Newsgroups: gnu.epoch.misc Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cs.uiuc.edu!voss From: voss@cs.uiuc.edu (Bill Voss) Subject: Xemacs style keybindings (by request) Message-ID: <199208152152.AA16665@laslo.cs.uiuc.edu> Sender: daemon@cis.ohio-state.edu Organization: GNUs Not Usenet Distribution: gnu Date: Sat, 15 Aug 1992 11:52:30 GMT Lines: 71