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.
This commit is contained in:
Lars Ingebrigtsen 2021-11-09 23:58:42 +01:00
parent b9b27b6e55
commit fdc00b9836
2 changed files with 4 additions and 4 deletions

View file

@ -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)

View file

@ -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)