From fdc00b98361300861db6402e021d335025f6e8ce Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 9 Nov 2021 23:58:42 +0100 Subject: [PATCH] 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 ef299b21fd6..7d81d45326f 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 964daaaa15d..5d3cee591be 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) -- 2.39.5