From e2ea74fbde0f1ebafd69d69f0c89580253f99e02 Mon Sep 17 00:00:00 2001 From: Derek Taylor Date: Fri, 12 Apr 2024 00:26:37 -0500 Subject: [PATCH] Testing completion-read. --- .config/emacs/config.el | 9 +++++++++ .config/emacs/config.org | 13 +++++++++++++ 2 files changed, 22 insertions(+) diff --git a/.config/emacs/config.el b/.config/emacs/config.el index 140913c..568eebb 100644 --- a/.config/emacs/config.el +++ b/.config/emacs/config.el @@ -700,3 +700,12 @@ which-key-max-description-length 25 which-key-allow-imprecise-window-fit nil which-key-separator " → " )) + +(defun reader () + (interactive) + (let ((choices '(("First" . 'first-choice) + ("Second" . 'second-choice) + ("Third" . 'third-choice)))) + (alist-get + (completing-read "Choose: " choices) + choices nil nil 'equal))) diff --git a/.config/emacs/config.org b/.config/emacs/config.org index 9f3c1e0..8dad8a4 100644 --- a/.config/emacs/config.org +++ b/.config/emacs/config.org @@ -55,6 +55,7 @@ - [[#tldr][TLDR]] - [[#transparency][TRANSPARENCY]] - [[#which-key][WHICH-KEY]] +- [[#test][TEST]] * IMPORTANT PROGRAMS TO LOAD FIRST To keep this =config.org= a reasonable length, I have moved a lot of code to individual scripts that will be sourced by this config. These scripts are found in "~/.config/emacs/scripts" and do not contain any code that most people are likely to need to edit. @@ -1026,3 +1027,15 @@ With Emacs version 29, true transparency has been added. I have turned transpar which-key-separator " → " )) #+end_src + +* TEST +#+begin_src emacs-lisp +(defun reader () + (interactive) + (let ((choices '(("First" . 'first-choice) + ("Second" . 'second-choice) + ("Third" . 'third-choice)))) + (alist-get + (completing-read "Choose: " choices) + choices nil nil 'equal))) +#+end_src