aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2008-12-31 02:13:31 +0000
committerChong Yidong2008-12-31 02:13:31 +0000
commitf6fbae115cec54ffa26a10df5089610c018d1b10 (patch)
treed0e5001964f30816fa1a82ded63c42dd174a0de1
parent8f4897073558d62e0ab10952eaf646491157d1d8 (diff)
downloademacs-f6fbae115cec54ffa26a10df5089610c018d1b10.tar.gz
emacs-f6fbae115cec54ffa26a10df5089610c018d1b10.zip
(basic-save-buffer): Revert 2008-12-22 change.
(buffer-swapped-with): Var removed.
-rw-r--r--lisp/files.el20
1 files changed, 0 insertions, 20 deletions
diff --git a/lisp/files.el b/lisp/files.el
index 1f1640e24ba..4983e0f4a7d 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -4072,13 +4072,6 @@ in such cases.")
4072(make-variable-buffer-local 'save-buffer-coding-system) 4072(make-variable-buffer-local 'save-buffer-coding-system)
4073(put 'save-buffer-coding-system 'permanent-local t) 4073(put 'save-buffer-coding-system 'permanent-local t)
4074 4074
4075(defvar buffer-swapped-with nil
4076 "Buffer that this buffer's contents are temporarily swapped with.
4077You should only set this variable in file-visiting buffers,
4078because it only affects how to save the buffer in its file.")
4079
4080(make-variable-buffer-local 'buffer-swapped-with)
4081
4082(defun basic-save-buffer () 4075(defun basic-save-buffer ()
4083 "Save the current buffer in its visited file, if it has been modified. 4076 "Save the current buffer in its visited file, if it has been modified.
4084The hooks `write-contents-functions' and `write-file-functions' get a chance 4077The hooks `write-contents-functions' and `write-file-functions' get a chance
@@ -4087,19 +4080,6 @@ the visited file in the usual way.
4087Before and after saving the buffer, this function runs 4080Before and after saving the buffer, this function runs
4088`before-save-hook' and `after-save-hook', respectively." 4081`before-save-hook' and `after-save-hook', respectively."
4089 (interactive) 4082 (interactive)
4090 (if (not buffer-swapped-with)
4091 (basic-save-buffer-0)
4092 ;; If this buffer's real contents are "swapped" with some other buffer,
4093 ;; temporarily unswap in order to save the real contents.
4094 (unwind-protect
4095 (let ((modp (buffer-modified-p)))
4096 (buffer-swap-text buffer-swapped-with)
4097 (set-buffer-modified-p modp)
4098 (basic-save-buffer-0))
4099 (buffer-swap-text buffer-swapped-with)
4100 (set-buffer-modified-p nil))))
4101
4102(defun basic-save-buffer-0 ()
4103 (save-current-buffer 4083 (save-current-buffer
4104 ;; In an indirect buffer, save its base buffer instead. 4084 ;; In an indirect buffer, save its base buffer instead.
4105 (if (buffer-base-buffer) 4085 (if (buffer-base-buffer)