comparison lisp/files.el @ 22738:d35510185a2d

(find-file-noselect-1): Use kill-local-variable on buffer-file-coding-system, instead of setting it. (save-buffer): Doc fix. (basic-save-buffer): Doc fix.
author Richard M. Stallman <rms@gnu.org>
date Sun, 12 Jul 1998 03:14:44 +0000
parents 122946298ba4
children 1de4d5771a8f
comparison
equal deleted inserted replaced
22737:41e01b5de7cc 22738:d35510185a2d
966 error) 966 error)
967 (with-current-buffer buf 967 (with-current-buffer buf
968 (kill-local-variable 'find-file-literally) 968 (kill-local-variable 'find-file-literally)
969 ;; Needed in case we are re-visiting the file with a different 969 ;; Needed in case we are re-visiting the file with a different
970 ;; text representation. 970 ;; text representation.
971 (setq buffer-file-coding-system default-buffer-file-coding-system) 971 (kill-local-variable 'buffer-file-coding-system)
972 (erase-buffer) 972 (erase-buffer)
973 (and (default-value 'enable-multibyte-characters) 973 (and (default-value 'enable-multibyte-characters)
974 (not rawfile) 974 (not rawfile)
975 (set-buffer-multibyte t)) 975 (set-buffer-multibyte t))
976 (if rawfile 976 (if rawfile
2181 `kept-old-versions', which tells Emacs how many oldest versions to keep, 2181 `kept-old-versions', which tells Emacs how many oldest versions to keep,
2182 and `kept-new-versions', which tells how many newest versions to keep. 2182 and `kept-new-versions', which tells how many newest versions to keep.
2183 Defaults are 2 old versions and 2 new. 2183 Defaults are 2 old versions and 2 new.
2184 `dired-kept-versions' controls dired's clean-directory (.) command. 2184 `dired-kept-versions' controls dired's clean-directory (.) command.
2185 If `delete-old-versions' is nil, system will query user 2185 If `delete-old-versions' is nil, system will query user
2186 before trimming versions. Otherwise it does it silently." 2186 before trimming versions. Otherwise it does it silently.
2187
2188 See the subroutine `basic-save-buffer' for more information."
2187 (interactive "p") 2189 (interactive "p")
2188 (let ((modp (buffer-modified-p)) 2190 (let ((modp (buffer-modified-p))
2189 (large (> (buffer-size) 50000)) 2191 (large (> (buffer-size) 50000))
2190 (make-backup-files (or (and make-backup-files (not (eq args 0))) 2192 (make-backup-files (or (and make-backup-files (not (eq args 0)))
2191 (memq args '(16 64))))) 2193 (memq args '(16 64)))))
2218 will still use `buffer-file-coding-system'; this variable has no effect 2220 will still use `buffer-file-coding-system'; this variable has no effect
2219 in such cases.") 2221 in such cases.")
2220 2222
2221 (defun basic-save-buffer () 2223 (defun basic-save-buffer ()
2222 "Save the current buffer in its visited file, if it has been modified. 2224 "Save the current buffer in its visited file, if it has been modified.
2223 After saving the buffer, run `after-save-hook'." 2225 The hooks `write-contents-hooks', `local-write-file-hooks' and
2226 `write-file-hooks' get a chance to do the job of saving; if they do not,
2227 then the buffer is saved in the visited file file in the usual way.
2228 After saving the buffer, this function runs `after-save-hook'."
2224 (interactive) 2229 (interactive)
2225 (save-current-buffer 2230 (save-current-buffer
2226 ;; In an indirect buffer, save its base buffer instead. 2231 ;; In an indirect buffer, save its base buffer instead.
2227 (if (buffer-base-buffer) 2232 (if (buffer-base-buffer)
2228 (set-buffer (buffer-base-buffer))) 2233 (set-buffer (buffer-base-buffer)))