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-compat.el
ViewVC logotype

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

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

revision 332, Tue Jun 15 00:51:38 1999 UTC revision 535, Fri Feb 18 16:49:10 2000 UTC
# Line 22  Line 22 
22    
23  (unless (fboundp 'set-keymap-parents)  (unless (fboundp 'set-keymap-parents)
24    (defun set-keymap-parents (m parents)    (defun set-keymap-parents (m parents)
25        (if (keymapp parents) (setq parents (list parents)))
26      (set-keymap-parent      (set-keymap-parent
27       m       m
28       (if (cdr parents)       (if (cdr parents)
# Line 32  Line 33 
33                   :from-end t)                   :from-end t)
34         (car parents)))))         (car parents)))))
35    
36    ;; for XEmacs
37    (when (and (not (boundp 'temporary-file-directory)) (fboundp 'temp-directory))
38      (defvar temporary-file-directory (temp-directory)))
39    
40    (unless (fboundp 'make-temp-file)
41      ;; Copied from Emacs-21's subr.el
42      (defun make-temp-file (prefix &optional dir-flag)
43      "Create a temporary file.
44    The returned file name (created by appending some random characters at the end
45    of PREFIX, and expanding against `temporary-file-directory' if necessary,
46    is guaranteed to point to a newly created empty file.
47    You can then use `write-region' to write new data into the file.
48    
49    If DIR-FLAG is non-nil, create a new empty directory instead of a file."
50      (let (file)
51        (while (condition-case ()
52                   (progn
53                     (setq file
54                           (make-temp-name
55                            (expand-file-name prefix temporary-file-directory)))
56                     (if dir-flag
57                         (make-directory file)
58                       (write-region "" nil file nil 'silent nil 'excl))
59                     nil)
60                (file-already-exists t))
61          ;; the file was somehow created by someone else between
62          ;; `make-temp-name' and `write-region', let's try again.
63          nil)
64        file))
65    
66    
67  ;;  ;;
68  (provide 'sml-compat)  (provide 'sml-compat)

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

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