From 5a0ed0f67ee91f321c5dcdd739f5069bd3634b46 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Thu, 24 Nov 2022 21:50:52 -0800 Subject: feat(wpcarro/emacs): Package bookmark.el More Elisp packaging :) Change-Id: Ia4971de0815d12f8da1eaa911fa17b8b4896415d Reviewed-on: https://cl.tvl.fyi/c/depot/+/7383 Reviewed-by: wpcarro Tested-by: BuildkiteCI --- users/wpcarro/emacs/.emacs.d/wpc/bookmark.el | 50 ---------------------------- 1 file changed, 50 deletions(-) delete mode 100644 users/wpcarro/emacs/.emacs.d/wpc/bookmark.el (limited to 'users/wpcarro/emacs/.emacs.d/wpc/bookmark.el') diff --git a/users/wpcarro/emacs/.emacs.d/wpc/bookmark.el b/users/wpcarro/emacs/.emacs.d/wpc/bookmark.el deleted file mode 100644 index ab9169a078d4..000000000000 --- a/users/wpcarro/emacs/.emacs.d/wpc/bookmark.el +++ /dev/null @@ -1,50 +0,0 @@ -;;; bookmark.el --- Saved files and directories on my filesystem -*- lexical-binding: t -*- - -;; Author: William Carroll -;; Version: 0.0.1 -;; Package-Requires: ((emacs "24.3")) - -;;; Commentary: -;; A more opinionated version of Emacs's builtin `jump-to-register'. - -;;; Code: - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Dependencies -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(require 'project) -(require 'general) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Configuration -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(cl-defstruct bookmark label path kbd) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; API -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(defun bookmark-open (b) - "Open bookmark, B, as either a project directory or a regular directory." - (with-temp-buffer - (cd (bookmark-path b)) - (call-interactively #'project-find-file))) - -(defun bookmark-install-kbd (b) - "Define two functions to explore B and assign them to keybindings." - (eval `(defun ,(intern (format "bookmark-visit-%s" (bookmark-label b))) () - (interactive) - (find-file ,(bookmark-path b)))) - (eval `(defun ,(intern (format "bookmark-browse-%s" (bookmark-label b))) () - (interactive) - (bookmark-open ,b))) - (general-define-key - :prefix "" - :states '(motion) - (format "J%s" (bookmark-kbd b)) `,(intern (format "bookmark-visit-%s" (bookmark-label b))) - (format "j%s" (bookmark-kbd b)) `,(intern (format "bookmark-browse-%s" (bookmark-label b))))) - -(provide 'bookmark) -;;; bookmark.el ends here -- cgit 1.4.1