Xah Talk Show 2024-08-22 Ep576, Emacs Lisp Coding, Toggle Theme, Print List, ErgoEmacs, Gun Emoji

vidthumb snxebfIO0G8
;; this version, is less efficient
(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
   ))