Xah Talk Show 2024-08-22 Ep576, Emacs Lisp Coding, Toggle Theme, Print List, ErgoEmacs, Gun Emoji
- Timestamp
- 06:48 xah-toggle-theme
- 18:08 xah-print-list
- 25:44 more efficient implementation
- 11:33 insert date time
- 43:00 ergoemacs logo
- 48:42 gun emoji
- write
xah-toggle-theme
- emacs lisp, write
xah-print-list
, one item per line. but actually, return a formatted string
- emacs lisp, mod
xah-print-hash
so it return string instead
(defun xah-print-list (List)
"print list, one item per line.
Created: 2024-08-22
Version: 2024-08-22"
(interactive)
(mapc
(lambda (x)
(princ x) (princ "\n"))
List))
(defun xah-print-list (List)
"Print list, one item per line.
The function, returns a string.
Created: 2024-08-22
Version: 2024-08-22"
(interactive)
(let (xout)
(setq xout
(mapconcat
(lambda (x) (format "%s" x))
List "\n"))
(princ xout)))
(xah-print-list (number-sequence 1 50))
(xah-print-list
(list "some"
3589
(list 3 4 5)))
(defun xah-print-hash (HashTable)
"Prints the HashTable, each line is printed as key → val.
URL `http://xahlee.info/emacs/emacs/elisp_print_hash_table.html'
Version: 2024-04-20"
(maphash
(lambda (k v)
(princ (format "%s → %s" k v))
(princ "\n"))
HashTable
))