summaryrefslogtreecommitdiff
path: root/helm-utils.el
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2017-09-16 21:03:13 +0200
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2017-09-16 21:12:45 +0200
commit9686b3544b70e66d0d495192449807002283e1c3 (patch)
tree042805d49347fda3c29773e35dea4f2bafe3090d /helm-utils.el
parent634da585d6cd3577ae99c77e9e1fe697bf5d8ccb (diff)
Replace dired-simulteanous-find-file
* helm-utils.el (helm-simultaneous-find-file): New. * helm-files.el (helm-find-file-or-marked): Use it.
Diffstat (limited to 'helm-utils.el')
-rw-r--r--helm-utils.el17
1 files changed, 17 insertions, 0 deletions
diff --git a/helm-utils.el b/helm-utils.el
index 569a0706..f810d6aa 100644
--- a/helm-utils.el
+++ b/helm-utils.el
@@ -240,6 +240,23 @@ If a prefix arg is given split windows vertically."
(helm--switch-to-buffer-other-window buffer-or-name)
(switch-to-buffer buffer-or-name)))))
+(defun helm-simultaneous-find-file (files)
+ "Find files in FILES list in separate windows.
+If frame is too small to display all windows, continue finding files
+in background.
+When called with a prefix arg split is done vertically."
+ (save-selected-window
+ (helm-aif (cdr files)
+ (progn
+ (switch-to-buffer (find-file-noselect (car files)))
+ (cl-loop with nosplit
+ for f in it
+ for buf = (find-file-noselect f)
+ unless nosplit
+ do (condition-case-unless-debug _err
+ (helm--switch-to-buffer-other-window buf 'balance)
+ (error (setq nosplit t) nil)))))))
+
(defun helm--switch-to-buffer-other-window (buffer-or-name &optional balance)
(select-window (split-window
nil nil helm-current-prefix-arg))