;;;
;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;;; Version:
-;;; $Id: emu-18.el,v 7.0 1995/10/12 11:27:33 morioka Exp $
+;;; $Id: emu-18.el,v 7.1 1995/11/05 08:34:22 morioka Exp $
;;; Keywords: emulation, compatibility
;;;
;;; This file is part of tl and tm (Tools for MIME).
HOOK should be a symbol, and FUNCTION may be any valid function. If
HOOK is void, it is first set to nil. If HOOK's value is a single
function, it is changed to a list of functions.
-\[emu-18 Emacs 19 emulating function]"
+\[emu-18.el; Emacs 19 emulating function]"
(or (boundp hook)
(set hook nil)
)
(defun member (elt list)
"Return non-nil if ELT is an element of LIST. Comparison done with EQUAL.
The value is actually the tail of LIST whose car is ELT.
-\[emu-18 Emacs 19 emulating function]"
+\[emu-18.el; Emacs 19 emulating function]"
(while (and list (not (equal elt (car list))))
(setq list (cdr list)))
list)
+(defun delete (elt list)
+ "Delete by side effect any occurrences of ELT as a member of LIST.
+The modified LIST is returned. Comparison is done with `equal'.
+If the first member of LIST is ELT, deleting it is not a side effect;
+it is simply using a different list.
+Therefore, write `(setq foo (delete element foo))'
+to be sure of changing the value of `foo'.
+\[emu-18.el; Emacs 19 emulating function]"
+ (if (equal elt (car list))
+ (cdr list)
+ (let ((rest list)
+ (rrest (cdr list))
+ )
+ (while (and rrest (not (equal elt (car rrest))))
+ (setq rest rrest
+ rrest (cdr rrest))
+ )
+ (rplacd rest (cdr rrest))
+ list)))
+
;;; @ function
;;;
(defun defalias (SYM NEWDEF)
"Set SYMBOL's function definition to NEWVAL, and return NEWVAL.
Associates the function with the current load file, if any.
-\[emu-18 Emacs 19 emulating function]"
+\[emu-18.el; Emacs 19 emulating function]"
(fset SYM (symbol-function NEWDEF))
NEWDEF)
(defun byte-code-function-p (exp)
+ "T if OBJECT is a byte-compiled function object.
+\[emu-18.el; Emacs 19 emulating function]"
(let* ((rest (cdr (cdr exp))) elt)
(if (stringp (car rest))
(setq rest (cdr rest))
(defun make-directory-internal (dirname)
"Create a directory. One argument, a file name string.
-\[emu-18 Emacs 19 emulating function]"
+\[emu-18.el; 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))
"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]"
+\[emu-18.el; Emacs 19 emulating function]"
(let ((len (length dir))
(p 0) p1 path)
(catch 'tag