emacs: Improve path segment regex

This commit is contained in:
Tom Willemsen 2012-08-19 12:13:23 +02:00
parent f6b0811650
commit 19a13b82ff

View file

@ -54,7 +54,7 @@
(defun oni:shorten-dir (dir) (defun oni:shorten-dir (dir)
"Shorten a directory, (almost) like fish does it." "Shorten a directory, (almost) like fish does it."
(while (string-match "\\(/\\.?.\\)[^/]+/" dir) (while (string-match "\\(/\\.?[^./]\\)[^/]+/" dir)
(setq dir (replace-match "\\1/" nil nil dir))) (setq dir (replace-match "\\1/" nil nil dir)))
dir) dir)