From 3e46106e9015e7048a23a4e2c25fcf8560845676 Mon Sep 17 00:00:00 2001 From: Kiana Sheibani Date: Wed, 14 Aug 2024 06:49:38 -0400 Subject: [PATCH] chore(scratch): remove old scratch definitions --- config.org | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) diff --git a/config.org b/config.org index 7651ab5..51d74de 100644 --- a/config.org +++ b/config.org @@ -4004,50 +4004,3 @@ This section is for code with little or no associated documentation. This could 2. Self-explanatory 3. Hard to categorize 4. Just not really worth the time it takes to write commentary - -** Org - -*** Automate Problem List - -#+begin_src emacs-lisp -(defvar ~/org-problem-spec-alist nil - "An alist of regexps matching problem specs.") - -(setq ~/org-problem-spec-alist - `((,(rx (group (+ digit)) - (* space) "-" (* space) - (group (+ digit)) - (* space) "odd") - . ,(lambda (beg end) - (when (cl-evenp beg) (cl-incf beg)) - (number-sequence beg end 2))) - (,(rx (group (+ digit)) - (* space) "-" (* space) - (group (+ digit)) - (* space) "even") - . ,(lambda (beg end) - (when (cl-oddp beg) (cl-incf beg)) - (number-sequence beg end 2))) - (,(rx (group (+ digit)) - (* space) "-" (* space) - (group (+ digit))) . number-sequence) - (,(rx (group (+ digit))) . list))) - - -(defun ~/org-generate-problem-list (&rest specs) - (interactive (s-split "," (read-from-minibuffer "Problems: "))) - (let* ((alist ~/org-problem-spec-alist) - (problems - (mapcan - (lambda (spec) - (let* ((match - (or (--some (-some-> (s-match (car it) spec) - cdr (cons (cdr it))) - alist) - (user-error "Invalid problem spec \"%s\"" spec)))) - (apply (cdr match) (mapcar #'string-to-number (car match))))) - specs))) - (move-to-left-margin) - (dolist (num problems) - (insert (format "- [ ] %d\n" num))))) -#+end_src