xtodo emacs site

put to tutorial

(defun xah-random-int (Min Max)
  "version 2022-08-26"
  (+ Min (random (- (1+ Max) Min))))

merge Emacs Lisp Examples to Xah Emacs Commands

looking-back is slow.

here's a typical usage:

(looking-back "[ \t\n]" (1- (point)) )

you can change it to:

;; warning. error if at point min
(prog2 (backward-char) (looking-at "[ \t\n]") (forward-char))

If the length of a list is being computed to compare to a (small) number, the length<, length> and length= functions may be more efficient.