memory-leaks

Still reachable: lots of words in many pages.
git clone https://git.kevinlegouguec.net/memory-leaks
Log | Files | Refs | README | LICENSE

commit fc831dafd081ebeffc9d98c2a35597bef2a0d34a
parent 9b2bda7f2b714e59c5c53ab6bea7221730da0cea
Author: Kévin Le Gouguec <kevin.legouguec@gmail.com>
Date:   Fri, 24 Jun 2022 08:21:22 +0200

Add an Elisp "cheatsheet"

Diffstat:
Aguides/emacs/elisp-demos.org | 28++++++++++++++++++++++++++++
1 file changed, 28 insertions(+), 0 deletions(-)

diff --git a/guides/emacs/elisp-demos.org b/guides/emacs/elisp-demos.org @@ -0,0 +1,28 @@ +Some terse "context-free" Emacs Lisp snippets that hopefully speak for +themselves. + +* The prefix argument +#+begin_src elisp +(defun my/prefix-arg-demo (arg) + (interactive (list current-prefix-arg)) + (insert + (let ((num (prefix-numeric-value arg))) + (format "%s %d %s\n" + arg + num + (cond ((null arg) "N/A") + ((numberp arg) (format "M-%d or C-u %d" arg arg)) + ((equal arg '-) (format "M-- or C-u -")) + ((listp arg) + (if (< num 0) + (format "(M-- or C-u -) C-u × %d" (log (- num) 4)) + (format "C-u × %d" (log num 4))))))))) +#+end_src +#+begin_example +nil 1 N/A +2 2 M-2 or C-u 2 +- -1 M-- or C-u - +(-16) -16 (M-- or C-u -) C-u × 2 +(64) 64 C-u × 3 +#+end_example +