Mercurial > hg > xemacs-beta
comparison lisp/files.el @ 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 | 0d71bcf96ffd |
children | 3acaa0fc09be |
comparison
equal
deleted
inserted
replaced
5248:9d8aaa5ac16e | 5249:d4fae3ebf26a |
---|---|
3084 (sit-for 1))) | 3084 (sit-for 1))) |
3085 ;; return always nil, so that save-buffers-kill-emacs will not move | 3085 ;; return always nil, so that save-buffers-kill-emacs will not move |
3086 ;; over to the next unsaved buffer when calling `d'. | 3086 ;; over to the next unsaved buffer when calling `d'. |
3087 nil) | 3087 nil) |
3088 | 3088 |
3089 (defvar save-some-buffers-action-alist | |
3090 ;;instead of this we just say "yes all", "no all", etc. | |
3091 ;;"save all the rest" | |
3092 ;;"save only this buffer" "save no more buffers") | |
3093 ;; this is rather bogus. --ben | |
3094 ;; (it makes the dialog box too big, and you get an error | |
3095 ;; "wrong type argument: framep, nil" when you hit q after | |
3096 ;; choosing the option from the dialog box) | |
3097 | |
3098 ;; We should fix the dialog box rather than disabling | |
3099 ;; this! --hniksic | |
3100 (list (list ?\C-r (lambda (buf) | |
3101 ;; #### FSF has an EXIT-ACTION argument | |
3102 ;; to `view-buffer'. | |
3103 (view-buffer buf | |
3104 ; (function | |
3105 ; (lambda (ignore) | |
3106 ; (exit-recursive-edit)))) | |
3107 ) | |
3108 (with-boundp 'view-exit-action | |
3109 (setq view-exit-action | |
3110 (lambda (ignore) | |
3111 (exit-recursive-edit)))) | |
3112 (recursive-edit) | |
3113 ;; Return nil to ask about BUF again. | |
3114 nil) | |
3115 "%_Display Buffer") | |
3116 (list ?d (lambda (buf) | |
3117 (save-window-excursion (diff-buffer-with-file buf)) | |
3118 (view-buffer (get-buffer-create "*File Diff*") t) | |
3119 (with-boundp 'view-exit-action | |
3120 (setq view-exit-action | |
3121 (lambda (ignore) | |
3122 (exit-recursive-edit)))) | |
3123 (recursive-edit) | |
3124 ;; Return nil to ask about BUF again. | |
3125 nil) | |
3126 "View %_Changes in Buffer"))) | |
3127 | |
3089 (defun diff-files-for-recover (purpose file-1 file-2 | 3128 (defun diff-files-for-recover (purpose file-1 file-2 |
3090 failed-file-1 failed-file-2 | 3129 failed-file-1 failed-file-2 |
3091 coding-system) | 3130 coding-system) |
3092 "Diff two files for recovering or comparing against the last saved version. | 3131 "Diff two files for recovering or comparing against the last saved version. |
3093 PURPOSE is an informational string used for naming the resulting buffer. | 3132 PURPOSE is an informational string used for naming the resulting buffer. |
3213 (condition-case () | 3252 (condition-case () |
3214 (save-buffer) | 3253 (save-buffer) |
3215 (error nil))) | 3254 (error nil))) |
3216 (buffer-list) | 3255 (buffer-list) |
3217 '("buffer" "buffers" "save") | 3256 '("buffer" "buffers" "save") |
3218 ;;instead of this we just say "yes all", "no all", etc. | 3257 save-some-buffers-action-alist)) |
3219 ;;"save all the rest" | |
3220 ;;"save only this buffer" "save no more buffers") | |
3221 ;; this is rather bogus. --ben | |
3222 ;; (it makes the dialog box too big, and you get an error | |
3223 ;; "wrong type argument: framep, nil" when you hit q after | |
3224 ;; choosing the option from the dialog box) | |
3225 | |
3226 ;; We should fix the dialog box rather than disabling | |
3227 ;; this! --hniksic | |
3228 (list (list ?\C-r (lambda (buf) | |
3229 ;; #### FSF has an EXIT-ACTION argument | |
3230 ;; to `view-buffer'. | |
3231 (view-buffer buf | |
3232 ; (function | |
3233 ; (lambda (ignore) | |
3234 ; (exit-recursive-edit)))) | |
3235 ) | |
3236 (with-boundp 'view-exit-action | |
3237 (setq view-exit-action | |
3238 (lambda (ignore) | |
3239 (exit-recursive-edit)))) | |
3240 (recursive-edit) | |
3241 ;; Return nil to ask about BUF again. | |
3242 nil) | |
3243 "%_Display Buffer")))) | |
3244 (abbrevs-done | 3258 (abbrevs-done |
3245 (and save-abbrevs abbrevs-changed | 3259 (and save-abbrevs abbrevs-changed |
3246 (progn | 3260 (progn |
3247 (if (or arg | 3261 (if (or arg |
3248 (eq save-abbrevs 'silently) | 3262 (eq save-abbrevs 'silently) |