Code was prepared, So I thought, if the nested list also includes a dotted list,and I try,it doesn't work. And then......:
(defun RemoveItem (item lst)
(mapcar '(lambda (x) (if (vl-consp x) (RemoveItem item x) x))
(vl-remove item lst)
)
)
;; or
(defun RemoveItem (item lst)
(mapcar '(lambda (x) (if (listp x) (RemoveItem item x) x))
(vl-remove item lst)
)
)
;; or:
(defun RemoveItem (item lst)
(mapcar '(lambda (x) (if (atom x) x (RemoveItem item x)))
(vl-remove item lst)
)
)
;; and:
(defun RemoveItem (item lst / x tmplst)
(foreach x (vl-remove item lst)
(if (atom x)
(setq tmplst (cons x tmplst))
(setq tmplst (cons (RemoveItem item x) tmplst))
)
)
(reverse tmplst)
)