aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland McGrath1995-12-24 09:25:19 +0000
committerRoland McGrath1995-12-24 09:25:19 +0000
commit76d5492ba796849f6b2559ebdcdef58cef352dd8 (patch)
treecbd02206025991bf233ba736191f968370cede79
parentfe07d75e18fb2cdd4198b0d9519e133b7d8aeeb0 (diff)
downloademacs-76d5492ba796849f6b2559ebdcdef58cef352dd8.tar.gz
emacs-76d5492ba796849f6b2559ebdcdef58cef352dd8.zip
(save-some-buffers): Don't give message if we queried.
-rw-r--r--lisp/files.el111
1 files changed, 57 insertions, 54 deletions
diff --git a/lisp/files.el b/lisp/files.el
index a36d37f6ffb..4ddc8fc23a4 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -623,14 +623,14 @@ Type \\[describe-variable] directory-abbrev-alist RET for more information."
623 (let ((abbreviated-home-dir "$foo")) 623 (let ((abbreviated-home-dir "$foo"))
624 (concat "^" (abbreviate-file-name (expand-file-name "~")) 624 (concat "^" (abbreviate-file-name (expand-file-name "~"))
625 "\\(/\\|$\\)")))) 625 "\\(/\\|$\\)"))))
626 626
627 ;; If FILENAME starts with the abbreviated homedir, 627 ;; If FILENAME starts with the abbreviated homedir,
628 ;; make it start with `~' instead. 628 ;; make it start with `~' instead.
629 (if (and (string-match abbreviated-home-dir filename) 629 (if (and (string-match abbreviated-home-dir filename)
630 ;; If the home dir is just /, don't change it. 630 ;; If the home dir is just /, don't change it.
631 (not (and (= (match-end 0) 1) 631 (not (and (= (match-end 0) 1)
632 (= (aref filename 0) ?/))) 632 (= (aref filename 0) ?/)))
633 (not (and (or (eq system-type 'ms-dos) 633 (not (and (or (eq system-type 'ms-dos)
634 (eq system-type 'windows-nt)) 634 (eq system-type 'windows-nt))
635 (save-match-data 635 (save-match-data
636 (string-match "^[a-zA-Z]:/$" filename))))) 636 (string-match "^[a-zA-Z]:/$" filename)))))
@@ -690,7 +690,7 @@ find-file-hooks, etc.
690 (let ((file-name-handler-alist nil) 690 (let ((file-name-handler-alist nil)
691 (format-alist nil) 691 (format-alist nil)
692 (after-insert-file-functions nil) 692 (after-insert-file-functions nil)
693 (find-buffer-file-type-function 693 (find-buffer-file-type-function
694 (if (fboundp 'find-buffer-file-type) 694 (if (fboundp 'find-buffer-file-type)
695 (symbol-function 'find-buffer-file-type) 695 (symbol-function 'find-buffer-file-type)
696 nil))) 696 nil)))
@@ -1093,7 +1093,7 @@ If `enable-local-variables' is nil, this function does not check for a
1093 (let ((alist auto-mode-alist) 1093 (let ((alist auto-mode-alist)
1094 (mode nil)) 1094 (mode nil))
1095 ;; Find first matching alist entry. 1095 ;; Find first matching alist entry.
1096 (let ((case-fold-search 1096 (let ((case-fold-search
1097 (memq system-type '(vax-vms windows-nt)))) 1097 (memq system-type '(vax-vms windows-nt))))
1098 (while (and (not mode) alist) 1098 (while (and (not mode) alist)
1099 (if (string-match (car (car alist)) name) 1099 (if (string-match (car (car alist)) name)
@@ -1165,7 +1165,7 @@ If `enable-local-variables' is nil, this function does not check for a
1165 (setq result (cons (cons key val) result))) 1165 (setq result (cons (cons key val) result)))
1166 (skip-chars-forward " \t;"))) 1166 (skip-chars-forward " \t;")))
1167 (setq result (nreverse result)))) 1167 (setq result (nreverse result))))
1168 1168
1169 (if (and result 1169 (if (and result
1170 (or (eq enable-local-variables t) 1170 (or (eq enable-local-variables t)
1171 (and enable-local-variables 1171 (and enable-local-variables
@@ -1209,7 +1209,7 @@ in order to initialize other data structure based on them.")
1209 (set-window-start (selected-window) (point))) 1209 (set-window-start (selected-window) (point)))
1210 (y-or-n-p (format "Set local variables as specified at end of %s? " 1210 (y-or-n-p (format "Set local variables as specified at end of %s? "
1211 (if buffer-file-name 1211 (if buffer-file-name
1212 (file-name-nondirectory 1212 (file-name-nondirectory
1213 buffer-file-name) 1213 buffer-file-name)
1214 (concat "buffer " 1214 (concat "buffer "
1215 (buffer-name)))))))))) 1215 (buffer-name))))))))))
@@ -1832,7 +1832,7 @@ After saving the buffer, run `after-save-hook'."
1832 (error "Attempt to save to a file which you aren't allowed to write")))))) 1832 (error "Attempt to save to a file which you aren't allowed to write"))))))
1833 (or buffer-backed-up 1833 (or buffer-backed-up
1834 (setq setmodes (backup-buffer))) 1834 (setq setmodes (backup-buffer)))
1835 (let ((dir (file-name-directory buffer-file-name))) 1835 (let ((dir (file-name-directory buffer-file-name)))
1836 (if (and file-precious-flag 1836 (if (and file-precious-flag
1837 (file-writable-p dir)) 1837 (file-writable-p dir))
1838 ;; If file is precious, write temp name, then rename it. 1838 ;; If file is precious, write temp name, then rename it.
@@ -1856,7 +1856,7 @@ After saving the buffer, run `after-save-hook'."
1856 (setq succeed t)) 1856 (setq succeed t))
1857 ;; If writing the temp file fails, 1857 ;; If writing the temp file fails,
1858 ;; delete the temp file. 1858 ;; delete the temp file.
1859 (or succeed 1859 (or succeed
1860 (progn 1860 (progn
1861 (delete-file tempname) 1861 (delete-file tempname)
1862 (set-visited-file-modtime old-modtime)))) 1862 (set-visited-file-modtime old-modtime))))
@@ -1886,50 +1886,53 @@ Optional second argument EXITING means ask about certain non-file buffers
1886 as well as about file buffers." 1886 as well as about file buffers."
1887 (interactive "P") 1887 (interactive "P")
1888 (save-window-excursion 1888 (save-window-excursion
1889 (let ((files-done 1889 (let* ((queried nil)
1890 (map-y-or-n-p 1890 (files-done
1891 (function 1891 (map-y-or-n-p
1892 (lambda (buffer) 1892 (function
1893 (and (buffer-modified-p buffer) 1893 (lambda (buffer)
1894 (not (buffer-base-buffer buffer)) 1894 (and (buffer-modified-p buffer)
1895 (or 1895 (not (buffer-base-buffer buffer))
1896 (buffer-file-name buffer) 1896 (or
1897 (and exiting 1897 (buffer-file-name buffer)
1898 (progn 1898 (and exiting
1899 (set-buffer buffer) 1899 (progn
1900 (and buffer-offer-save (> (buffer-size) 0))))) 1900 (set-buffer buffer)
1901 (if arg 1901 (and buffer-offer-save (> (buffer-size) 0)))))
1902 t 1902 (if arg
1903 (if (buffer-file-name buffer) 1903 t
1904 (format "Save file %s? " 1904 (setq queried t)
1905 (buffer-file-name buffer)) 1905 (if (buffer-file-name buffer)
1906 (format "Save buffer %s? " 1906 (format "Save file %s? "
1907 (buffer-name buffer))))))) 1907 (buffer-file-name buffer))
1908 (function 1908 (format "Save buffer %s? "
1909 (lambda (buffer) 1909 (buffer-name buffer)))))))
1910 (set-buffer buffer) 1910 (function
1911 (save-buffer))) 1911 (lambda (buffer)
1912 (buffer-list) 1912 (set-buffer buffer)
1913 '("buffer" "buffers" "save") 1913 (save-buffer)))
1914 (list (list ?\C-r (lambda (buf) 1914 (buffer-list)
1915 (view-buffer buf) 1915 '("buffer" "buffers" "save")
1916 (setq view-exit-action 1916 (list (list ?\C-r (lambda (buf)
1917 '(lambda (ignore) 1917 (view-buffer buf)
1918 (exit-recursive-edit))) 1918 (setq view-exit-action
1919 (recursive-edit) 1919 '(lambda (ignore)
1920 ;; Return nil to ask about BUF again. 1920 (exit-recursive-edit)))
1921 nil) 1921 (recursive-edit)
1922 "display the current buffer")))) 1922 ;; Return nil to ask about BUF again.
1923 (abbrevs-done 1923 nil)
1924 (and save-abbrevs abbrevs-changed 1924 "display the current buffer"))))
1925 (progn 1925 (abbrevs-done
1926 (if (or arg 1926 (and save-abbrevs abbrevs-changed
1927 (y-or-n-p (format "Save abbrevs in %s? " abbrev-file-name))) 1927 (progn
1928 (write-abbrev-file nil)) 1928 (if (or arg
1929 ;; Don't keep bothering user if he says no. 1929 (y-or-n-p (format "Save abbrevs in %s? "
1930 (setq abbrevs-changed nil) 1930 abbrev-file-name)))
1931 t)))) 1931 (write-abbrev-file nil))
1932 (or (> files-done 0) abbrevs-done 1932 ;; Don't keep bothering user if he says no.
1933 (setq abbrevs-changed nil)
1934 t))))
1935 (or queried (> files-done 0) abbrevs-done
1933 (message "(No files need saving)"))))) 1936 (message "(No files need saving)")))))
1934 1937
1935(defun not-modified (&optional arg) 1938(defun not-modified (&optional arg)
@@ -2032,7 +2035,7 @@ to create parent directories if they don't exist."
2032 (let ((dir (directory-file-name (expand-file-name dir))) 2035 (let ((dir (directory-file-name (expand-file-name dir)))
2033 create-list) 2036 create-list)
2034 (while (not (file-exists-p dir)) 2037 (while (not (file-exists-p dir))
2035 (setq create-list (cons dir create-list) 2038 (setq create-list (cons dir create-list)
2036 dir (directory-file-name (file-name-directory dir)))) 2039 dir (directory-file-name (file-name-directory dir))))
2037 (while create-list 2040 (while create-list
2038 (make-directory-internal (car create-list)) 2041 (make-directory-internal (car create-list))
@@ -2266,7 +2269,7 @@ This command is used in the special Dired buffer created by
2266 (lambda (file) 2269 (lambda (file)
2267 (condition-case nil 2270 (condition-case nil
2268 (save-excursion (recover-file file)) 2271 (save-excursion (recover-file file))
2269 (error 2272 (error
2270 "Failed to recover `%s'" file))) 2273 "Failed to recover `%s'" file)))
2271 files 2274 files
2272 '("file" "files" "recover")) 2275 '("file" "files" "recover"))