term/eshell: add emacs/e command

This commit is contained in:
Henrik Lissner 2019-10-18 19:40:27 -04:00
parent 9b95a18eb8
commit a1f51ef6e1
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -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."