diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 1999-10-15 16:03:59 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 1999-10-15 16:03:59 +0000 |
commit | 767d12f23e80ebf247671e277f897c468f659b03 (patch) | |
tree | 5fd077bc47f3965d445717ca3a23463228416078 /lisp/jka-compr.el | |
parent | 93c8d183eee3a992940ebae612cc90eea1095ba9 (diff) | |
download | emacs-767d12f23e80ebf247671e277f897c468f659b03.tar.gz |
Use make-temp-file.
Diffstat (limited to 'lisp/jka-compr.el')
-rw-r--r-- | lisp/jka-compr.el | 42 |
1 files changed, 2 insertions, 40 deletions
diff --git a/lisp/jka-compr.el b/lisp/jka-compr.el index 7584016456c..234fb8375d8 100644 --- a/lisp/jka-compr.el +++ b/lisp/jka-compr.el @@ -356,49 +356,11 @@ There should be no more than seven characters after the final `/'." :type 'string :group 'jka-compr) -(defvar jka-compr-temp-name-table (make-vector 31 nil)) - (defun jka-compr-make-temp-name (&optional local-copy) "This routine will return the name of a new file." - (let* ((lastchar ?a) - (prevchar ?a) - (template (concat jka-compr-temp-name-template "aa")) - (lastpos (1- (length template))) - (not-done t) - file - entry) - - (while not-done - (aset template lastpos lastchar) - (setq file (concat (make-temp-name template) "#")) - (setq entry (intern file jka-compr-temp-name-table)) - (if (or (get entry 'active) - (file-exists-p file)) - - (progn - (setq lastchar (1+ lastchar)) - (if (> lastchar ?z) - (progn - (setq prevchar (1+ prevchar)) - (setq lastchar ?a) - (if (> prevchar ?z) - (error "Can't allocate temp file.") - (aset template (1- lastpos) prevchar))))) - - (put entry 'active (not local-copy)) - (setq not-done nil))) - - file)) - - -(defun jka-compr-delete-temp-file (temp) - - (put (intern temp jka-compr-temp-name-table) - 'active nil) + (make-temp-file jka-compr-temp-name-template)) - (condition-case () - (delete-file temp) - (error nil))) +(defalias 'jka-compr-delete-temp-file 'delete-file) (defun jka-compr-write-region (start end file &optional append visit) |