aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland McGrath1995-06-01 23:18:04 +0000
committerRoland McGrath1995-06-01 23:18:04 +0000
commit80280bb74aca5d58e6745731c05d825eedd9790f (patch)
tree4841a1c629c7d1ae822c0ac31fa51a0df861b238
parenta096c36b853068bd51f4e4db7bb8b72832800807 (diff)
downloademacs-80280bb74aca5d58e6745731c05d825eedd9790f.tar.gz
emacs-80280bb74aca5d58e6745731c05d825eedd9790f.zip
(multiple-recover-finish): Renamed to recover-session-finish.
(recover-session): Changed binding. (recover-session-finish): Doc fix; rewritten using map-y-or-n-p.
-rw-r--r--lisp/files.el29
1 files changed, 14 insertions, 15 deletions
diff --git a/lisp/files.el b/lisp/files.el
index 28e9485b6e6..58efd8042c5 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -2099,12 +2099,12 @@ Then you'll be asked about a number of files to recover."
2099 (insert "Move to the session you want to recover,\n") 2099 (insert "Move to the session you want to recover,\n")
2100 (insert "then type C-c C-c to select it.\n\n"))) 2100 (insert "then type C-c C-c to select it.\n\n")))
2101 (use-local-map (nconc (make-sparse-keymap) (current-local-map))) 2101 (use-local-map (nconc (make-sparse-keymap) (current-local-map)))
2102 (define-key (current-local-map) "\C-c\C-c" 'multiple-recover-finish)) 2102 (define-key (current-local-map) "\C-c\C-c" 'recover-session-finish))
2103 2103
2104(defun multiple-recover-finish () 2104(defun recover-session-finish ()
2105 "Choose one saved session to recover auto-save files from. 2105 "Choose one saved session to recover auto-save files from.
2106This command is used in the special Dired buffer created by 2106This command is used in the special Dired buffer created by
2107M-x multiple-recover." 2107\\[recover-session]."
2108 (interactive) 2108 (interactive)
2109 ;; Get the name of the session file to recover from. 2109 ;; Get the name of the session file to recover from.
2110 (let ((file (dired-get-filename)) 2110 (let ((file (dired-get-filename))
@@ -2115,18 +2115,17 @@ M-x multiple-recover."
2115 (set-buffer buffer) 2115 (set-buffer buffer)
2116 (erase-buffer) 2116 (erase-buffer)
2117 (insert-file-contents file) 2117 (insert-file-contents file)
2118 (while (not (eobp)) 2118 (map-y-or-n-p "Recover %s? "
2119 ;; Look at each file entry. 2119 (lambda (file) (save-excursion (recover-file file)))
2120 (and (not (eolp)) 2120 (lambda ()
2121 (let ((edited-file 2121 (if (eobp)
2122 (buffer-substring (point) 2122 nil
2123 (save-excursion (end-of-line) (point))))) 2123 (prog1
2124 ;; Offer to recover it. 2124 (buffer-substring-no-properties
2125 (if (y-or-n-p (format "Recover %s? " edited-file)) 2125 (point) (progn (end-of-line) (point)))
2126 (save-excursion 2126 (while (and (eolp) (not (eobp)))
2127 (recover-file edited-file))))) 2127 (forward-line 2)))))
2128 ;; Skip to the next entry. 2128 '("file" "files" "recover")))
2129 (forward-line 2)))
2130 (kill-buffer buffer)))) 2129 (kill-buffer buffer))))
2131 2130
2132(defun kill-some-buffers () 2131(defun kill-some-buffers ()