Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
13157efc
Commit
13157efc
authored
Jul 27, 2000
by
Gerd Moellmann
Browse files
(remove, remq): New functions.
parent
96ce5c4f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
lisp/subr.el
lisp/subr.el
+16
-0
No files found.
lisp/subr.el
View file @
13157efc
...
...
@@ -135,6 +135,22 @@ If N is bigger than the length of X, return X."
(
setq
x
(
cdr
x
)))
x
))
(
defun
remove
(
elt
seq
)
"Return a copy of SEQ with all occurences of ELT removed.
SEQ must be a list, vector, or string. The comparison is done with `equal'."
(
if
(
nlistp
seq
)
;; If SEQ isn't a list, there's no need to copy SEQ because
;; `delete' will return a new object.
(
delete
elt
seq
)
(
delete
elt
(
copy-sequence
seq
))))
(
defun
remq
(
elt
list
)
"Return a copy of LIST with all occurences of ELT removed.
The comparison is done with `eq'."
(
if
(
memq
elt
list
)
(
delq
elt
(
copy-sequence
list
))
list
))
(
defun
assoc-default
(
key
alist
&optional
test
default
)
"Find object KEY in a pseudo-alist ALIST.
ALIST is a list of conses or objects. Each element (or the element's car,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment