summaryrefslogtreecommitdiff
path: root/lisp/emulation/tpu-edt.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1995-05-01 15:52:55 +0000
committerRichard M. Stallman <rms@gnu.org>1995-05-01 15:52:55 +0000
commitf8ecee1d9928910429817847cd2501423c5d6ea1 (patch)
treee8292b4ad2acf499f4dca8ce88dab83fda5aa8fa /lisp/emulation/tpu-edt.el
parent0727969518333475ad398df6b8dc39e4e7c25c2c (diff)
downloademacs-f8ecee1d9928910429817847cd2501423c5d6ea1.tar.gz
(tpu-copy-keyfile): New function.
(tpu-load-xkeys): Copy key definition file to new default name.
Diffstat (limited to 'lisp/emulation/tpu-edt.el')
-rw-r--r--lisp/emulation/tpu-edt.el33
1 files changed, 32 insertions, 1 deletions
diff --git a/lisp/emulation/tpu-edt.el b/lisp/emulation/tpu-edt.el
index a28a312e621..d6524dc7f5d 100644
--- a/lisp/emulation/tpu-edt.el
+++ b/lisp/emulation/tpu-edt.el
@@ -2109,7 +2109,10 @@ If FILE is nil, try to load a default file. The default file names are
(tpu-lucid-emacs19-p
(setq file (expand-file-name "~/.tpu-lucid-keys")))
(tpu-emacs19-p
- (setq file (expand-file-name "~/.tpu-keys"))))
+ (setq file (expand-file-name "~/.tpu-keys"))
+ (and (not (file-exists-p file))
+ (file-exists-p (expand-file-name "~/.tpu-gnu-keys"))
+ (tpu-copy-keyfile (expand-file-name "~/.tpu-gnu-keys") file))))
(cond ((file-readable-p file)
(load-file file))
(t
@@ -2142,6 +2145,34 @@ If FILE is nil, try to load a default file. The default file names are
(insert "Nope, I can't seem to find it. :-(\n\n")
(sit-for 120)))))))
+(defun tpu-copy-keyfile (oldname newname)
+ "Copy the TPU-edt X key definitions file to the new default name."
+ (interactive "fOld name: \nFNew name: ")
+ (if (not (get-buffer "*TPU-Notice*")) (generate-new-buffer "*TPU-Notice*"))
+ (set-buffer "*TPU-Notice*")
+ (erase-buffer)
+ (insert "
+ NOTICE --
+
+ The default name of the TPU-edt key definition file has changed
+ from `~/.tpu-gnu-keys' to `~/.tpu-keys'. With your permission,
+ your key definitions will be copied to the new file. If you'll
+ never use older versions of Emacs, you can remove the old file.
+ If the copy fails, you'll be asked if you want to create a new
+ key definitions file. Do you want to copy your key definition
+ file now?
+ ")
+ (save-window-excursion
+ (switch-to-buffer-other-window "*TPU-Notice*")
+ (shrink-window-if-larger-than-buffer)
+ (goto-char (point-min))
+ (beep)
+ (and (tpu-y-or-n-p "Copy key definitions to the new file now? ")
+ (condition-case conditions
+ (copy-file oldname newname)
+ (error (message "Sorry, couldn't copy - %s" (cdr conditions)))))
+ (kill-buffer "*TPU-Notice*")))
+
;;;
;;; Start and Stop TPU-edt