eshell-bookmark-2.0.0/0000755000175000017500000000000013161224276014426 5ustar dogslegdogslegeshell-bookmark-2.0.0/README.md0000644000175000017500000000142413161224276015706 0ustar dogslegdogsleg# eshell-bookmark Simple package integrating eshell with bookmark.el. # Installation Get it from MELPA or MELPA Stable with `M-x package-install eshell-bookmark`. # Usage Enable the bookmark by adding this setup to your config: ``` emacs-lisp (add-hook 'eshell-mode-hook 'eshell-bookmark-setup) ``` Or you can also manually call `(eshell-bookmark-setup)` from any other setup hook you already have. If you use `use-package`, the setup can look something like the following: ``` emacs-lisp (use-package eshell-bookmark :config (add-hook 'eshell-mode-hook 'eshell-bookmark-setup)) ``` After this, use the bookmark features as usual: * capture a bookmark to eshell with `C-x r m` * restore an eshell with `C-x r l` Works with remote/TRAMP hosts as well, which is super cool. eshell-bookmark-2.0.0/eshell-bookmark.el0000644000175000017500000000420313161224276020026 0ustar dogslegdogsleg;;; eshell-bookmark.el --- Integrate bookmarks with eshell. -*- lexical-binding: t -*- ;; Copyright (C) 2017 Matúš Goljer ;; Author: Matúš Goljer ;; Maintainer: Matúš Goljer ;; Version: 2.0.0 ;; Created: 6th September 2017 ;; Package-requires: ((emacs "24.3")) ;; Keywords: convenience, files ;; URL: https://github.com/Fuco1/eshell-bookmark ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the GNU General Public License ;; as published by the Free Software Foundation; either version 3 ;; of the License, or (at your option) any later version. ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with this program. If not, see . ;;; Commentary: ;; This package provides bookmark.el integration for eshell. It is ;; especially useful for quickly jumping to remote/TRAMP hosts. ;; To enable, add (add-hook 'eshell-mode-hook 'eshell-bookmark-setup) ;; to your configuration. ;;; Code: (require 'bookmark) (require 'eshell) (defun eshell-bookmark--make-record () "Create a eshell bookmark. The bookmark will try to open an eshell session with the pwd set to the location when the bookmark was created." (let ((bookmark `((handler . eshell-bookmark--restore) (filename . ,default-directory)))) bookmark)) (defun eshell-bookmark--restore (bookmark) "Restore eshell buffer according to BOOKMARK." (let ((eshell-buffer-name (or (bound-and-true-p shell-pop-last-shell-buffer-name) eshell-buffer-name))) (eshell) (setq default-directory (cdr (assq 'filename bookmark))) (eshell-reset))) ;;;###autoload (defun eshell-bookmark-setup () "Setup eshell-bookmark." (setq-local bookmark-make-record-function 'eshell-bookmark--make-record)) (provide 'eshell-bookmark) ;;; eshell-bookmark.el ends here