aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2005-10-22 15:35:45 +0000
committerRichard M. Stallman2005-10-22 15:35:45 +0000
commit229ffb5a07c2b87eb55fb36f504d68dfccc8ad0a (patch)
treeb549a54c2089e70fb37ea7116ffd3610158a87d0
parentba27aa4c530c338b04c1feb2ed6bbed60663b306 (diff)
downloademacs-229ffb5a07c2b87eb55fb36f504d68dfccc8ad0a.tar.gz
emacs-229ffb5a07c2b87eb55fb36f504d68dfccc8ad0a.zip
(make-temp-file): Moved to files.el.
(get-buffer-window-list): Moved to window.el.
-rw-r--r--lisp/subr.el49
1 files changed, 0 insertions, 49 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index 0e9d3c2b5b0..5c662e9524d 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -183,18 +183,6 @@ macros."
183 (not (car-safe (cdr-safe (cdr-safe (cdr-safe (cdr-safe object))))))) 183 (not (car-safe (cdr-safe (cdr-safe (cdr-safe (cdr-safe object)))))))
184 (subrp object) (byte-code-function-p object) 184 (subrp object) (byte-code-function-p object)
185 (eq (car-safe object) 'lambda))) 185 (eq (car-safe object) 'lambda)))
186
187;; This should probably be written in C (i.e., without using `walk-windows').
188(defun get-buffer-window-list (buffer &optional minibuf frame)
189 "Return list of all windows displaying BUFFER, or nil if none.
190BUFFER can be a buffer or a buffer name.
191See `walk-windows' for the meaning of MINIBUF and FRAME."
192 (let ((buffer (if (bufferp buffer) buffer (get-buffer buffer))) windows)
193 (walk-windows (function (lambda (window)
194 (if (eq (window-buffer window) buffer)
195 (setq windows (cons window windows)))))
196 minibuf frame)
197 windows))
198 186
199;;;; List functions. 187;;;; List functions.
200 188
@@ -1861,43 +1849,6 @@ a system-dependent default device name is used."
1861 (play-sound-internal sound) 1849 (play-sound-internal sound)
1862 (error "This Emacs binary lacks sound support"))) 1850 (error "This Emacs binary lacks sound support")))
1863 1851
1864(defun make-temp-file (prefix &optional dir-flag suffix)
1865 "Create a temporary file.
1866The returned file name (created by appending some random characters at the end
1867of PREFIX, and expanding against `temporary-file-directory' if necessary),
1868is guaranteed to point to a newly created empty file.
1869You can then use `write-region' to write new data into the file.
1870
1871If DIR-FLAG is non-nil, create a new empty directory instead of a file.
1872
1873If SUFFIX is non-nil, add that at the end of the file name."
1874 (let ((umask (default-file-modes))
1875 file)
1876 (unwind-protect
1877 (progn
1878 ;; Create temp files with strict access rights. It's easy to
1879 ;; loosen them later, whereas it's impossible to close the
1880 ;; time-window of loose permissions otherwise.
1881 (set-default-file-modes ?\700)
1882 (while (condition-case ()
1883 (progn
1884 (setq file
1885 (make-temp-name
1886 (expand-file-name prefix temporary-file-directory)))
1887 (if suffix
1888 (setq file (concat file suffix)))
1889 (if dir-flag
1890 (make-directory file)
1891 (write-region "" nil file nil 'silent nil 'excl))
1892 nil)
1893 (file-already-exists t))
1894 ;; the file was somehow created by someone else between
1895 ;; `make-temp-name' and `write-region', let's try again.
1896 nil)
1897 file)
1898 ;; Reset the umask.
1899 (set-default-file-modes umask))))
1900
1901(defun shell-quote-argument (argument) 1852(defun shell-quote-argument (argument)
1902 "Quote an argument for passing as argument to an inferior shell." 1853 "Quote an argument for passing as argument to an inferior shell."
1903 (if (eq system-type 'ms-dos) 1854 (if (eq system-type 'ms-dos)