Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/sml-mode/sml-util.el
ViewVC logotype

Diff of /sml/trunk/sml-mode/sml-util.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 332, Tue Jun 15 00:51:38 1999 UTC revision 334, Thu Jun 17 02:43:15 1999 UTC
# Line 37  Line 37 
37            (flatten head rest)            (flatten head rest)
38          (cons head rest)))))          (cons head rest)))))
39    
40    (defun sml-preproc-alist (al)
41      "Expand an alist where keys can be lists of keys into a normal one."
42      (reduce (lambda (x al)
43                (let ((k (car x))
44                      (v (cdr x)))
45                  (if (consp k)
46                      (append (mapcar (lambda (y) (cons y v)) k) al)
47                    (cons x al))))
48              al
49              :initial-value nil
50              :from-end t))
51    
52  ;;;  ;;;
53  ;;; temp files  ;;; temp files
54  ;;;  ;;;
# Line 56  Line 68 
68  (add-hook 'kill-emacs-hook 'delete-temp-dirs)  (add-hook 'kill-emacs-hook 'delete-temp-dirs)
69    
70  (defun make-temp-dir (s)  (defun make-temp-dir (s)
71      "Create a temporary directory.
72    The returned dir name (created by appending some random characters at the end
73    of S and prepending `temporary-file-directory' if it is not already absolute)
74    is guaranteed to point to a newly created empty directory."
75    (let* ((prefix (expand-file-name s temp-file-dir))    (let* ((prefix (expand-file-name s temp-file-dir))
76           (dir (make-temp-name prefix)))           (dir (make-temp-name prefix)))
77      (if (not (ignore-errors (make-directory dir t) t))      (if (not (ignore-errors (make-directory dir t) t))
78          (make-temp-dir prefix)          (make-temp-dir prefix)
79        (push dir temp-directories)        (push dir temp-directories)
80        dir)))        (file-name-as-directory dir))))
81    
82  (defun make-temp-file (s)  (defun make-temp-file (s)
83      "Create a temporary file.
84    The returned file name (created by appending some random characters at the end
85    of S and prepending `temporary-file-directory' if it is not already absolute)
86    is guaranteed to point to a newly created empty file."
87    (unless (file-name-absolute-p s)    (unless (file-name-absolute-p s)
88      (unless (equal (user-uid)      (unless (equal (user-uid)
89                     (third (file-attributes temporary-file-directory)))                     (third (file-attributes temporary-file-directory)))

Legend:
Removed from v.332  
changed lines
  Added in v.334

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0