diff options
author | Stefan Kangas <stefan@marxist.se> | 2021-04-05 15:14:19 +0200 |
---|---|---|
committer | Stefan Kangas <stefan@marxist.se> | 2021-04-05 15:14:19 +0200 |
commit | 6686a31591d2d22a4d1c7b6e68a618823186c48e (patch) | |
tree | f1ede142778839c1e9ee98a13607681805767bbe /lisp/nxml | |
parent | 20f7fa691b7c2859b96550d9ccb326bf394e160d (diff) | |
download | emacs-6686a31591d2d22a4d1c7b6e68a618823186c48e.tar.gz |
Remove local uniquify functions in favour of seq-uniq
* lisp/emacs-lisp/seq.el (seq-uniq): Add autoload cookie.
* lisp/pcomplete.el: (pcomplete-uniquify-list): Use seq-uniq.
* lisp/eshell/esh-util.el (eshell-uniqify-list)
(eshell-uniquify-list):
* lisp/nxml/rng-util.el (rng-uniquify-equal):
* lisp/progmodes/idlwave.el (idlwave-uniquify):
* lisp/textmodes/artist.el (artist-uniq): Make into obsolete
function aliases for seq-uniq. Update callers.
* lisp/nxml/rng-util.el (rng-uniquify-eq): Make obsolete in favor
of seq-uniq. Update callers.
Diffstat (limited to 'lisp/nxml')
-rw-r--r-- | lisp/nxml/rng-loc.el | 2 | ||||
-rw-r--r-- | lisp/nxml/rng-match.el | 2 | ||||
-rw-r--r-- | lisp/nxml/rng-nxml.el | 2 | ||||
-rw-r--r-- | lisp/nxml/rng-util.el | 28 |
4 files changed, 11 insertions, 23 deletions
diff --git a/lisp/nxml/rng-loc.el b/lisp/nxml/rng-loc.el index d5a608d6ff2..a38da794226 100644 --- a/lisp/nxml/rng-loc.el +++ b/lisp/nxml/rng-loc.el @@ -182,7 +182,7 @@ If TYPE-ID is non-nil, then locate the schema for this TYPE-ID." (while files (setq type-ids (rng-possible-type-ids-using (car files) type-ids)) (setq files (cdr files))) - (rng-uniquify-equal (sort type-ids 'string<)))) + (seq-uniq (sort type-ids 'string<)))) (defun rng-locate-schema-file-using (files) "Locate a schema using the schema locating files FILES. diff --git a/lisp/nxml/rng-match.el b/lisp/nxml/rng-match.el index 4fc6727d0e6..7a2739c0616 100644 --- a/lisp/nxml/rng-match.el +++ b/lisp/nxml/rng-match.el @@ -472,7 +472,7 @@ list is nullable and whose cdr is the normalized list." (cons nullable (if sorted head - (rng-uniquify-eq (sort head 'rng-compare-ipattern)))))) + (seq-uniq (sort head 'rng-compare-ipattern) #'eq))))) (defun rng-compare-ipattern (p1 p2) (< (rng--ipattern-index p1) diff --git a/lisp/nxml/rng-nxml.el b/lisp/nxml/rng-nxml.el index 7ea6fb2e49d..33768a46c94 100644 --- a/lisp/nxml/rng-nxml.el +++ b/lisp/nxml/rng-nxml.el @@ -522,7 +522,7 @@ set `xmltok-dtd'. Returns the position of the end of the token." (unless attribute-flag (setcdr ns-prefixes (cons nil (cdr ns-prefixes)))))) (setq iter (cdr iter))) - (rng-uniquify-equal + (seq-uniq (sort (apply #'append (cons extra-strings (mapcar (lambda (name) diff --git a/lisp/nxml/rng-util.el b/lisp/nxml/rng-util.el index a20e95086cb..67e2ee9f1e3 100644 --- a/lisp/nxml/rng-util.el +++ b/lisp/nxml/rng-util.el @@ -36,26 +36,6 @@ (defconst rng-builtin-datatypes-uri (rng-make-datatypes-uri "")) -(defun rng-uniquify-eq (list) - "Destructively remove `eq' duplicates from LIST." - (and list - (let ((head list)) - (while (cdr head) - (if (eq (car head) (cadr head)) - (setcdr head (cddr head))) - (setq head (cdr head))) - list))) - -(defun rng-uniquify-equal (list) - "Destructively remove `equal' duplicates from LIST." - (and list - (let ((head list)) - (while (cdr head) - (if (equal (car head) (cadr head)) - (setcdr head (cddr head))) - (setq head (cdr head))) - list))) - (defun rng-blank-p (str) (string-match "\\`[ \t\n\r]*\\'" str)) (defun rng-substq (new old list) @@ -104,6 +84,14 @@ LIST is not modified." (define-error 'rng-error nil) +;; Obsolete. + +(defun rng-uniquify-eq (list) + (declare (obsolete seq-uniq "28.1")) + (seq-uniq list #'eq)) + +(define-obsolete-function-alias 'rng-uniquify-equal #'seq-uniq "28.1") + (provide 'rng-util) ;;; rng-util.el ends here |