Renamed string-trim -> cl:string-trim, since there's now a string-trim in emacs 25.3.

Pascal J. Bourguignon [2018-05-11 09:41]
Renamed string-trim -> cl:string-trim, since there's now a string-trim in emacs 25.3.
Filename
android-classes.el
pjb-banks.el
pjb-cl.el
pjb-erc.el
pjb-objc-ide.el
pjb-searches.el
pl1-keywords.lisp
diff --git a/android-classes.el b/android-classes.el
index b8bed19..add7e04 100644
--- a/android-classes.el
+++ b/android-classes.el
@@ -21,7 +21,7 @@
         (packages (mapcar (lambda (li)
                             (let* ((a (get-first-child-tagged li 'a))
                                    (href (attribute-value (get-attribute-named a 'href )))
-                                   (name (string-trim " \n\t" (first (element-children a)))))
+                                   (name (cl:string-trim " \n\t" (first (element-children a)))))
                               (make-android-package-info name href)))
                           lis))
         (table (get-first-child-tagged body 'table))
@@ -30,7 +30,7 @@
                            (let* ((linkcol (get-first-child-valued tr 'class "jd-linkcol"))
                                   (a (get-first-child-tagged linkcol 'a))
                                   (url  (attribute-value (get-attribute-named a 'href)))
-                                  (name (string-trim " \n\t" (first (element-children a))))
+                                  (name (cl:string-trim " \n\t" (first (element-children a))))
                                   (package (if (and (prefixp root url)
                                                     (suffixp ".html" url))
                                                (substitute (character ".") (character "/")
diff --git a/pjb-banks.el b/pjb-banks.el
index 1a17320..0fff767 100644
--- a/pjb-banks.el
+++ b/pjb-banks.el
@@ -72,7 +72,7 @@ RETURN: A cleaned string where the comas are replaced by dots,
         (i 0)
         (result '()))
       ((null items) (apply (function concatenate) 'string (nreverse result)))
-    (unless (zerop (length (string-trim " " item)))
+    (unless (zerop (length (cl:string-trim " " item)))
       (incf i)
       (push (format "%10s" item) result)
       (when (zerop (mod i 6))
@@ -131,8 +131,8 @@ Use Mozilla, and copy-and-paste to emacs."
                (sol (match-string-no-properties 7 line))
                ;; (mat (match-lines))
                (lin) (ori))
-          (setf deb (string-trim " " deb)
-                cre (string-trim " " cre)
+          (setf deb (cl:string-trim " " deb)
+                cre (cl:string-trim " " cre)
                 y (+ y (cond ((and (= mv 12) (= m 1)) 1999)
                              ((and (= mv 1) (= m 12)) 2001)
                              (t                       2000)))
@@ -162,7 +162,7 @@ Use Mozilla, and copy-and-paste to emacs."
                      (if (< (length lab) 48) lab
                          (replace-regexp-in-string
                           "\n" "\n                "
-                          (string-trim " " (string-justify-left lab 48)))))
+                          (cl:string-trim " " (string-justify-left lab 48)))))
                   ,(cond
                     ((string-match "HACIENDA\\|SEGURIDAD" lab)
                      ":IMPUESTO")
@@ -222,8 +222,8 @@ Use Mozilla, and copy-and-paste to emacs."
                ;; (mat (match-lines))
                (lin) (ori))
           (message "%S %S %S" deb cre sol)
-          (setf deb (string-trim " " deb)
-                cre (string-trim " " cre)
+          (setf deb (cl:string-trim " " deb)
+                cre (cl:string-trim " " cre)
                 y (+ y (cond ((and (= mv 12) (= m 1)) 1999)
                              ((and (= mv 1) (= m 12)) 2001)
                              (t                       2000)))
diff --git a/pjb-cl.el b/pjb-cl.el
index 5d63589..54b7315 100644
--- a/pjb-cl.el
+++ b/pjb-cl.el
@@ -1127,7 +1127,7 @@ DO:     [cltl2] string= compares two strings and is true if they are
   (make-string size initial-element))


-(defun string-trim (character-bag string-designator)
+(defun cl:string-trim (character-bag string-designator)
   "Common-Lisp: returns a substring of string, with all characters in \
 character-bag stripped off the beginning and end.
 "
diff --git a/pjb-erc.el b/pjb-erc.el
index 2fdef8b..eaa510c 100644
--- a/pjb-erc.el
+++ b/pjb-erc.el
@@ -255,16 +255,16 @@
   (let* ((header-end (or (search "\r\n\r\n" http-output)
                          (search "\n\n" http-output)))
          (headers (mapcar
-                   (lambda (line) (string-trim "\r" line))
+                   (lambda (line) (cl:string-trim "\r" line))
                    (split-string (subseq http-output 0 header-end) "\n"))))
     (values
      (first headers)
      (mapcar (lambda (header)
                (let ((colon (position (character ":") header)))
-                 (cons (string-trim " " (subseq header 0 colon))
-                       (string-trim " " (subseq header (1+ colon))))))
+                 (cons (cl:string-trim " " (subseq header 0 colon))
+                       (cl:string-trim " " (subseq header (1+ colon))))))
              (rest headers))
-     (string-trim "\r\n" (subseq http-output  header-end)))))
+     (cl:string-trim "\r\n" (subseq http-output  header-end)))))

 (defun pjb-http-session (method url headers data)
   (with-temp-buffer
@@ -596,7 +596,7 @@ displaying erc buffers."
 (defun pjb-erc-user-input ()
   "Return the input of the user in the current buffer."
   ;; We use erc-bol to ignore the prompt.
-  (string-trim "\n" (buffer-substring
+  (cl:string-trim "\n" (buffer-substring
                      (progn
                        (goto-char (erc-beg-of-input-line))
                        (erc-bol))
diff --git a/pjb-objc-ide.el b/pjb-objc-ide.el
index a51d8fa..e8ca6c9 100644
--- a/pjb-objc-ide.el
+++ b/pjb-objc-ide.el
@@ -375,7 +375,7 @@ This command assumes point is not in a string or comment."
 (defun pjb-ide-insert-tag-comment (&optional tag)
   (interactive "p")
   (let ((tag   (or tag 0)))
-    (unless (string= "" (string-trim " \t" (pjb-ide-beginning-of-line-to-point)))
+    (unless (string= "" (cl:string-trim " \t" (pjb-ide-beginning-of-line-to-point)))
       (insert "\n"))
     (if (region-active-p)
         (let ((start (region-beginning))
diff --git a/pjb-searches.el b/pjb-searches.el
index 05b0021..d039253 100644
--- a/pjb-searches.el
+++ b/pjb-searches.el
@@ -73,7 +73,7 @@
    (browse-url
     (format "https://developer.apple.com/library/mac/search/?q=%s"
             (browse-url-url-encode-chars
-             (string-trim *whitespaces* search-string)
+             (cl:string-trim *whitespaces* search-string)
              "[^A-Za-z0-9]")))))

 (defun osx-search-region (start end)
@@ -89,7 +89,7 @@
       (browse-url
        (format "https://developer.apple.com/library/ios/search/?q=%s"
                (browse-url-url-encode-chars
-                (string-trim *whitespaces* search-string)
+                (cl:string-trim *whitespaces* search-string)
                 "[^A-Za-z0-9]")))))

 (defun ios-search-region (start end)
@@ -113,7 +113,7 @@
                                 (mapconcat (function identity) words "/")))))
                   (format "http://developer.android.com/reference/index.html?q=%s"
                           (browse-url-url-encode-chars
-                           (string-trim *whitespaces* search-string)
+                           (cl:string-trim *whitespaces* search-string)
                            "[^A-Za-z0-9]")))))

 (defun android-search-region (start end)
@@ -139,7 +139,7 @@
    (format "http://www.google.com/search?as_q=%s&num=50&hl=en&ie=ISO8869-1&btnG=Google+Search&as_epq=&as_oq=&as_eq=&lr=&as_ft=i&as_filetype=&as_qdr=all&as_nlo=&as_nhi=&as_occt=any&as_dt=i&as_s
 itesearch=&safe=images"
            (browse-url-url-encode-chars
-            (string-trim *whitespaces* search-string)
+            (cl:string-trim *whitespaces* search-string)
             "[^A-Za-z0-9]"))))

 (defun google-search-region (start end)
diff --git a/pl1-keywords.lisp b/pl1-keywords.lisp
index 7570ebe..c195b40 100644
--- a/pl1-keywords.lisp
+++ b/pl1-keywords.lisp
@@ -373,7 +373,7 @@ zerodivide|zdiv


 (defparameter *expanded-keywords*
-  (mapcar (lambda (regexp) (parse-lex-regexp (string-trim "     " regexp)))
+  (mapcar (lambda (regexp) (parse-lex-regexp (cl:string-trim "     " regexp)))
          (split-sequence:split-sequence  #\newline  *pl1-keywords* :remove-empty-subseqs t)))

 ;; (reduce (function append) *expanded-keywords*)
ViewGit