* save-query-if-deleted
@ 2006-09-27 8:37 Karl Chen
2006-09-27 12:12 ` save-query-if-deleted martin rudalics
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Karl Chen @ 2006-09-27 8:37 UTC (permalink / raw)
I propose the patch below which adds the variable
`save-query-if-deleted'. If non-nil, the `basic-save-buffer' will
query before saving if the file has been deleted, but existed
since last visited/saved.
In this patch it defaults to nil, but I think it is a very useful
feature. Usually when a file no longer exists it's because I
renamed it in a shell window and forgot to re-open it in Emacs; in
these situations, saving it should require confirmation.
What do you think?
--- files.el 22 Sep 2006 08:01:41 -0700 1.858
+++ files.el 27 Sep 2006 01:33:25 -0700
@@ -225,6 +225,11 @@
(t "[\000]"))
"Regexp recognizing file names which aren't allowed by the filesystem.")
+(defcustom save-query-if-deleted nil
+ "*Non-nil means query before saving if file has been deleted."
+ :type 'boolean
+ :group 'files)
+
(defcustom file-precious-flag nil
"Non-nil means protect against I/O errors while saving files.
Some modes set this non-nil in particular buffers.
@@ -3542,10 +3547,14 @@
(error "Canceled")))
(set-visited-file-name filename)))
(or (verify-visited-file-modtime (current-buffer))
- (not (file-exists-p buffer-file-name))
+ (if (file-exists-p buffer-file-name)
(yes-or-no-p
(format "%s has changed since visited or saved. Save anyway? "
(file-name-nondirectory buffer-file-name)))
+ (if save-query-if-deleted
+ (yes-or-no-p (format "%s has been deleted since visited or saved. Save anew? "
+ (file-name-nondirectory buffer-file-name)))
+ t))
(error "Save not confirmed"))
(save-restriction
(widen)
--
Karl 2006-09-27 01:32
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: save-query-if-deleted
2006-09-27 8:37 save-query-if-deleted Karl Chen
@ 2006-09-27 12:12 ` martin rudalics
2006-09-27 18:12 ` save-query-if-deleted Eli Zaretskii
2006-09-28 2:13 ` save-query-if-deleted Richard Stallman
2 siblings, 0 replies; 4+ messages in thread
From: martin rudalics @ 2006-09-27 12:12 UTC (permalink / raw)
Cc: Emacs Developement List
> I propose the patch below which adds the variable
> `save-query-if-deleted'. If non-nil, the `basic-save-buffer' will
> query before saving if the file has been deleted, but existed
> since last visited/saved.
>
> In this patch it defaults to nil, but I think it is a very useful
> feature. Usually when a file no longer exists it's because I
> renamed it in a shell window and forgot to re-open it in Emacs; in
> these situations, saving it should require confirmation.
>
> What do you think?
I'd appreciate it. If `buffer-file-name' and `save-query-if-deleted'
are both non-nil, I'd have `buffer-save-buffer' ask whether to save the
buffer even if it was not modified.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: save-query-if-deleted
2006-09-27 8:37 save-query-if-deleted Karl Chen
2006-09-27 12:12 ` save-query-if-deleted martin rudalics
@ 2006-09-27 18:12 ` Eli Zaretskii
2006-09-28 2:13 ` save-query-if-deleted Richard Stallman
2 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2006-09-27 18:12 UTC (permalink / raw)
Cc: emacs-devel
> From: Karl Chen <quarl@cs.berkeley.edu>
> Date: Wed, 27 Sep 2006 01:37:24 -0700
>
> I propose the patch below which adds the variable
> `save-query-if-deleted'. If non-nil, the `basic-save-buffer' will
> query before saving if the file has been deleted, but existed
> since last visited/saved.
>
> In this patch it defaults to nil, but I think it is a very useful
> feature. Usually when a file no longer exists it's because I
> renamed it in a shell window and forgot to re-open it in Emacs; in
> these situations, saving it should require confirmation.
>
> What do you think?
I think it should wait until after the release of Emacs 22, but please
wait for Richard to give the definitive answer.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: save-query-if-deleted
2006-09-27 8:37 save-query-if-deleted Karl Chen
2006-09-27 12:12 ` save-query-if-deleted martin rudalics
2006-09-27 18:12 ` save-query-if-deleted Eli Zaretskii
@ 2006-09-28 2:13 ` Richard Stallman
2 siblings, 0 replies; 4+ messages in thread
From: Richard Stallman @ 2006-09-28 2:13 UTC (permalink / raw)
Cc: emacs-devel
This is a new feature, so we should not consider it now.
We're aiming to fix bugs and make a release.
Please suggest this again a couple of months after Emacs 22.1
has been released.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-09-28 2:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-27 8:37 save-query-if-deleted Karl Chen
2006-09-27 12:12 ` save-query-if-deleted martin rudalics
2006-09-27 18:12 ` save-query-if-deleted Eli Zaretskii
2006-09-28 2:13 ` save-query-if-deleted Richard Stallman
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.