From 0e824bd683b2ba2ed7dc50a71efcdba38b70dd62 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Tue, 9 Aug 2022 22:41:53 +0200 Subject: [PATCH] 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 . --- lisp/nxml/rng-dt.el | 2 +- lisp/nxml/rng-loc.el | 6 +++--- lisp/nxml/rng-util.el | 5 +---- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/lisp/nxml/rng-dt.el b/lisp/nxml/rng-dt.el index b88653f79ec..0523e8132bf 100644 --- a/lisp/nxml/rng-dt.el +++ b/lisp/nxml/rng-dt.el @@ -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)))) diff --git a/lisp/nxml/rng-loc.el b/lisp/nxml/rng-loc.el index 302aa05176f..40332aacd50 100644 --- a/lisp/nxml/rng-loc.el +++ b/lisp/nxml/rng-loc.el @@ -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))))) diff --git a/lisp/nxml/rng-util.el b/lisp/nxml/rng-util.el index 70951f35d5d..7ac6db25f43 100644 --- a/lisp/nxml/rng-util.el +++ b/lisp/nxml/rng-util.el @@ -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) -- 2.39.5