From 37cb3739f5eba3a7f5312bcdc88b5c1cac698e2f Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 15 Dec 2019 04:49:51 -0500 Subject: [PATCH] docs/api: add appendq!, prependq! & pushnew! demos --- docs/api.org | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/docs/api.org b/docs/api.org index 9deb95584..c0bd470e2 100644 --- a/docs/api.org +++ b/docs/api.org @@ -10,6 +10,7 @@ It is integrated into Helpful, in Doom. - [[#add-hook][add-hook!]] - [[#add-transient-hook][add-transient-hook!]] - [[#after][after!]] + - [[#appendq][appendq!]] - [[#custom-set-faces][custom-set-faces!]] - [[#custom-theme-set-faces][custom-theme-set-faces!]] - [[#defer-feature][defer-feature!]] @@ -23,6 +24,7 @@ It is integrated into Helpful, in Doom. - [[#map][map!]] - [[#package][package!]] - [[#pushnew][pushnew!]] + - [[#prependq][prependq!]] - [[#quiet][quiet!]] - [[#remove-hook][remove-hook!]] - [[#setq-hook][setq-hook!]] @@ -90,6 +92,12 @@ It is integrated into Helpful, in Doom. (after! rustic ...) (after! python ...) #+END_SRC +*** appendq! +#+BEGIN_SRC elisp +(let ((x '(a b c))) + (appendq! x '(c d e)) + x) +#+END_SRC *** custom-set-faces! #+BEGIN_SRC elisp :eval no @@ -388,7 +396,26 @@ These are side-by-side comparisons, showing how to bind keys with and without (package! evil :ignore (not (equal system-name "my-desktop"))) #+END_SRC -*** TODO pushnew! +*** pushnew! +#+BEGIN_SRC elisp +(let ((list '(a b c))) + (pushnew! list 'c 'd 'e) + list) +#+END_SRC +*** prependq! +#+BEGIN_SRC elisp +(let ((x '(a b c))) + (prependq! x '(c d e)) + x) +#+END_SRC + +#+BEGIN_SRC elisp +(let ((x '(a b c)) + (y '(c d e)) + (z '(f g))) + (prependq! x y z '(h)) + x) +#+END_SRC *** quiet! #+BEGIN_SRC elisp :eval no ;; Enters recentf-mode without extra output