Didn't know about split-string...
This commit is contained in:
parent
45f8fa9763
commit
7ce74c2879
1 changed files with 1 additions and 10 deletions
11
magit.el
11
magit.el
|
@ -45,20 +45,11 @@
|
|||
(substring str 0 (- (length str) 1))
|
||||
str))))
|
||||
|
||||
(defun magit-string-split (string regexp)
|
||||
(let ((res nil)
|
||||
(pos 0)
|
||||
next)
|
||||
(while (setq next (string-match regexp string pos))
|
||||
(setq res (cons (substring string pos next) res))
|
||||
(setq pos (match-end 0)))
|
||||
(nreverse (cons (substring string pos) res))))
|
||||
|
||||
(defun magit-shell-lines (cmd &rest args)
|
||||
(let ((str (shell-command-to-string (apply 'format cmd args))))
|
||||
(if (string= str "")
|
||||
nil
|
||||
(magit-string-split str "\n"))))
|
||||
(split-string str "\n"))))
|
||||
|
||||
(defun magit-concat-with-delim (delim seqs)
|
||||
(cond ((null seqs)
|
||||
|
|
Loading…
Reference in a new issue