aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/nxml
diff options
context:
space:
mode:
authorStefan Kangas2022-08-09 22:41:53 +0200
committerStefan Kangas2022-08-09 22:44:21 +0200
commit0e824bd683b2ba2ed7dc50a71efcdba38b70dd62 (patch)
tree052cbddfc0b899e48b2e7deb08c9ccbb17f32b99 /lisp/nxml
parent32d8fc999c070a4fa1539ebba6a6310bca58c5ef (diff)
downloademacs-0e824bd683b2ba2ed7dc50a71efcdba38b70dd62.tar.gz
emacs-0e824bd683b2ba2ed7dc50a71efcdba38b70dd62.zip
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>.
Diffstat (limited to 'lisp/nxml')
-rw-r--r--lisp/nxml/rng-dt.el2
-rw-r--r--lisp/nxml/rng-loc.el6
-rw-r--r--lisp/nxml/rng-util.el5
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.")
52 (rng-dt-error "The string datatype does not take any parameters"))) 52 (rng-dt-error "The string datatype does not take any parameters")))
53 ((eq name 'token) 53 ((eq name 'token)
54 (if (null params) 54 (if (null params)
55 '(t rng-collapse-space) 55 '(t string-clean-whitespace)
56 (rng-dt-error "The token datatype does not take any parameters"))) 56 (rng-dt-error "The token datatype does not take any parameters")))
57 (t 57 (t
58 (rng-dt-error "There is no built-in datatype %s" name)))) 58 (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."
354 (or (cdr (assq 'uri props)) 354 (or (cdr (assq 'uri props))
355 (let ((type-id (cdr (assq 'typeId props)))) 355 (let ((type-id (cdr (assq 'typeId props))))
356 (and type-id 356 (and type-id
357 (cons (rng-collapse-space type-id) nil))))) 357 (cons (string-clean-whitespace type-id) nil)))))
358 358
359(defun rng-possible-type-ids-using (file type-ids) 359(defun rng-possible-type-ids-using (file type-ids)
360 (let ((rules (rng-get-parsed-schema-locating-file file)) 360 (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."
366 (let ((id (cdr (assq 'id (cdr rule))))) 366 (let ((id (cdr (assq 'id (cdr rule)))))
367 (when id 367 (when id
368 (setq type-ids 368 (setq type-ids
369 (cons (rng-collapse-space id) 369 (cons (string-clean-whitespace id)
370 type-ids))))) 370 type-ids)))))
371 ((eq (car rule) 'include) 371 ((eq (car rule) 'include)
372 (let ((uri (cdr (assq 'rules (cdr rule))))) 372 (let ((uri (cdr (assq 'rules (cdr rule)))))
@@ -390,7 +390,7 @@ or nil."
390 (cond ((and (eq (car rule) 'typeId) 390 (cond ((and (eq (car rule) 'typeId)
391 (let ((id (assq 'id (cdr rule)))) 391 (let ((id (assq 'id (cdr rule))))
392 (and id 392 (and id
393 (string= (rng-collapse-space (cdr id)) type-id)))) 393 (string= (string-clean-whitespace (cdr id)) type-id))))
394 (setq schema (rng-match-default-rule (cdr rule)))) 394 (setq schema (rng-match-default-rule (cdr rule))))
395 ((eq (car rule) 'include) 395 ((eq (car rule) 'include)
396 (let ((uri (cdr (assq 'rules (cdr rule))))) 396 (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."
71 s 71 s
72 t)) 72 t))
73 73
74(defun rng-collapse-space (string)
75 (string-trim
76 (replace-regexp-in-string "[ \t\r\n]+" " " string t t)))
77
78(define-error 'rng-error nil) 74(define-error 'rng-error nil)
79 75
80(defun rng-uniquify-eq (list) 76(defun rng-uniquify-eq (list)
@@ -83,6 +79,7 @@ LIST is not modified."
83 79
84(define-obsolete-function-alias 'rng-uniquify-equal #'seq-uniq "28.1") 80(define-obsolete-function-alias 'rng-uniquify-equal #'seq-uniq "28.1")
85(define-obsolete-function-alias 'rng-blank-p #'string-blank-p "29.1") 81(define-obsolete-function-alias 'rng-blank-p #'string-blank-p "29.1")
82(define-obsolete-function-alias 'rng-collapse-space #'string-clean-whitespace "29.1")
86 83
87(provide 'rng-util) 84(provide 'rng-util)
88 85