From 500e950d8842fff52b62ed4523b162bbf3cca631 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Sun, 26 Nov 2023 16:52:05 +0100 Subject: [PATCH] add eshell-bookmark Signed-off-by: Andreas Gerler --- bba.org | 6 ++ .../eshell-bookmark-autoloads.el | 30 +++++++++ .../eshell-bookmark-pkg.el | 14 +++++ .../eshell-bookmark.el | 63 +++++++++++++++++++ 4 files changed, 113 insertions(+) create mode 100644 elpa/eshell-bookmark-20170922.1514/eshell-bookmark-autoloads.el create mode 100644 elpa/eshell-bookmark-20170922.1514/eshell-bookmark-pkg.el create mode 100644 elpa/eshell-bookmark-20170922.1514/eshell-bookmark.el diff --git a/bba.org b/bba.org index 038032b8..4ed05f23 100644 --- a/bba.org +++ b/bba.org @@ -1809,6 +1809,12 @@ Bound to =C-X l != (eshell-send-input))) #+END_SRC +https://fuco1.github.io/2017-10-08-Using-bookmarks-with-eshell-and-docker-tramp.html + +#+begin_src emacs-lisp + (add-hook 'eshell-mode-hook 'eshell-bookmark-setup) +#+end_src + * [[http://stackoverflow.com/questions/3035337/in-emacs-can-you-evaluate-an-emacs-lisp-expression-and-replace-it-with-the-resul][eval emacs lisp expression and replace it]] [2014-11-02 Sun 18:21] diff --git a/elpa/eshell-bookmark-20170922.1514/eshell-bookmark-autoloads.el b/elpa/eshell-bookmark-20170922.1514/eshell-bookmark-autoloads.el new file mode 100644 index 00000000..09cdfebf --- /dev/null +++ b/elpa/eshell-bookmark-20170922.1514/eshell-bookmark-autoloads.el @@ -0,0 +1,30 @@ +;;; eshell-bookmark-autoloads.el --- automatically extracted autoloads (do not edit) -*- lexical-binding: t -*- +;; Generated by the `loaddefs-generate' function. + +;; This file is part of GNU Emacs. + +;;; Code: + +(add-to-list 'load-path (or (and load-file-name (directory-file-name (file-name-directory load-file-name))) (car load-path))) + + + +;;; Generated autoloads from eshell-bookmark.el + +(autoload 'eshell-bookmark-setup "eshell-bookmark" "\ +Setup eshell-bookmark.") +(register-definition-prefixes "eshell-bookmark" '("eshell-bookmark--")) + +;;; End of scraped data + +(provide 'eshell-bookmark-autoloads) + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; no-native-compile: t +;; coding: utf-8-emacs-unix +;; End: + +;;; eshell-bookmark-autoloads.el ends here diff --git a/elpa/eshell-bookmark-20170922.1514/eshell-bookmark-pkg.el b/elpa/eshell-bookmark-20170922.1514/eshell-bookmark-pkg.el new file mode 100644 index 00000000..144e1299 --- /dev/null +++ b/elpa/eshell-bookmark-20170922.1514/eshell-bookmark-pkg.el @@ -0,0 +1,14 @@ +(define-package "eshell-bookmark" "20170922.1514" "Integrate bookmarks with eshell." + '((emacs "24.3")) + :commit "deda4b848b2fb979dbe73ead2cb866610e3596ed" :authors + '(("Matúš Goljer" . "matus.goljer@gmail.com")) + :maintainers + '(("Matúš Goljer" . "matus.goljer@gmail.com")) + :maintainer + '("Matúš Goljer" . "matus.goljer@gmail.com") + :keywords + '("convenience" "files") + :url "https://github.com/Fuco1/eshell-bookmark") +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/elpa/eshell-bookmark-20170922.1514/eshell-bookmark.el b/elpa/eshell-bookmark-20170922.1514/eshell-bookmark.el new file mode 100644 index 00000000..229a15a5 --- /dev/null +++ b/elpa/eshell-bookmark-20170922.1514/eshell-bookmark.el @@ -0,0 +1,63 @@ +;;; 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 -- 2.47.3