From 578ed1ba98510058cf48f897a9bf4e3391684120 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Thu, 30 Jan 2020 16:00:29 +0000 Subject: Move move .emacs.d out of configs/shared Moving all of my Emacs-related files into their own directory at the root of this repository. --- emacs/.emacs.d/wpc/ivy-helpers.el | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 emacs/.emacs.d/wpc/ivy-helpers.el (limited to 'emacs/.emacs.d/wpc/ivy-helpers.el') diff --git a/emacs/.emacs.d/wpc/ivy-helpers.el b/emacs/.emacs.d/wpc/ivy-helpers.el new file mode 100644 index 000000000000..c71a907a20c1 --- /dev/null +++ b/emacs/.emacs.d/wpc/ivy-helpers.el @@ -0,0 +1,31 @@ +;;; ivy-helpers.el --- More interfaces to ivy -*- lexical-binding: t -*- +;; Author: William Carroll + +;;; Commentary: +;; Hopefully to improve my workflows. + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Dependencies +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(require 'alist) +(require 'tuple) +(require 'string) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Library +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(cl-defun ivy-helpers/kv (prompt kv f) + "PROMPT users with the keys in KV and return its corresponding value. Calls F +with the key and value from KV." + (ivy-read + prompt + kv + :require-match t + :action (lambda (entry) + (funcall f (car entry) (cdr entry))))) + +;;; Code: +(provide 'ivy-helpers) +;;; ivy-helpers.el ends here -- cgit 1.4.1