]> git.bundesbrandschatzamt.de Git - emacsconfig.git/commitdiff
add eshell-bookmark
authorAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Sun, 26 Nov 2023 15:52:05 +0000 (16:52 +0100)
committerAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Sun, 26 Nov 2023 15:52:05 +0000 (16:52 +0100)
Signed-off-by: Andreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
bba.org
elpa/eshell-bookmark-20170922.1514/eshell-bookmark-autoloads.el [new file with mode: 0644]
elpa/eshell-bookmark-20170922.1514/eshell-bookmark-pkg.el [new file with mode: 0644]
elpa/eshell-bookmark-20170922.1514/eshell-bookmark.el [new file with mode: 0644]

diff --git a/bba.org b/bba.org
index 038032b86729c386b8f930fa57d9252b62dde887..4ed05f23d4ae391399914f511e60988f55d1aae7 100644 (file)
--- 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 (file)
index 0000000..09cdfeb
--- /dev/null
@@ -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)))
+
+
+\f
+;;; Generated autoloads from eshell-bookmark.el
+
+(autoload 'eshell-bookmark-setup "eshell-bookmark" "\
+Setup eshell-bookmark.")
+(register-definition-prefixes "eshell-bookmark" '("eshell-bookmark--"))
+\f
+;;; 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 (file)
index 0000000..144e129
--- /dev/null
@@ -0,0 +1,14 @@
+(define-package "eshell-bookmark" "20170922.1514" "Integrate bookmarks with eshell."
+  '((emacs "24.3"))
+  :commit "deda4b848b2fb979dbe73ead2cb866610e3596ed" :authors
+  '(("Matúš Goljer" . "matus.goljerNOSPAMgmail.com"))
+  :maintainers
+  '(("Matúš Goljer" . "matus.goljerNOSPAMgmail.com"))
+  :maintainer
+  '("Matúš Goljer" . "matus.goljerNOSPAMgmail.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 (file)
index 0000000..229a15a
--- /dev/null
@@ -0,0 +1,63 @@
+;;; eshell-bookmark.el --- Integrate bookmarks with eshell.  -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 Matúš Goljer
+
+;; Author: Matúš Goljer <matus.goljerNOSPAMgmail.com>
+;; Maintainer: Matúš Goljer <matus.goljerNOSPAMgmail.com>
+;; 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 <http://www.gnu.org/licenses/>.
+
+;;; 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