From: Richard M. Stallman Date: Fri, 23 Jan 1998 06:42:27 +0000 (+0000) Subject: (msb--strip-dir): Use Emacs filename primitives, not regexps. X-Git-Tag: emacs-20.3~2316 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=862aacbf3457ebb312614dbb17f188d37cbf3959;p=emacs.git (msb--strip-dir): Use Emacs filename primitives, not regexps. --- diff --git a/lisp/msb.el b/lisp/msb.el index 03361c16166..3db53b86ba1 100644 --- a/lisp/msb.el +++ b/lisp/msb.el @@ -456,14 +456,7 @@ If the argument is left out or nil, then the current buffer is considered." ;; Strip one hierarchy level from the end of DIR. (defun msb--strip-dir (dir) - (save-match-data - (cond - ((string-match "^\\([^/]*/.+/\\)[^/]+$" dir) - (substring dir (match-beginning 1) (match-end 1))) - ((string-match "^\\([^/]*/\\)" dir) - (substring dir (match-beginning 1) (match-end 1))) - (t - (error "msb: Directory `%s' has an unrecognized format" dir))))) + (file-name-directory (directory-file-name dir))) ;; Create an alist with all buffers from LIST that lies under the same ;; directory will be in the same item as the directory string.