changeset 5249:d4fae3ebf26a

Add `save-some-buffers-action-alist'. 2010-08-20 Mike Sperber <mike@xemacs.org> * files.el (save-some-buffers-action-alist): Add. (save-some-buffers-1): Use (synching with (GPLv2) FSF Emacs.
author Mike Sperber <sperber@deinprogramm.de>
date Fri, 20 Aug 2010 13:04:54 +0200
parents 9d8aaa5ac16e
children db84c9d41437
files lisp/ChangeLog lisp/files.el
diffstat 2 files changed, 45 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sat Aug 21 19:03:15 2010 +0100
+++ b/lisp/ChangeLog	Fri Aug 20 13:04:54 2010 +0200
@@ -1,3 +1,8 @@
+2010-08-20  Mike Sperber  <mike@xemacs.org>
+
+	* files.el (save-some-buffers-action-alist): Add.
+	(save-some-buffers-1): Use (synching with (GPLv2) FSF Emacs.
+
 2010-08-18  Mike Sperber  <mike@xemacs.org>
 
 	* files.el (diff-files-for-recover): Abstract this out out
--- a/lisp/files.el	Sat Aug 21 19:03:15 2010 +0100
+++ b/lisp/files.el	Fri Aug 20 13:04:54 2010 +0200
@@ -3086,6 +3086,45 @@
   ;; over to the next unsaved buffer when calling `d'.
   nil)
 
+(defvar save-some-buffers-action-alist
+  ;;instead of this we just say "yes all", "no all", etc.
+  ;;"save all the rest"
+  ;;"save only this buffer" "save no more buffers")
+  ;; this is rather bogus. --ben
+  ;; (it makes the dialog box too big, and you get an error
+  ;; "wrong type argument: framep, nil" when you hit q after
+  ;; choosing the option from the dialog box)
+
+  ;; We should fix the dialog box rather than disabling
+  ;; this!  --hniksic
+  (list (list ?\C-r (lambda (buf)
+		      ;; #### FSF has an EXIT-ACTION argument
+		      ;; to `view-buffer'.
+		      (view-buffer buf
+;				   (function
+;				    (lambda (ignore)
+;				      (exit-recursive-edit))))
+				   )
+		      (with-boundp 'view-exit-action
+			(setq view-exit-action
+			      (lambda (ignore)
+				(exit-recursive-edit))))
+		      (recursive-edit)
+		      ;; Return nil to ask about BUF again.
+		      nil)
+	      "%_Display Buffer") 
+	(list ?d (lambda (buf)
+		   (save-window-excursion (diff-buffer-with-file buf))
+		   (view-buffer (get-buffer-create "*File Diff*") t)
+		   (with-boundp 'view-exit-action
+		     (setq view-exit-action 
+			   (lambda (ignore)
+			     (exit-recursive-edit))))
+		   (recursive-edit)
+		   ;; Return nil to ask about BUF again.
+		   nil)
+	      "View %_Changes in Buffer")))
+
 (defun diff-files-for-recover (purpose file-1 file-2
 			       failed-file-1 failed-file-2
 			       coding-system)
@@ -3215,32 +3254,7 @@
 	       (error nil)))
 	   (buffer-list)
 	   '("buffer" "buffers" "save")
-	   ;;instead of this we just say "yes all", "no all", etc.
-	   ;;"save all the rest"
-	   ;;"save only this buffer" "save no more buffers")
-	   ;; this is rather bogus. --ben
-	   ;; (it makes the dialog box too big, and you get an error
-	   ;; "wrong type argument: framep, nil" when you hit q after
-	   ;; choosing the option from the dialog box)
-
-	   ;; We should fix the dialog box rather than disabling
-	   ;; this!  --hniksic
-	   (list (list ?\C-r (lambda (buf)
-			       ;; #### FSF has an EXIT-ACTION argument
-			       ;; to `view-buffer'.
-			       (view-buffer buf
-; 					    (function
-; 					     (lambda (ignore)
-; 					       (exit-recursive-edit))))
-			       )
-			       (with-boundp 'view-exit-action
-				 (setq view-exit-action
-				       (lambda (ignore)
-					 (exit-recursive-edit))))
-			       (recursive-edit)
-			       ;; Return nil to ask about BUF again.
-			       nil)
-		       "%_Display Buffer"))))
+	   save-some-buffers-action-alist))
 	 (abbrevs-done
 	  (and save-abbrevs abbrevs-changed
 	       (progn