From a1f51ef6e1099a023cdc294efc0a1e8b589c2eff Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 18 Oct 2019 19:40:27 -0400 Subject: [PATCH] term/eshell: add emacs/e command --- modules/term/eshell/autoload/commands.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/term/eshell/autoload/commands.el b/modules/term/eshell/autoload/commands.el index 41571ff03..efb706ec6 100644 --- a/modules/term/eshell/autoload/commands.el +++ b/modules/term/eshell/autoload/commands.el @@ -1,5 +1,17 @@ ;;; term/eshell/autoload/commands.el -*- lexical-binding: t; -*- +;;;###autoload +(defun eshell/emacs (&rest files) + "Open a FILES in Emacs. +For folks with a habit of using \"emacs\" to open files, even in eshell." + (if args + (mapc #'find-file + (mapcar #'expand-file-name + (eshell-flatten-list (reverse args)))) + (bury-buffer))) +;;;###autoload +(defalias 'eshell/e #'eshell/emacs) + ;;;###autoload (defun eshell/cd-to-project () "Change to the project root of the current directory."