summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@snark.thyrsus.com>1993-04-25 22:26:51 +0000
committerEric S. Raymond <esr@snark.thyrsus.com>1993-04-25 22:26:51 +0000
commit462d83578d4496cbc47aa3abb36b01f348cbd6a3 (patch)
treeb4a428ce3d36c9b4de323e49d89ea219d1336ef2
parente4e3a5ea9638a25bb025b6d32b02c2a35f62669b (diff)
downloademacs-462d83578d4496cbc47aa3abb36b01f348cbd6a3.tar.gz
(comint-mod): Nuked. A call to ring-mod replaces it.
(comint-mem): Nuked. A call to member replaces it.
-rw-r--r--lisp/comint.el24
1 files changed, 2 insertions, 22 deletions
diff --git a/lisp/comint.el b/lisp/comint.el
index 8027c404d97..00c820af4a8 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -380,23 +380,11 @@ buffer. The hook comint-exec-hook is run after each exec."
(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 @@ Option comparison function ELT= defaults to equal."
(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")