From: ueno Date: Sat, 4 Mar 2000 15:17:37 +0000 (+0000) Subject: * poe.el (remassq,remassoc,remrassoc): Rewrite. X-Git-Tag: emacs-21_0_90-apel-10_2-1~12 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d4e2b36f677ef61dcca539458b21ea9fa023e420;p=elisp%2Fapel.git * poe.el (remassq,remassoc,remrassoc): Rewrite. (remrassq): New function. --- diff --git a/poe.el b/poe.el index 27f53ee..1429e80 100644 --- a/poe.el +++ b/poe.el @@ -710,7 +710,7 @@ that is `eq' to KEY, there is no way to remove it by side effect; therefore, write `(setq foo (remassq key foo))' to be sure of changing the value of `foo'." (if (setq key (assq key list)) - (delete key list) + (delq key list) list)) ;; XEmacs 19.13 and later: (remassoc KEY LIST) @@ -721,7 +721,18 @@ that is `equal' to KEY, there is no way to remove it by side effect; therefore, write `(setq foo (remassoc key foo))' to be sure of changing the value of `foo'." (if (setq key (assoc key list)) - (delete key list) + (delq key list) + list)) + +;; XEmacs 19.13 and later: (remrassq VALUE LIST) +(defun-maybe remrassq (value list) + "Delete by side effect any elements of LIST whose cdr is `eq' to VALUE. +The modified LIST is returned. If the first member of LIST has a car +that is `eq' to VALUE, there is no way to remove it by side effect; +therefore, write `(setq foo (remrassq value foo))' to be sure of changing +the value of `foo'." + (if (setq value (rassq value list)) + (delq value list) list)) ;; XEmacs 19.13 and later: (remrassoc VALUE LIST) @@ -732,7 +743,7 @@ that is `equal' to VALUE, there is no way to remove it by side effect; therefore, write `(setq foo (remrassoc value foo))' to be sure of changing the value of `foo'." (if (setq value (rassoc value list)) - (delete value list) + (delq value list) list)) ;;; Define `functionp' here because "localhook" uses it.