From 23f1a720004c3004657293a27ab24c08f5cdc2c8 Mon Sep 17 00:00:00 2001 From: Matt Lee Date: Thu, 20 Oct 2022 08:53:21 +0100 Subject: [PATCH] Add find-files alternative that works with multiple args or globs. --- eshell/alias | 2 +- init.el | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/eshell/alias b/eshell/alias index b6b2bc5..816a1ae 100644 --- a/eshell/alias +++ b/eshell/alias @@ -1,3 +1,3 @@ alias l ls -la $* alias c clear :scrollback -alias e find-file $1 +alias e matt-find-files $* diff --git a/init.el b/init.el index 22228e2..45d7c1b 100644 --- a/init.el +++ b/init.el @@ -175,6 +175,11 @@ (replace-regexp-in-string "%" "%%" (abbreviate-file-name (buffer-file-name))) "%b")))) +(defun matt-find-files (filenames) + "Useful as eshell alias, FILENAMES can be multiple args or globs." + (mapc 'find-file + (if (consp (car filenames)) (car filenames) filenames))) + (when (not (boundp 'matt-mode-line-format-default)) ;; make safe for re-evaluation (setq matt-mode-line-format-default mode-line-format))