emacs-diffs
[Top][All Lists]
Advanced

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

master fdc00b9: Make `dired-split' obsolete


From: Lars Ingebrigtsen
Subject: master fdc00b9: Make `dired-split' obsolete
Date: Tue, 9 Nov 2021 17:58:50 -0500 (EST)

branch: master
commit fdc00b98361300861db6402e021d335025f6e8ce
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Make `dired-split' obsolete
    
    * lisp/dired-aux.el (dired-tree-lessp): Adjust caller.
    (dired-split): Make obsolete (bug#50572).
    
    * lisp/ffap.el (ffap-list-env): Adjust comment.
---
 lisp/dired-aux.el | 6 +++---
 lisp/ffap.el      | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index ef299b2..7d81d45 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -2860,8 +2860,8 @@ of marked files.  If KILL-ROOT is non-nil, kill DIRNAME 
as well."
   ;;   if dired-actual-switches contained t.
   (setq dir1 (file-name-as-directory dir1)
        dir2 (file-name-as-directory dir2))
-  (let ((components-1 (dired-split "/" dir1))
-       (components-2 (dired-split "/" dir2)))
+  (let ((components-1 (split-string dir1 "/"))
+       (components-2 (split-string dir2 "/")))
     (while (and components-1
                components-2
                (equal (car components-1) (car components-2)))
@@ -2880,7 +2880,6 @@ of marked files.  If KILL-ROOT is non-nil, kill DIRNAME 
as well."
             nil)
            (t (error "This can't happen"))))))
 
-;; There should be a builtin split function - inverse to mapconcat.
 (defun dired-split (pat str &optional limit)
   "Splitting on regexp PAT, turn string STR into a list of substrings.
 Optional third arg LIMIT (>= 1) is a limit to the length of the
@@ -2890,6 +2889,7 @@ Thus, if SEP is a regexp that only matches itself,
    (mapconcat #'identity (dired-split SEP STRING) SEP)
 
 is always equal to STRING."
+  (declare (obsolete split-string "29.1"))
   (let* ((start (string-match pat str))
         (result (list (substring str 0 start)))
         (count 1)
diff --git a/lisp/ffap.el b/lisp/ffap.el
index 964daaa..5d3cee5 100644
--- a/lisp/ffap.el
+++ b/lisp/ffap.el
@@ -651,7 +651,7 @@ also is substituted for the first empty-string component, 
if there is one.
 Uses `path-separator' to separate the path into substrings."
   ;; We cannot use parse-colon-path (files.el), since it kills
   ;; "//" entries using file-name-as-directory.
-  ;; Similar: dired-split, TeX-split-string, and RHOGEE's psg-list-env
+  ;; Similar: TeX-split-string, and RHOGEE's psg-list-env
   ;; in ff-paths and bib-cite.  The EMPTY arg may help mimic kpathsea.
   (if (or empty (getenv env))          ; should return something
       (let ((start 0) match dir ret)



reply via email to

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