emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 0e824bd683: Make rng-collapse-space obsolete


From: Stefan Kangas
Subject: master 0e824bd683: Make rng-collapse-space obsolete
Date: Tue, 9 Aug 2022 17:07:02 -0400 (EDT)

branch: master
commit 0e824bd683b2ba2ed7dc50a71efcdba38b70dd62
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>

    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>.
---
 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 b88653f79e..0523e8132b 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 302aa05176..40332aacd5 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 70951f35d5..7ac6db25f4 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)
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]