diff options
author | Barry Warsaw <barry@python.org> | 1997-11-26 05:27:45 +0000 |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 1997-11-26 05:27:45 +0000 |
commit | 8cffc5a6b998b8064a9be0c3986b24a6afc14968 (patch) | |
tree | 5a959bbaf02eebcc2870dbf9a535d766f7938b16 /Misc | |
parent | cc4da6e0e3d48ed9978ec486f6673f4cad81f517 (diff) | |
download | cpython-8cffc5a6b998b8064a9be0c3986b24a6afc14968.tar.gz |
(py-kill-emacs-hook): Simplification.
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/python-mode.el | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/Misc/python-mode.el b/Misc/python-mode.el index e185bcae72..0904800a57 100644 --- a/Misc/python-mode.el +++ b/Misc/python-mode.el @@ -2597,17 +2597,6 @@ local bindings to py-newline-and-indent.")) (intern (buffer-substring (match-beginning 1) (match-end 1))) nil))) -(defun py-delete-file-silently (fname) - (condition-case nil - (delete-file fname) - (error nil))) - -(defun py-kill-emacs-hook () - ;; delete our temp files - (py-safe (while py-file-queue - (py-delete-file-silently (car py-file-queue)) - (setq py-file-queue (cdr py-file-queue))))) - (defun py-current-defun () ;; tell add-log.el how to find the current function/method/variable (save-excursion @@ -2668,6 +2657,11 @@ to do so may mean a greater delay in fixing your bug.\n\n") (py-keep-region-active)))) +(defun py-kill-emacs-hook () + (mapcar #'(lambda (filename) + (py-safe (delete-file filename))) + py-file-queue)) + ;; arrange to kill temp files when Emacs exists (add-hook 'kill-emacs-hook 'py-kill-emacs-hook) |