Mercurial > emacs
comparison lisp/emulation/tpu-edt.el @ 11637:dfdae6cd817e
(tpu-copy-keyfile): New function.
(tpu-load-xkeys): Copy key definition file to new default name.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 01 May 1995 15:52:55 +0000 |
parents | 11a7257fc6fa |
children | 8a11e11d3365 |
comparison
equal
deleted
inserted
replaced
11636:919ac497342e | 11637:dfdae6cd817e |
---|---|
2107 (tpu-xkeys-file | 2107 (tpu-xkeys-file |
2108 (setq file (expand-file-name tpu-xkeys-file))) | 2108 (setq file (expand-file-name tpu-xkeys-file))) |
2109 (tpu-lucid-emacs19-p | 2109 (tpu-lucid-emacs19-p |
2110 (setq file (expand-file-name "~/.tpu-lucid-keys"))) | 2110 (setq file (expand-file-name "~/.tpu-lucid-keys"))) |
2111 (tpu-emacs19-p | 2111 (tpu-emacs19-p |
2112 (setq file (expand-file-name "~/.tpu-keys")))) | 2112 (setq file (expand-file-name "~/.tpu-keys")) |
2113 (and (not (file-exists-p file)) | |
2114 (file-exists-p (expand-file-name "~/.tpu-gnu-keys")) | |
2115 (tpu-copy-keyfile (expand-file-name "~/.tpu-gnu-keys") file)))) | |
2113 (cond ((file-readable-p file) | 2116 (cond ((file-readable-p file) |
2114 (load-file file)) | 2117 (load-file file)) |
2115 (t | 2118 (t |
2116 (switch-to-buffer "*scratch*") | 2119 (switch-to-buffer "*scratch*") |
2117 (erase-buffer) | 2120 (erase-buffer) |
2140 (load-file path))) | 2143 (load-file path))) |
2141 (t | 2144 (t |
2142 (insert "Nope, I can't seem to find it. :-(\n\n") | 2145 (insert "Nope, I can't seem to find it. :-(\n\n") |
2143 (sit-for 120))))))) | 2146 (sit-for 120))))))) |
2144 | 2147 |
2148 (defun tpu-copy-keyfile (oldname newname) | |
2149 "Copy the TPU-edt X key definitions file to the new default name." | |
2150 (interactive "fOld name: \nFNew name: ") | |
2151 (if (not (get-buffer "*TPU-Notice*")) (generate-new-buffer "*TPU-Notice*")) | |
2152 (set-buffer "*TPU-Notice*") | |
2153 (erase-buffer) | |
2154 (insert " | |
2155 NOTICE -- | |
2156 | |
2157 The default name of the TPU-edt key definition file has changed | |
2158 from `~/.tpu-gnu-keys' to `~/.tpu-keys'. With your permission, | |
2159 your key definitions will be copied to the new file. If you'll | |
2160 never use older versions of Emacs, you can remove the old file. | |
2161 If the copy fails, you'll be asked if you want to create a new | |
2162 key definitions file. Do you want to copy your key definition | |
2163 file now? | |
2164 ") | |
2165 (save-window-excursion | |
2166 (switch-to-buffer-other-window "*TPU-Notice*") | |
2167 (shrink-window-if-larger-than-buffer) | |
2168 (goto-char (point-min)) | |
2169 (beep) | |
2170 (and (tpu-y-or-n-p "Copy key definitions to the new file now? ") | |
2171 (condition-case conditions | |
2172 (copy-file oldname newname) | |
2173 (error (message "Sorry, couldn't copy - %s" (cdr conditions))))) | |
2174 (kill-buffer "*TPU-Notice*"))) | |
2175 | |
2145 | 2176 |
2146 ;;; | 2177 ;;; |
2147 ;;; Start and Stop TPU-edt | 2178 ;;; Start and Stop TPU-edt |
2148 ;;; | 2179 ;;; |
2149 ;;;###autoload | 2180 ;;;###autoload |