branch: externals/mpdired
commit 7ba00773154f87df7ccd17ee9ac37e96e669c415
Author: Manuel Giraud <[email protected]>
Commit: Manuel Giraud <[email protected]>
avoid consing in `mpdired--short-name'
---
mpdired.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/mpdired.el b/mpdired.el
index d34b71bbb8..85b6bf944c 100644
--- a/mpdired.el
+++ b/mpdired.el
@@ -347,7 +347,9 @@ used for mark followed by a space."
(+ 2 (line-beginning-position)))
(defun mpdired--short-name (string)
- (car (last (split-string string "/"))))
+ (or (and (string-match "/\\([^/]*\\)\\'" string)
+ (match-string 1 string))
+ string))
(defun mpdired--reset-face ()
(let* ((bol (mpdired--bol))