diff options
| author | Richard M. Stallman | 2001-12-30 02:39:12 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2001-12-30 02:39:12 +0000 |
| commit | 14be1bc20240c3039bf6823d4e93ad71ebe12996 (patch) | |
| tree | 4ecde8495069b7bdc0629cfa622a2c9990bb37cd | |
| parent | 44fc58f2dae4af437ea96625372f5cfb44f44e0f (diff) | |
| download | emacs-14be1bc20240c3039bf6823d4e93ad71ebe12996.tar.gz emacs-14be1bc20240c3039bf6823d4e93ad71ebe12996.zip | |
(basic-save-buffer): If a before-write hook displays
an echo area message, pause before calling basic-save-buffer-1.
| -rw-r--r-- | lisp/files.el | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lisp/files.el b/lisp/files.el index 7e0f24268e7..a83bf037b1b 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -2606,6 +2606,7 @@ After saving the buffer, this function runs `after-save-hook'." | |||
| 2606 | (set-buffer (buffer-base-buffer))) | 2606 | (set-buffer (buffer-base-buffer))) |
| 2607 | (if (buffer-modified-p) | 2607 | (if (buffer-modified-p) |
| 2608 | (let ((recent-save (recent-auto-save-p)) | 2608 | (let ((recent-save (recent-auto-save-p)) |
| 2609 | msg | ||
| 2609 | setmodes tempsetmodes) | 2610 | setmodes tempsetmodes) |
| 2610 | ;; On VMS, rename file and buffer to get rid of version number. | 2611 | ;; On VMS, rename file and buffer to get rid of version number. |
| 2611 | (if (and (eq system-type 'vax-vms) | 2612 | (if (and (eq system-type 'vax-vms) |
| @@ -2652,14 +2653,18 @@ After saving the buffer, this function runs `after-save-hook'." | |||
| 2652 | (save-excursion | 2653 | (save-excursion |
| 2653 | (goto-char (point-max)) | 2654 | (goto-char (point-max)) |
| 2654 | (insert ?\n)))) | 2655 | (insert ?\n)))) |
| 2656 | (setq msg (current-message)) | ||
| 2655 | ;; Support VC version backups. | 2657 | ;; Support VC version backups. |
| 2656 | (vc-before-save) | 2658 | (vc-before-save) |
| 2657 | (or (run-hook-with-args-until-success 'write-contents-hooks) | 2659 | (or (run-hook-with-args-until-success 'write-contents-hooks) |
| 2658 | (run-hook-with-args-until-success 'local-write-file-hooks) | 2660 | (run-hook-with-args-until-success 'local-write-file-hooks) |
| 2659 | (run-hook-with-args-until-success 'write-file-hooks) | 2661 | (run-hook-with-args-until-success 'write-file-hooks) |
| 2660 | ;; If a hook returned t, file is already "written". | 2662 | (progn |
| 2661 | ;; Otherwise, write it the usual way now. | 2663 | (unless (equal msg (current-message)) |
| 2662 | (setq setmodes (basic-save-buffer-1))) | 2664 | (sit-for 2)) |
| 2665 | ;; If a hook returned t, file is already "written". | ||
| 2666 | ;; Otherwise, write it the usual way now. | ||
| 2667 | (setq setmodes (basic-save-buffer-1)))) | ||
| 2663 | ;; Now we have saved the current buffer. Let's make sure | 2668 | ;; Now we have saved the current buffer. Let's make sure |
| 2664 | ;; that buffer-file-coding-system is fixed to what | 2669 | ;; that buffer-file-coding-system is fixed to what |
| 2665 | ;; actually used for saving by binding it locally. | 2670 | ;; actually used for saving by binding it locally. |
| @@ -3731,7 +3736,7 @@ If WILDCARD, it also runs the shell specified by `shell-file-name'." | |||
| 3731 | (let ((available (get-free-disk-space "."))) | 3736 | (let ((available (get-free-disk-space "."))) |
| 3732 | (when available | 3737 | (when available |
| 3733 | ;; Replace "total" with "used", to avoid confusion. | 3738 | ;; Replace "total" with "used", to avoid confusion. |
| 3734 | (replace-match "used") | 3739 | (replace-match "total used in directory") |
| 3735 | (end-of-line) | 3740 | (end-of-line) |
| 3736 | (insert " available " available)))))))))) | 3741 | (insert " available " available)))))))))) |
| 3737 | 3742 | ||