From 43bed1f97e6f1a229553d7a25dc437741326772e Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 10 May 2023 13:08:35 -0500 Subject: Bankruptcy 10 --- lisp/+org-capture.el | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 lisp/+org-capture.el (limited to 'lisp/+org-capture.el') diff --git a/lisp/+org-capture.el b/lisp/+org-capture.el deleted file mode 100644 index 2f7bf6a..0000000 --- a/lisp/+org-capture.el +++ /dev/null @@ -1,49 +0,0 @@ -;;; +org-capture.el -*- lexical-binding: t; -*- - -;;; Code: - -(require 'cl-lib) -;; Don't /require/ `org-capture', since that'll pull in all of `org' and that'll -;; take a minute. Just let the compiler know that this variable exists. -(defvar org-capture-templates nil) - -;; https://github.com/cadadr/configuration/blob/39813a771286e542af3aa333172858532c3bb257/emacs.d/gk/gk-org.el#L1573 -(defun +org-capture-template-define (description &rest args) - "Define a capture template. -Creates a list and adds it to `org-capture-templates', if it's -not already there. ARGS is a plist, which in addition to the -additional options `org-capture-templates' accepts (which see), -takes the following and puts them in the right spot: `:keys', -`:description', `:type', `:target', and `:template'." - (declare (indent 1)) - (let* ((keys (plist-get args :keys)) - (type (plist-get args :type)) - (target (plist-get args :target)) - (template (plist-get args :template)) - (template-value (append - (list description) - (when (or type target template) - (list (or type 'entry) target template)) - (cl-loop for i from 0 below (length args) by 2 - unless (member (nth i args) - '(:keys :description :type - :target :template)) - append (list (nth i args) - (plist-get args (nth i - args))))))) - ;; The only way I know how to do this properly (add a value to the end of - ;; the list, if it exists; otherwise update it) is to do this weird if-setf - ;; dance. - (if (seq-find (lambda (el) (equal (car el) keys)) - org-capture-templates) - (setf (alist-get keys org-capture-templates nil nil #'equal) - template-value) - (setf org-capture-templates - (append org-capture-templates - (list (cons keys template-value))))) - ;; Regardless of what we do, return the new value of - ;; `org-capture-templates'. - org-capture-templates)) - -(provide '+org-capture) -;;; +org-capture.el -- cgit 1.4.1-21-gabe81