Xah Emacs Blog
Update Highlights
- computer science.
- advanced emacs lisp.
- very interesting. elisp function written in C vs not.
(defvar xah-elisp-symbols-c nil "Lisp function written in C") (defvar xah-elisp-symbols-not-c nil "Lisp function defined in lisp") (mapcar (lambda (x) (if (subrp (symbol-function (intern-soft x))) (progn (push x xah-elisp-symbols-c)) (progn (push x xah-elisp-symbols-not-c)))) xah-elisp-all-symbols) (length xah-elisp-all-symbols) 27324 (length xah-elisp-symbols-c) 9319 (length xah-elisp-symbols-not-c) 18005
minor update
- 2024-12-31
- Emacs: xah-elisp-util.el π¦
- improved many functions dealing with images
- 2024-12-31
- Emacs: Xah Dired Mode (xah-dired.el) π¦
- removed xah-dired-image-remove-transparency. might add back later.
- removed xah-dired-2drawing
- renamed xah-dired-2jpg to
xah-dired-to-jpg
- renamed xah-dired-2png to
xah-dired-to-png
- removed xah-dired-imagemagick-path. now just assume magick.
- removed internal xah-do-image, xah-process-image.
- now all image commands call magick by
call-process
and do not start shell. - now all image commands call imagemagick version 7 syntax by magick, no βconvertβ.
- 2024-12-26
- Emacs: Xah Math Input Mode π¦
- minor tweaks
- 2024-12-25
- Emacs: Xah Wolfram Mode π¦
xah-wolfram-eval-region
now more efficient, usecall-process
instead of starting shell. (not tested on mac or linux. please file bug report if problem)xah-wolfram-eval-buffer
new. (key tab b)- removed
xah-wolfram-run-script
,xah-wolfram-run-script-print-last
,xah-wolfram-run-script-print-all
- learn the difference between wildcard vs regex (glob pattern vs regular expression)
- Emacs: Wildcards vs Regular Expression
- 2024-12-22
- xah-python-mode.el
xah-python-format-buffer
now faster, callcall-process
instead of shell. remove support for yapf.
- 2024-12-22
- Emacs: Xah JS Mode (JavaScript) π¦
xah-js-eval-line
now faster usingcall-process-region
instead of shell.xah-js-format-buffer
now faster usingcall-process
instead of shell.- xah-js-format-file removed.
- 2024-12-22
- Emacs: Xah PowerShell Mode π¦
xah-pwsh-format-buffer
now faster usingcall-process-region
instead of shell.
- 2024-12-22
- Emacs: Xah Go Mode π¦
xah-go-format-buffer
now faster usingcall-process
instead of shell.
For coders. Press a button in emacs, and automatically format code of entire file. Never waste time doing line based indent. For JavaScript golang. And python PowerShell.
lots update.
- 2024-12-20
- Emacs: Xah Fly Keys π¦
xah-run-current-file
major rewrite. now usestart-process
and does not make a shell call. also support java file again.
- 2024-12-12
- Emacs: Xah JS Mode (JavaScript) π¦
- Rewrite
xah-js-eval-region
. Now use stdin instead of temp file. Much faster. - No longer require Emacs: xah-get-thing.el π¦
- Fixed xah-major-leader-key not bound error.
- 2024-12-12
- Emacs: Xah PowerShell Mode π¦
- Rewrite
xah-js-eval-region
. Now use stdin instead of temp file. Much faster. - Fixed xah-major-leader-key not bound error.
- key change for
xah-pwsh-eval-region
- No longer require Emacs: xah-get-thing.el π¦
- 2024-12-12
- Emacs: Xah Wolfram Mode π¦
xah-wolfram-eval-region
minor change. now temp file is in a subdir xah_emacs in operating system temp dir.
shell call with temp file vs pass to stdin
- massive coding.
- rewrote several emacs lisp commands to eval a region of code of JavaScript python perl Wolfram language.
xah-js-eval-region
xah-pwsh-eval-region
xah-python-eval-region
- normally, you create a temp file.
- and shell call e.g.
python tempdir/filename
- but that is lots problems.
- you need to create a subdirectory in the operating system temp dir, gen temp file name.
- then, you have cleanup problem. when to do it, or list dir of maybe thousand files, delete by date. etc.
- but better way, is to pass code to stdin.
- e.g.
deno run -
- now it's much faster. because you don't nee to create file and the programing language interpreter dont need to read a file. IO is very slow.
- however, the trick is to know how in emacs lisp, via
call-process-region
. - it's slightly more complex than making a shell call.
- by the way you can find on my emacs lisp tutorial.
- Elisp: Start External Process
major update.
massively revamped.
more update
environment variable complexity
- For coders. Emacs.
- Why Programing is Extremely Complex.
- Took 3 hours to debug, why is
C:/Python39/
- in my emacs
exec-path
, even when i removed it from Microsoft Windows environment variable in registry.
- turns out, because i was launching emacs via AutoHotkey, and it was still using the old registry value.
- restart windows solved the problem.
- in the process, also debugged or improved many of my init files.
- when checking a variable, use boundp instead just the symbol.
- eg
- (when (boundp 'icomplete-vertical-mode-minibuffer-map) ...)
- not:
- (when 'icomplete-vertical-mode-minibuffer-map ...)
code update.
- massively rewrote the code to get image width and height, so it doesn't need the mega bloated imagemagick.
- Elisp: Get Image Size π
- added
length=
length>
length<
take
ntake
- major update
- Elisp: Start External Process
code update
code update
major rewrite.
updates
- 2024-11-09
- Emacs: Xah Fly Keys π¦
xah-close-current-buffer
now has a option xah-create-buffer-backup
updates
misc updates.
Replace replace-regexp-in-string by string-replace
emacs lisp. in your code, replace all replace-regexp-in-string
by string-replace
(new in 2022).
if you are not doing regex.
Stop Using Lisp Cons
- Programing language, regarding lisp cons.
- This is the final say.
- The common lispers, have always been, the most idiotic bunch, in the past 30 years as far as i get to know them.
- Lisp cons, to this day, is the most idiotic concept in programing language history.
- It is lisp cons, that killed lisp. Except, clojure, which ditched cons entirely.
- Nobody the faak do linked list today.
- It is not in all other langs since y2k.
- Only the lisp fanatics, still like chew it like fine wine, thinking, how great it is or was.
- the way to fix the lisp cons, is to ban any list that is not a proper list.
- that should be done since y2k.
- but today, there is more reason to not use lisp list, even proper list, due to parallel computation.
- In your lisp code, go thru it and find all use of cons. Replace it with vector.
- And for list, check if you are using it as stack datatype. If not, replace it with vector.
- You'll have more efficient code.
- Exception is association list. Check if you are using it as ordered dictionary. If so, and length is say less than 20, stays. Else, replace it with real hashtable.
- For property list and symbol property list, they need to stay, because backward compatibility issues.
- 2024-10-09
- Emacs: Xah Fly Keys π¦
- added
xah-page-up
andxah-page-down
commands.
- 2024-10-07
- Emacs: Xah Fly Keys π¦
- major fix on many commands that works on text block. few months ago made a change so that blank lines containing space or tab is not considered blank. the result is not good. now fixed. also, renamed
xah-get-pos-of-block
toxah-fly-get-pos-block
etc. - xah-run-current-file-map, py3 changed to run python, not python3.
- fixed a bug in
xah-select-text-in-quote
.
major bug fix.
updates.
updates.
- 2024-09-27
- Emacs: Xah Fly Keys π¦
- major key reorg. removed most starting with C-x, and other change. see below.
- Removed most keys starting with C-x. Reason is when you do M-x for some rarely used command, the C-x binding shows in minibuffer in precedence over leader key sequence. This makes it harder to know the easier key.
- Removed many C- keys such as C-p for moving cursor right. They were there so that emacs default key users might use them. But those people are not likely to adopt Xah Fly Keys anyway. Beginners simply press arrow keys.
- Added some 10 plus keys for kmacro commands. These are almost never used but good to have keys for the handful advanced emacs users. Each now has a leader key sequence. The exact key is to be changed.
(setq word-wrap-by-category t)
thanks to jamesni.
- 2024-09-24
- Emacs: Xah Fly Keys π¦
- added arrow keys to
xah-previous-user-buffer
xah-next-user-buffer
xah-previous-emacs-buffer
xah-next-emacs-buffer
. you can press arrow keys to repeat. see docstring.
also thanks to emiltoacs for improvement.
- added new function
string-replace
- Elisp: String Functions
translate-region subst-char-in-string ;; this is in C subst-char-in-region
can be used for my asccify command
repost.
added a common idiom
- 2024-09-16
- Emacs: Xah Fly Keys π¦
- Major change. Removed
xah-fly-shared-map
. And xah-fly-key-map is now not declared obsolete. xah-fly-shared-map
was introduced by Will Dey (and Dan Langlois) in 2020-04-18 during the key engine rewrite usingset-transient-map
.- The idea of
xah-fly-shared-map
is that it serves as a parent of xah-fly-command-map and xah-fly-insert-map. - This allows setting control modifier combinations such as C-t also be part of Xah Fly Keys binding, thus is automatically unbound when the mode is turned off, as it should.
- I think it makes things more complicated than worth.
- 2024-09-12
- Emacs: Xah Find Replace (xah-find.el) π¦
xah-find-undo-last-replace
new.
new version out. buy it. thanks. Buy Xah Emacs Tutorial
updates
- 2024-08-29
- Emacs: Xah JS Mode (JavaScript) π¦
xah-js-eval-line
andxah-js-eval-region
now take universal-argument, to insert result in buffer.
- 2024-08-29
- Emacs: Xah PowerShell Mode π¦
- new.
xah-pwsh-eval-region
,xah-pwsh-eval-current-line
- 2024-08-29
- Emacs: Xah Wolfram Mode π¦
xah-wolfram-eval-region
andxah-wolfram-eval-current-line
can takeuniversal-argument
to insert result to buffer.
which editor by default highlight the current line? vscode, sublime, textmate, or other?
updated
updates
updates
updates
more updates.
master emacs lisp loop and iteration. major updates.
- 2024-08-13
- Emacs: Xah Wolfram Mode π¦
xah-wolfram-eval-region
now work on current text block when no text selection.
Emacs org mode security emergency
just org mode is affected, not emacs.
but there's new emacs release, emacs 29.4, that fixed the org mode problem.
updates
- 2024-07-25
- Emacs: Xah Fly Keys π¦
xah-close-current-buffer
now also record dired buffer, so canxah-open-last-closed
- 2024-07-25
- Emacs: Xah HTML Mode π¦
- new:
xah-html-insert-page-template
,xah-html-move-text-block
new. pepe anti emacs pill
- 2024-07-15
- Emacs: Xah Dired Mode (xah-dired.el) π¦
xah-dired-toggle-human-readable-size
new.- xah-dired-metadata-remover-path renamed to xah-dired-exiftool-path
- 2024-07-15
- Emacs: Xah HTML Mode π¦
xah-html-make-citation
now use TORTOISE SHELL BRACKET.xah-html--get-youtube-id
renamed toxah-get-youtube-id
.xah-normalize-youtube-url
new.- image link functions now use
xah-get-image-dimensions
instead of calling imagemagick, unless necessary.
minor updates.
updates
updates
- 2024-07-03
- Emacs: Xah Fly Keys π¦
xah-shrink-whitespaces
minor refactor. removedxah-delete-blank-lines
,xah-fly-delete-spaces
- 2024-07-05
- Emacs: Xah HTML Mode π¦
xah-html-youtube-normalize-url
now support query string.xah-html-keyboard-shortcut-markup
better, now normalize command key opt key etc.xah-html-pop-back-source-code
,xah-html-toggle-syntax-color-tags
changed cursor position requirement. experimental.xah-html-change-current-tag
changed cursor position requirement.
major updates