Xah Emacs Blog

A blackhole you cannot escape.

emacs bug. if u have a lang with comment syntax such as

/▮/ comment
/▮* comment */
(▮* comment *)

and cursor is on after the 1st char in the line, then you do (nth 4 (syntax-ppss)) it returns nil.

however, if cursor is at

/* comment *▮/
(* comment *▮)

it return true.

major re-organization Xah Emacs Tutorial

now

more updates, minor or major:

and lots other pages.

massive reorg

all code update

set-transient-map clear-transient-map bug

new version of xah emacs tutorial is generated. buy it! Sending update in this week.

ErgoEmacs mascot-s276x226
Buy Xah Emacs Tutorial

updates:

new and updates

other updates

updates

updates

updated.

xah talk show 2022-05-21 emacs lisp coding, bionic reading command

updates

great to know. powershell does not choke by emacs Formfeed char

powershell emacs form feed 2022-05-17
powershell emacs form feed 2022-05-17

new and updates

xah talk show 2022-05-12 emacs, most efficient ways to open file

and updated:

Xah Talk Show 2022-05-11 How I Got into LISP, Should You Learn Wolfram Language, Math Plane Curves

updates

xtodo

Famous Emacs Users new addition.

updates.

xah talk show 2022-04-25 emacs lisp, write command to delete cache files, Language Server Protocol Kills Emacs

xah-fly-keys now on nonGnu ELPA. Emacs: Xah Fly Keys

14 years old bug, now fixed in emacs 29. describe-mode. thanks to Lars Ingebrigtsen

following xtodo todo, clean up the index mess:

Richard Stallman, High-tech Prankster new photos. from [Don Hopkins][ https://en.wikipedia.org/wiki/Don_Hopkins ]

emacs 28 added the 'emoji group of characters.

emacs 28 now support flex match for name completion for all commands that use minibuffer prompt. major update:

emac 28, am extremely IMPRESSED. Best upgrade, most user level features in past 10 years, and the “NEWS” file is now READABLE. eg emacs now has proper undo/redo. All packages trying to fix it in past 20 years are done for. Review/livestream in coming weeks.

xah talk show 2022-03-26 write a search engine for my site. emacs lisp + JavaScript coding

xah lee emacs packages on melpa stats xtodo need to get other stat to that page.

Major update. Lots new pages. some parts are still work in progress xtodo

minor updates.

Emacs: Find Replace in Pure Elisp, xah-find.el
now much faster

3 new functions.

Emacs: xah-dired.el
buy it.

update or new

Emacs: Xah HTML Mode
new video

how to get dired to display file size with seperators e.g. 123,456,789.

xtodo
;; 2022-03-30 original, in lisp/ls-lisp.el
(defun ls-lisp-format-file-size (file-size human-readable)
  (if (not human-readable)
      (format (if (floatp file-size)
		  ls-lisp-filesize-f-fmt
		ls-lisp-filesize-d-fmt)
	      file-size)
    (format " %6s" (file-size-human-readable file-size))))

;; (defun ls-lisp-format-file-size (FileSize HumanReadable)
;;   (if HumanReadable
;;       (format " %6s" (file-size-human-readable FileSize))
;;     (format (if (floatp FileSize)
;;                 ls-lisp-filesize-f-fmt
;;               ls-lisp-filesize-d-fmt)
;;             FileSize)))


;; 2022-02-22 from Jacob L
;; (defun ls-lisp-format-file-size (FileSize HumanReadable)
;;   (if HumanReadable
;;       (format " %6s" (file-size-human-readable FileSize))
;;     (concat
;;      " "
;;      (let*
;;          ((xInput (format (if (floatp FileSize)
;;                               ls-lisp-filesize-f-fmt
;;                             ls-lisp-filesize-d-fmt)
;;                           FileSize))
;;           (xNumber (substring xInput 1))
;;           (xDigits (length xNumber))
;;           (xSepRequired (/ xDigits 3)))
;;        (dotimes (i xSepRequired xNumber)
;;          (let ((xSepPos (- xDigits (* (+ 1 i) 3))))
;;            (setq
;;             xNumber
;;             (concat (substring xNumber 0 xSepPos)
;;                     (if (string-equal " " (substring xNumber (- xSepPos 1) xSepPos))
;;                         " "
;;                       "_")
;;                     (substring xNumber xSepPos)))))))))

(defun jacob-format-filesize-with-seperator (input seperator)
  (letrec ((digits (split-string input "" t))
           (go (lambda (l c nl)
                 (if (null l)
                     nl
                   (funcall
                    go (cdr l) (+ c 1)
                    (cons (car l)
                          (cons (if (and (= (% c 3) 0)
                                         (not (null nl)))
                                    (if (string-equal " " (car l))
                                        " "
                                      seperator))
                                nl)))))))
    (mapconcat 'identity
               (funcall go (reverse digits) 0 nil)
               "")))

(defun ls-lisp-format-file-size (file-size human-readable)
  (if (not human-readable)
      (format " %s"
              (jacob-format-filesize-with-seperator
               (format (if (floatp file-size)
                           ls-lisp-filesize-f-fmt
                         ls-lisp-filesize-d-fmt)
                       file-size)
               ","))
    (format " %6s" (file-size-human-readable file-size))))

;; ssss---------------------------------------------------

(defun xah-format-int (Int)
  "add _ every 3 digits.
version 2022-03-30"
  (interactive)
  (let* ((xDigits (mapcar
                   'identity
                   (number-to-string Int)))
         (xLen (length xDigits))
         (xResultList nil)
         (xTimes (/ xLen 3))
         (xStart (mod xLen 3))
         (xEnd (+ xStart xLen)))
    (while (<= xStart xEnd)
      (if (= (mod xStart 3) 0)
          (push 95 xResultList)
        (progn
          (push (pop xDigits) xResultList)
          (setq xStart (1+ xStart)))))
    (mapconcat 'char-to-string xResultList ""))
  ;;
  )

(mapconcat 'number-to-string '(3 4 5) "_")

(xah-format-int 123)

emacs bug 1111, fixed after 13 years

emacs bug 1111 2022-02-22
emacs bug 1111 2022-02-22

emacs_bug_1111_describe_keys_key_notation.txt

misc updates

Major rework on emacs lisp doc popup. Clear cache and reload to check. Shift+Ctrl+r in chrome. ⌥ option+⌘ command+e in safari.

major rewrite:

minor updates:

Emacs Lisp: Association List
more update.

Xah Talk Show 2022-01-22 emacs lisp coding narrow-to-region, sort-lines, hilight-unicode, emacs vs xemacs

Emacs: Convert File Line Ending
more efficient code

updates

Emacs Lisp: Get Text Block
improved code.

xah talk show 2022-01-20 emacs lisp coding plus tutorial, xah-add-space-after-comma

Emacs: Xah Fly Keys Customization Major update. Still working on it.

xah packages. Added lots features. Minor and major updates. Buy them.

Download Emacs for Windows/Mac
added download emacs for Android. thanks to Infu.

Emacs: Xah Fly Keys . Added neo2 layout to the svg diagram. Thanks to p1umps.

Xah Emacs Blog Archive

ErgoEmacs mascot-s276x226
Buy Xah Emacs Tutorial