changeset 2583:308da27928f2

(comint-mod): Nuked. A call to ring-mod replaces it. (comint-mem): Nuked. A call to member replaces it.
author Eric S. Raymond <esr@snark.thyrsus.com>
date Sun, 25 Apr 1993 22:26:51 +0000
parents e01048f32511
children 55e18ce6e98a
files lisp/comint.el
diffstat 1 files changed, 2 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/comint.el	Sun Apr 25 22:26:48 1993 +0000
+++ b/lisp/comint.el	Sun Apr 25 22:26:51 1993 +0000
@@ -380,23 +380,11 @@
 	     (var (and (string-match "^[^=]*=" vv)
 		       (substring vv 0 (match-end 0)))))
 	(setq old-env (cdr old-env))
-	(cond ((not (and var (comint-mem var vars)))
+	(cond ((not (and var (member var vars)))
 	       (if var (setq var (cons var vars)))
 	       (setq ans (cons vv ans))))))
     (nreverse ans)))
 
-;;; This should be in emacs, but it isn't.
-(defun comint-mem (item list &optional elt=)
-  "Test to see if ITEM is equal to an item in LIST.
-Option comparison function ELT= defaults to equal."
-  (let ((elt= (or elt= (function equal)))
-	(done nil))
-    (while (and list (not done))
-      (if (funcall elt= item (car list))
-	  (setq done list)
-	  (setq list (cdr list))))
-    done))
-
 
 ;;; Input history retrieval commands
 ;;; M-p -- previous input    M-n -- next input
@@ -424,18 +412,10 @@
 		     (if (> arg 0) -1
 			 (if (< arg 0) 1 0))))
 	   (setq comint-input-ring-index
-		 (comint-mod (+ comint-input-ring-index arg) len))
+		 (ring-mod (+ comint-input-ring-index arg) len))
 	   (message "%d" (1+ comint-input-ring-index))
 	   (insert (ring-ref comint-input-ring comint-input-ring-index))))))
 
-(defun comint-mod (n m)
-  "Returns N mod M.  M is positive.
-Answer is guaranteed to be non-negative, and less than m."
-  (let ((n (% n m)))
-    (if (>= n 0) n
-	(+ n
-	   (if (>= m 0) m (- m)))))) ; (abs m)
-
 (defun comint-next-input (arg)
   "Cycle forwards through input history."
   (interactive "*p")