Make rng-collapse-space obsolete

* lisp/nxml/rng-util.el (rng-collapse-space): Make obsolete in favor
of 'string-clean-whitespace'.  Update callers.
Suggested by Lars Ingebrigtsen <larsi@gnus.org>.
This commit is contained in:
Stefan Kangas 2022-08-09 22:41:53 +02:00
parent 32d8fc999c
commit 0e824bd683
3 changed files with 5 additions and 8 deletions

View file

@ -52,7 +52,7 @@ a datatype library.")
(rng-dt-error "The string datatype does not take any parameters")))
((eq name 'token)
(if (null params)
'(t rng-collapse-space)
'(t string-clean-whitespace)
(rng-dt-error "The token datatype does not take any parameters")))
(t
(rng-dt-error "There is no built-in datatype %s" name))))

View file

@ -354,7 +354,7 @@ NS is t if the document has a non-nil, but not otherwise known namespace."
(or (cdr (assq 'uri props))
(let ((type-id (cdr (assq 'typeId props))))
(and type-id
(cons (rng-collapse-space type-id) nil)))))
(cons (string-clean-whitespace type-id) nil)))))
(defun rng-possible-type-ids-using (file type-ids)
(let ((rules (rng-get-parsed-schema-locating-file file))
@ -366,7 +366,7 @@ NS is t if the document has a non-nil, but not otherwise known namespace."
(let ((id (cdr (assq 'id (cdr rule)))))
(when id
(setq type-ids
(cons (rng-collapse-space id)
(cons (string-clean-whitespace id)
type-ids)))))
((eq (car rule) 'include)
(let ((uri (cdr (assq 'rules (cdr rule)))))
@ -390,7 +390,7 @@ or nil."
(cond ((and (eq (car rule) 'typeId)
(let ((id (assq 'id (cdr rule))))
(and id
(string= (rng-collapse-space (cdr id)) type-id))))
(string= (string-clean-whitespace (cdr id)) type-id))))
(setq schema (rng-match-default-rule (cdr rule))))
((eq (car rule) 'include)
(let ((uri (cdr (assq 'rules (cdr rule)))))

View file

@ -71,10 +71,6 @@ LIST is not modified."
s
t))
(defun rng-collapse-space (string)
(string-trim
(replace-regexp-in-string "[ \t\r\n]+" " " string t t)))
(define-error 'rng-error nil)
(defun rng-uniquify-eq (list)
@ -83,6 +79,7 @@ LIST is not modified."
(define-obsolete-function-alias 'rng-uniquify-equal #'seq-uniq "28.1")
(define-obsolete-function-alias 'rng-blank-p #'string-blank-p "29.1")
(define-obsolete-function-alias 'rng-collapse-space #'string-clean-whitespace "29.1")
(provide 'rng-util)