tm 6.88.
[elisp/apel.git] / emu-18.el
index 9d20e8d..43c3a5f 100644 (file)
--- a/emu-18.el
+++ b/emu-18.el
@@ -1,7 +1,15 @@
 ;;;
-;;; emu-18: Emacs 19.* emulation module for Emacs 18.*
+;;; emu-18.el --- Emacs 19.* emulation module for Emacs 18.*
 ;;;
-;;; $Id: emu-18.el,v 3.0 1995/08/26 18:07:06 morioka Exp $
+;;; Copyright (C) 1995 Free Software Foundation, Inc.
+;;; Copyright (C) 1994,1995 MORIOKA Tomohiko
+;;;
+;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;;; Version:
+;;;    $Id: emu-18.el,v 6.0 1995/09/21 00:06:48 morioka Exp $
+;;; Keywords: emulation, compatibility
+;;;
+;;; This file is part of tl and tm (Tools for MIME).
 ;;;
 
 ;; This function is imported from AUC TeX.
@@ -55,4 +63,45 @@ Associates the function with the current load file, if any.
   (fset SYM (symbol-function NEWDEF))
   NEWDEF)
 
+(defun make-directory-internal (dirname)
+  "Create a directory. One argument, a file name string.
+\[emu-18 Emacs 19 emulating function]"
+  (if (file-exists-p dirname)
+      (error "Creating directory: %s is already exist" dirname)
+    (if (not (= (call-process "mkdir" nil nil nil dirname) 0))
+       (error "Creating directory: no such file or directory, %s" dirname)
+      )))
+
+(defun make-directory (dir &optional parents)
+  "Create the directory DIR and any nonexistent parent dirs.
+The second (optional) argument PARENTS says whether
+to create parent directories if they don't exist.
+\[emu-18 Emacs 19 emulating function]"
+  (let ((len (length dir))
+       (p 0) p1 path)
+    (catch 'tag
+      (while (and (< p len) (string-match "[^/]*/?" dir p))
+       (setq p1 (match-end 0))
+       (if (= p1 len)
+           (throw 'tag nil)
+         )
+       (setq path (substring dir 0 p1))
+       (if (not (file-directory-p path))
+           (cond ((file-exists-p path)
+                  (error "Creating directory: %s is not directory" path)
+                  )
+                 ((null parents)
+                  (error "Creating directory: %s is not exist" path)
+                  )
+                 (t
+                  (make-directory-internal path)
+                  ))
+         )
+       (setq p p1)
+       ))
+    (make-directory-internal dir)
+    ))
+
+(defvar mouse-button-2 nil)
+
 (provide 'emu-18)