** completion-at-point is now an alias for complete-symbol.
+** mouse-region-delete-keys has been deleted.
+
+** If delete-file is called with a prefix argument, it really deletes,
+regardless of the value of `delete-by-moving-to-trash'.
+
\f
* Changes in Specialized Modes and Packages in Emacs 24.1
\f
* Lisp changes in Emacs 24.1
+** delete-file now accepts an optional second arg, FORCE, which says
+to always delete and ignore the value of delete-by-moving-to-trash.
+
** buffer-substring-filters is obsoleted by filter-buffer-substring-functions.
** New completion style `substring'.
+2010-05-03 Chong Yidong <cyd@stupidchicken.com>
+
+ * diff.el (diff-sentinel):
+
+ * epg.el (epg--make-temp-file, epg-decrypt-string)
+ (epg-verify-string, epg-sign-string, epg-encrypt-string):
+
+ * jka-compr.el (jka-compr-partial-uncompress)
+ (jka-compr-call-process, jka-compr-write-region, jka-compr-load):
+
+ * server.el (server-sentinel): Use delete-file's new FORCE arg
+ (Bug#6070).
+
2010-05-03 Stefan Monnier <monnier@iro.umontreal.ca>
Use define-minor-mode where applicable.
(tramp-handle-file-local-copy, tramp-handle-write-region)
(tramp-method-out-of-band-p): Use `tramp-get-inline-coding'.
-2010-05-01 Chong Yidong <cyd@stupidchicken.com>
-
- * server.el (server-sentinel, server-start, server-force-delete):
-
- * jka-compr.el (jka-compr-partial-uncompress)
- (jka-compr-call-process, jka-compr-write-region, jka-compr-load):
-
- * epg.el (epg--make-temp-file, epg-decrypt-string)
- (epg-encrypt-string, epg-verify-string, epg-sign-string):
-
- * diff.el (diff-sentinel): Bind delete-by-moving-to-trash to nil
- before deleting (Bug#6070).
-
2010-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
* bindings.el (mode-line-abbrev-mode, mode-line-auto-fill-mode):
"Code run when the diff process exits.
CODE is the exit code of the process. It should be 0 only if no diffs
were found."
- (let (delete-by-moving-to-trash)
- (if diff-old-temp-file (delete-file diff-old-temp-file))
- (if diff-new-temp-file (delete-file diff-new-temp-file)))
+ (if diff-old-temp-file (delete-file diff-old-temp-file t))
+ (if diff-new-temp-file (delete-file diff-new-temp-file t))
(save-excursion
(goto-char (point-max))
(let ((inhibit-read-only t))
;; Cleanup the tempfile.
(and tempfile
(file-exists-p tempfile)
- (let (delete-by-moving-to-trash)
- (delete-file tempfile)))
+ (delete-file tempfile t))
;; Cleanup the tempdir.
(and tempdir
(file-directory-p tempdir)
(epg-read-output context))
(epg-delete-output-file context)
(if (file-exists-p input-file)
- (let (delete-by-moving-to-trash)
- (delete-file input-file)))
+ (delete-file input-file t))
(epg-reset context))))
(defun epg-start-verify (context signature &optional signed-text)
(epg-delete-output-file context)
(if (and input-file
(file-exists-p input-file))
- (let (delete-by-moving-to-trash)
- (delete-file input-file)))
+ (delete-file input-file))
(epg-reset context))))
(defun epg-start-sign (context plain &optional mode)
(epg-read-output context))
(epg-delete-output-file context)
(if input-file
- (let (delete-by-moving-to-trash)
- (delete-file input-file)))
+ (delete-file input-file t))
(epg-reset context))))
(defun epg-start-encrypt (context plain recipients
(epg-read-output context))
(epg-delete-output-file context)
(if input-file
- (let (delete-by-moving-to-trash)
- (delete-file input-file)))
+ (delete-file input-file t))
(epg-reset context))))
(defun epg-start-export-keys (context keys)
null-device))
jka-compr-acceptable-retval-list)
(jka-compr-error prog args infile message err-file))
- (let (delete-by-moving-to-trash)
- (delete-file err-file))))
+ (delete-file err-file t)))
;; Run the uncompression program directly.
;; We get the whole file and must delete what we don't want.
"")))
jka-compr-acceptable-retval-list)
(jka-compr-error prog args infile message err-file))
- (let (delete-by-moving-to-trash)
- (delete-file err-file))))
+ (delete-file err-file t)))
(or (eq 0
(apply 'call-process
prog infile (if (stringp output) temp output)
(and append can-append) 'dont))
(erase-buffer)) )
- (let (delete-by-moving-to-trash)
- (delete-file temp-file))
+ (delete-file temp-file t)
(and
compress-message
(setq file (file-name-sans-extension file)))
(setcar l file)))
- (let (delete-by-moving-to-trash)
- (delete-file local-copy)))
+ (delete-file local-copy))
t))
(and (process-contact proc :server)
(eq (process-status proc) 'closed)
(ignore-errors
- (let (delete-by-moving-to-trash)
- (delete-file (process-get proc :server-file)))))
+ (delete-file (process-get proc :server-file) t)))
(server-log (format "Status changed to %s: %s" (process-status proc) msg) proc)
(server-delete-client proc))
+2010-05-03 Chong Yidong <cyd@stupidchicken.com>
+
+ * eval.c (internal_condition_case_n): Rename from
+ internal_condition_case_2.
+ (internal_condition_case_2): New function.
+
+ * xdisp.c (safe_call): Use internal_condition_case_n.
+
+ * fileio.c (Fdelete_file, internal_delete_file): New arg FORCE.
+ (internal_delete_file, Frename_file): Callers changed.
+
+ * buffer.c (Fkill_buffer):
+ * callproc.c (delete_temp_file): Callers changed (Bug#6070).
+
+ * lisp.h: Update prototypes.
+
2010-05-03 Glenn Morris <rgm@gnu.org>
* Makefile.in (LIBX_EXTRA, LIBX_BASE): New variables.
Lisp_Object tem;
tem = Fsymbol_value (intern ("delete-auto-save-files"));
if (! NILP (tem))
- internal_delete_file (b->auto_save_file_name);
+ internal_delete_file (b->auto_save_file_name, Qt);
}
if (b->base_buffer)
/* Suppress jka-compr handling, etc. */
int count = SPECPDL_INDEX ();
specbind (intern ("file-name-handler-alist"), Qnil);
- internal_delete_file (name);
+ internal_delete_file (name, Qt);
unbind_to (count, Qnil);
return Qnil;
}
return val;
}
+/* Like internal_condition_case_1 but call BFUN with ARG1 and ARG2 as
+ its arguments. */
+
+Lisp_Object
+internal_condition_case_2 (bfun, arg1, arg2, handlers, hfun)
+ Lisp_Object (*bfun) ();
+ Lisp_Object arg1;
+ Lisp_Object arg2;
+ Lisp_Object handlers;
+ Lisp_Object (*hfun) ();
+{
+ Lisp_Object val;
+ struct catchtag c;
+ struct handler h;
+
+ /* Since Fsignal will close off all calls to x_catch_errors,
+ we will get the wrong results if some are not closed now. */
+#if HAVE_X_WINDOWS
+ if (x_catching_errors ())
+ abort ();
+#endif
+
+ c.tag = Qnil;
+ c.val = Qnil;
+ c.backlist = backtrace_list;
+ c.handlerlist = handlerlist;
+ c.lisp_eval_depth = lisp_eval_depth;
+ c.pdlcount = SPECPDL_INDEX ();
+ c.poll_suppress_count = poll_suppress_count;
+ c.interrupt_input_blocked = interrupt_input_blocked;
+ c.gcpro = gcprolist;
+ c.byte_stack = byte_stack_list;
+ if (_setjmp (c.jmp))
+ {
+ return (*hfun) (c.val);
+ }
+ c.next = catchlist;
+ catchlist = &c;
+ h.handler = handlers;
+ h.var = Qnil;
+ h.next = handlerlist;
+ h.tag = &c;
+ handlerlist = &h;
+
+ val = (*bfun) (arg1, arg2);
+ catchlist = c.next;
+ handlerlist = h.next;
+ return val;
+}
/* Like internal_condition_case but call BFUN with NARGS as first,
and ARGS as second argument. */
Lisp_Object
-internal_condition_case_2 (bfun, nargs, args, handlers, hfun)
+internal_condition_case_n (bfun, nargs, args, handlers, hfun)
Lisp_Object (*bfun) ();
int nargs;
Lisp_Object *args;
return Qnil;
}
-DEFUN ("delete-file", Fdelete_file, Sdelete_file, 1, 1, "fDelete file: ",
+DEFUN ("delete-file", Fdelete_file, Sdelete_file, 1, 2, "fDelete file: \nP",
doc: /* Delete file named FILENAME. If it is a symlink, remove the symlink.
-If file has multiple names, it continues to exist with the other names. */)
- (filename)
+If file has multiple names, it continues to exist with the other names.
+
+If optional arg FORCE is non-nil, really delete the file regardless of
+`delete-by-moving-to-trash'. Otherwise, \"deleting\" actually moves
+it to the system's trash can if `delete-by-moving-to-trash' is non-nil.
+Interactively, FORCE is non-nil if called with a prefix arg. */)
+ (filename, force)
Lisp_Object filename;
+ Lisp_Object force;
{
Lisp_Object handler;
Lisp_Object encoded_file;
if (!NILP (handler))
return call2 (handler, Qdelete_file, filename);
- if (delete_by_moving_to_trash)
+ if (delete_by_moving_to_trash && NILP (force))
return call1 (Qmove_file_to_trash, filename);
encoded_file = ENCODE_FILE (filename);
return Qt;
}
-/* Delete file FILENAME, returning 1 if successful and 0 if failed. */
+/* Delete file FILENAME, returning 1 if successful and 0 if failed.
+ FORCE means to ignore `delete-by-moving-to-trash'. */
int
-internal_delete_file (filename)
- Lisp_Object filename;
+internal_delete_file (Lisp_Object filename, Lisp_Object force)
{
Lisp_Object tem;
- tem = internal_condition_case_1 (Fdelete_file, filename,
+
+ tem = internal_condition_case_2 (Fdelete_file, filename, force,
Qt, internal_delete_file_1);
return NILP (tem);
}
)
call2 (Qdelete_directory, file, Qt);
else
- Fdelete_file (file);
+ Fdelete_file (file, Qt);
unbind_to (count, Qnil);
}
else
extern Lisp_Object internal_lisp_condition_case P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
extern Lisp_Object internal_condition_case P_ ((Lisp_Object (*) (void), Lisp_Object, Lisp_Object (*) (Lisp_Object)));
extern Lisp_Object internal_condition_case_1 P_ ((Lisp_Object (*) (Lisp_Object), Lisp_Object, Lisp_Object, Lisp_Object (*) (Lisp_Object)));
-extern Lisp_Object internal_condition_case_2 P_ ((Lisp_Object (*) (int, Lisp_Object *), int, Lisp_Object *, Lisp_Object, Lisp_Object (*) (Lisp_Object)));
+extern Lisp_Object internal_condition_case_2 P_ ((Lisp_Object (*) (Lisp_Object, Lisp_Object), Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object (*) (Lisp_Object)));
+extern Lisp_Object internal_condition_case_n P_ ((Lisp_Object (*) (int, Lisp_Object *), int, Lisp_Object *, Lisp_Object, Lisp_Object (*) (Lisp_Object)));
extern void specbind P_ ((Lisp_Object, Lisp_Object));
extern void record_unwind_protect P_ ((Lisp_Object (*) (Lisp_Object), Lisp_Object));
extern Lisp_Object unbind_to P_ ((int, Lisp_Object));
EXFUN (Fread_file_name, 6);
extern Lisp_Object close_file_unwind P_ ((Lisp_Object));
extern void report_file_error P_ ((const char *, Lisp_Object)) NO_RETURN;
-extern int internal_delete_file P_ ((Lisp_Object));
+extern int internal_delete_file P_ ((Lisp_Object, Lisp_Object));
extern void syms_of_fileio P_ ((void));
extern Lisp_Object make_temp_name P_ ((Lisp_Object, int));
EXFUN (Fmake_symbolic_link, 3);
specbind (Qinhibit_redisplay, Qt);
/* Use Qt to ensure debugger does not run,
so there is no possibility of wanting to redisplay. */
- val = internal_condition_case_2 (Ffuncall, nargs, args, Qt,
+ val = internal_condition_case_n (Ffuncall, nargs, args, Qt,
safe_eval_handler);
UNGCPRO;
val = unbind_to (count, val);