Xah Emacs Blog Archive 2021-01
Elisp: Create Function Templates updated.
Xah emacs tutorial update has been sent out to past buyers. Merry Xmas and Happy Holidays. Best year going forward.
- Emacs: Xah Lookup Web (xah-lookup.el) ๐ฆ updated. buy it.
Emacs: Xah HTML Mode ๐ฆ
xah-html-insert-tag
now can insert unknown tag, not just html5.
Buy it.
Elisp: Association List major rewrite.
lol. generic skammy scrapting sites.

moving entire ergoemacs.org to xahlee.info
hum, now coded Wolfram Language for several months... now i think i revert a lisp opinion, now i maybe embrace lisp symbols over string. problem with lisp symbols is it pollutes the symbol table, and is hard to rid of. Elisp: Symbol vs String
the difference is: WolframLang uses symbols extensively sans reservation. It's part of the normal way of using the language, due to symbolic term rewriting nature. every math formula, e.g. (x^2 + x y^3)^4 is arbitrary symbols. in lisp, arbitrary symbols are NOT used much.
Here's my WolframLang tutorial:
Emacs: xah-replace-pairs.el ๐ฆ if you like it, buy it. Support open source coders not working for google.
betterment in xah-fly-keys
- now, C-v is paste in isearch.
- xah-open-file-at-cursor now has xah-open-file-at-cursor-pre-hook.
- the emacs default C-j is not removed. (it's tied to pressing return, ascii linefeed.)
2021-10-20 thanks to ctietze [https://christiantietze.de/]
updated. Emacs: Indentation Commands
run-hook-with-args-until-success
busied half a day writing this today. emacs lisp, making use of this special hook run-hook-with-args-until-success
. so that function can have custom behavior.

Xah Talk Show 2021-10-15 grep/sed find/replace in WolframLang elisp golang python perl PowerShell
Xah Talk Show 2021-10-12 grep/sed in emacs lisp PowerShell golang python perl
new feature added. Now can specify a dir min max depth. Emacs: Xah Find Replace (xah-find.el) ๐ฆ
added. code to walk dir with depth filter. Elisp: Walk Directory, List Files
massive rewrite on ergoemacs-mode, by mattfidler and big contributor wlandry. https://github.com/ergoemacs/ergoemacs-mode/issues/505
Famous Emacs Users added screen of Knuth.
emacs. the nav panel on the left is now organized. Xah Emacs Commands
updated:
How to Avoid Emacs Pinky minor update. Repetitive Strain Injury toys moved to Hand Exercise Toys for Repetitive Strain Injury
Emacs will crash Windows 10 if font size is set to big like 300.
Try
Alt+x text-scale-adjust
then keep pressing =

Xah Talk Show 2021-09-14 Emacs Xah HTML Mode, the Most Powerful HTML Editor
Elisp: Font Lock Mode much expanded.
old article, now on hackernews, for the nth time. https://news.ycombinator.com/item?id=28336724
created a index page of xah commands. Xah Emacs Commands
sigil war 2
The Sigils WAR, Language Design and Coding Convention (2016)
updated.
elisp save-restriction narrow-to-region scrolls buffer if message
Seems a annoying emacs lisp problem.
If you
(save-restriction (narrow-to-region p1 p2) )
, but if you print something with (message)
that's long or more than 1 line, the buffer scroll position changes.
Took 20 minute to pin down this. test code:
(defun xx (p1 p2) "DOCSTRING" (interactive "r") (save-restriction (narrow-to-region p1 p2) (message "something very long\n or two lines" )))
Added how to setup Xah Fly Keys in doom emacs at Emacs: Xah Fly Keys ๐ฆ
Emacs: Relation of Cursor Position to Begin/End of Matching Pairs in Source Code
2021-08-18 lol. found a gnu elisp code that isn't formatted correctly.

new Xah HTML Mode
- Complete rewrite. Now 4k lines. Some 80 hours work in past weeks.
- Managed to add a lot features, and reduced 400 line count.
- Changed some 20 function names.
- Complete redesign of keybinding. Most are changed.
- Now 136 functions.
draft tutorial at Emacs: Xah HTML Mode Tutorial
More feature to come, possibly more keybinding change.

code update. Emacs: Cycle Hyphen Lowline Space ๐
new screenshots and other updates.
Currently looking at how gnu emacs does fill-region
. Seems very complex. Thinking not to call it. Always call my own instead.

This is the main code. After 1 thousand lines of jumping about:

ok. replaced call of fill-region
by a simply replace of newline by space, then replace double space to single.
code updated.
xah-reformat-to-sentence-lines
at
Emacs: Reformat to Sentence Lines ๐
massive updates. work on elisp whole day.
lots of emacs live coding in past week. see Xah Talk Show ๐บ
Elisp: Syntax Table minor update.
more massive updates. Revamping my tutorial. you buy it!
site UI change. move xah commands to elisp example.
Those xah commands with a rocket emoji, on the main emacs tutorial navigation panel is move to the elisp examples navigation panel.

so that, the main emacs tutorial index Practical Emacs Tutorial is just teaching you plain gnu emacs.
and if you want the xah commands, get them at Emacs Lisp Examples
update 2021-07-19.
updated, big and small.
- Emacs: Basic Key Shortcuts
- Emacs Basics Tips
- Emacs: Copy to Register
- Emacs: Show Whitespaces
- Problems of Emacs Manual
- Emacs: Run Shell
- Emacs: Delete Trailing Whitespace
- Emacs Menu Usability Problem
- Emacs: One Thousand Default Keybinding
- Emacs Keys: Super Hyper
- Emacs: Edit Column Text, Rectangle
- Emacs: Move Cursor by camelCase, snake_case
- Emacs: File Manager, dired
Emacs Init: Mouse Wheel Config
major update.
update.
Emacs Select Word Command Problem
minor code update
Emacs: Xah Lookup Web (xah-lookup.el) ๐ฆ
code update.
updated.
- Xah Emacs Packages
- new page, moved here: Emacs: Xah AutoHotkey (AHK) Mode ๐ฆ from โฎhttp://xahlee.info/mswin/emacs_autohotkey_mode.htmlโฏ. Might update the package.
new index page Emacs Lisp Misc Technical Essays
Emacs: Move Image File ๐ minor code update.
Emacs: Add Period to Line Ends ๐ code update. Now don't add to end of html tag.
Emacs: Show Copy History (kill-ring) ๐
Fixed a bug about image in kill-ring stopping it.
Thanks to Christian Tietze (aka DivineDominion)
Emacs: Xah Fly Keys ๐ฆ update:
- added indent-rigidly key support (qwerty: Space Tab u then j for left and l for right), thanks to Christian Tietze (DivineDominion) pull request #123
- xah-open-in-external-app now works in BSD. thx CelestialNebula pull request #124
minor updates.
Massive update.
Emacs: Key Notation: Return, Tab, Escape
minor update.
emacs keybinding saga. xah fly keys. deep in keys.

major update.
Emacs: Xah Fly Keys ๐ฆ
now there is a dedicated navigation panel on the left.

by the way, important to know is this Emacs vs vim, Compute Keybinding Efficiency
Emacs: Xah Fly Keys ๐ฆ
โข added bepo layout, by brabalan.
โข added 3 more keys to neo2 layout. by sieman.
thanks guys.
New finding. Just tested running a find string program on 10330 html files. It seems, once they are run once (file content loaded to memory), emacs lisp and golang script takes about the same time. 3 seconds.
minor update
Xah Talk Show 2021-06-21 emacs lisp coding. HTML Lines/Blocks to List
Emacs: HTML, Lines to List ๐ new code.
Emacs: HTML, Delete Tags
code update
Emacs: Xah Dired Mode (xah-dired.el) ๐ฆ added โข xah-dired-open-in-msPaint โข xah-dired-open-in-krita
Xah Talk Show 2021-06-05 Emacs Workflow, PowerShell, Mouse Spin Wheel, Apple M1 Chip
Emacs: Move Image File ๐
updated code.
Went thru one of my old pages. 10 years ago. Tens of other emacs user's home page or forums, are dead. A mark of time
Elisp: Problems of thing-at-point
new problem discovered.
Xah Talk Show 2021-05-31 Emacs Workflow HTML Delete Tags, Alt Tab No Good, No emacs calc, Futurism
Xah Talk Show 2021-05-29 Curly Quotes, Unicode, Emacs, and the Crime of RMS
ergoemacs distro, 10 years ago

Emacs: Xah Fly Keys ๐ฆ new supported layouts.
simplified code.
Xah Talk Show 2021-05-17 Emacs Lisp Live Coding. Convert MM:SS to Seconds and Reverse
Emacs: Xah Fly Keys ๐ฆ
added explanation about showing all leader key sequences.

Elisp: URL to HTML Link
collected all html link related tutorial into navigation box at bottom
minor updates.
Emacs: Add Period to Line Ends ๐
fixed ! and ? at line ends.
Updated all formatting of emacs functions. Instead of using a list with arrow โ, now uses Definition List. ใsee HTML: Definition List: dl dt ddใ .

- Emacs: Edit Column Text, Rectangle
- Emacs: Split Window
- Emacs: Outline, org-mode Intro
- Emacs: Search Text in Current File
- Emacs: Install Package with ELPA/MELPA
- Emacs: Interactive Find Replace Text in Directory
- Emacs: magit-mode for git
- Emacs: List Buffers
- Emacs Keys: Define Key
- Emacs: Using Org Mode for Todo
- Emacs: Org Mode Markup Cheatsheet
- A Text Editor Feature: Extend Selection by Semantic Unit
- Emacs Init: Show Cursor Column Position
- Emacs: Copy Paste, kill-ring
- Fun with Emacs
- Emacs: Name Completion
- Emacs: Navigate Lisp Code as Tree
- Emacs: Make elisp-index-search use Current Symbol
- Emacs: Compile TypeScript File ๐
- Elisp: Write Comment Command from Scratch
- Emacs: Insert Brackets by Pair ๐
- Elisp: Regex Tutorial
- Elisp: HTML Processing: Split Annotation
- Emacs 23 (Released 2009-07)
- Emacs: Icomplete, Minibuffer Name Completion
- Emacs: Indentation Commands
- Emacs Init: Organize Init File
- vim, 3 Decades Pile of History
- Criticism of Stevey Yegge's Effective Emacs
- Language Server Protocol (LSP) Kills Emacs
- Famous Emacs Users
- Elisp: URL Percent Decode, Encode
- Elisp: Keyword Completion
- Elisp: Symbol
- Elisp: Text Processing, Transforming Page Tag
- Emacs: Setup Hundreds of Abbrevs
old articles. minor update.
Elisp: Parse Org Mode
updated format.
Elisp: Get User Input
added a read-number
Emacs: Microsoft Windows FAQ
added a video.
Updated code. Removed the target="_blank"
updated.
Emacs Init: Setup Font
added setting up font for symbols and other langs.
Xah Talk Show 2021-04-24 Lisp and Wolfram Language Syntax Isomorphism and Design
Xah Talk Show 2021-04-18 Emacs Lisp. Fuzzy Matching. Explore Ido and Helm Source Code, Part 1

Xah Talk Show 2021-04-14 emacs lisp Live Coding + Tutorial. Add Period to Line Ends
formatting updates.
Xah Talk Show 2021-04-09 emacs lisp live coding tutorial. xah-html-local-links-to-fullpath
Emacs: Bracket CAPITALIZED WORDS ๐
Command name change.
Emacs: Undo Saga
massive update.
Emacs: Xah Math Input Mode ๐ฆ
Added
dc
โ โdf
โ โ
Thanks to https://github.com/arthurgleckler
Emacs: Xah Fly Keys Customization added how to customize M-x
Emacs, Why You Should Not Use the Package Dash (2020) repost
Richard Stallman Says He's Back in FSF
Xah Talk Show 2021-03-27 Emacs Undo Drama, Emacs Lore, Lisp Warr, rms, and Who's Who in Gnu Emacs
- Emacs: Run Shell
- Emacs: eshell
- Emacs: shell vs eshell vs term
- Emacs: eshell pains
- Why Run Shell in Emacs
- Emacs: Command to Open Menu
updated.
Elisp: load, load-file, autoload
minor update
Emacs Init: Mouse Wheel Config minor update
Emacs Init: Setup Font updated.
Emacs: Xah Fly Keys ๐ฆ
xah-beginning-of-line-or-block
, xah-end-of-line-or-block
now works with visual line mode
Interview doom emacs author Henrik Lissner. He used vim for 14 years.

- https://youtu.be/LKegZI9vWUU
- About Emacs, Doom, Vim, Lisp and Games - with Henrik Lissner.
- 2021-03-16.
- Jakub Neander (Zaiste) โฎhttps://twitter.com/zaisteโฏ.
Xah Talk Show 2021-03-13 Ergonomics, Mechanical Keyboard, Artificial Intelligence, Lex Fridman
Testimonial on Xah Emacs Tutorial thanks to Daniel
xah fly keys start in command mode when emacs start as daemon
Emacs: Xah Fly Keys Customization
added code to fix the problem of: when emacs start as daemon, xah fly keys is not in command mode. thx to David Wilson (daviwil)
Elisp: Get User Input
minor update.

minor update.
Xah Fly Keys Testimonial
more addition. Thanks to xah fly keys users.
Xah Talk Show 2021-03-02. Q and A. Emacs Init for Windows. Why Interest in Math?
Testimonial on Xah Emacs Tutorial
New. Thank You Winny.
Emacs: Xah Fly Keys ๐ฆ
new command xah-reformat-to-sentence-lines
Emacs: Xah Fly Keys ๐ฆ now supports pt-nativo layout (for Portuguese). Thanks to xavierpinho. ใsee Portuguese Ergonomic Keyboard Layout: pt-Nativoใ
updated.
updated
Emacs: Open File in External App ๐ updated xah-open-in-external-app better on Windows, thanks to cutechservices https://github.com/xahlee/xah-fly-keys/issues/114
From an old friend, jcs. Better yet, the emacs lisp master Christopher Wellons gave a tip. ใ(goto-char 1) vs. (goto-char (point-min)) By jcs. At https://irreal.org/blog/?p=9478#disqus_threadใ

great explanation of Gap Buffers

i never seen a emacs lisp coder know how editors are implemented in general, and i've been looking in my 20 years of emacsing. Except Chris Wellons! high respect. he also went into why multi-cursor is not so great.
Testimonial on Xah Emacs Tutorial
new addition. Thanks.
updated code.
- Elisp: Chinese Char To Reference Link
- Elisp: Earth Coordinate to Google Map Link
elisp_make-citation.html- Elisp: URL to HTML Link + Date
for why, see

xah fly keys removed C-1 C-2, adde C-t
- added Ctrl+t for xah-new-empty-buffer. So it's compatible with browser, and general purpose key macro from programable keyboard for browser would work when in emacs too.
- removed Ctrl+1 and Ctrl+2 for xah- next/previous -user-buffer. They already have keys Ctrl+7 and Ctrl+8. Those 1 and 2 were added cuz i was swapping the number keys. see Efficient Layout for Numbers
Emacs: Xah Fly Keys ๐ฆ now supports German ergo layouts: neo2, koy, adnw. Thanks to VitruvianVice.

Elisp: Update HTML Title ๐ updated
new page.
Daniel Weinreb on Emacs Keybinding
extracted from Lisp Programer Daniel Weinreb Died (1959 to 2012)
also changed all pages referencing to that:
Emacs Keys: Key Sequence
minor update
new. xah-dired-open-in-irfanview
in
Emacs: Xah Dired Mode (xah-dired.el) ๐ฆ

finally finished updating it, after 7 years not using Microsoft Windows.
Emacs: Microsoft Windows FAQ
Problem of Calling Windows Shell in Emacs Lisp added to Emacs Misc Index
Elisp: Association List
minor update.
Explorer /select,path flaky
xah-show-in-desktop
on Windows now just show directory. no highlight item.
The Windows Explorer /select,path
command seems flaky.
- When called, it'll flash the newly opened folder window on the taskbar instead of just showing it. Requiring user to click the taskbar first. Super annoying.
- Also, if the command is called on a specific folder for the first time, it won't select. (and it open directly, not flashing on taskbar)
Elisp: Get Version, Host Name, User Name, Init Dir
minor update
12 years ago, my emacs tutorial was free
12 years ago, my emacs tutorial was free, and under creative commons license. And i was using elisp as my all-weather scripting lang. I hereby make a record of it, and delete that file.

; 2008-06-12 ; make my website emacs tutorial into a zip for download ; primarily, this script will make a zip file out of a directory and place the zip on a dest dir. ; however, there are few little things that needs to be done when archiving a dir for distribution: ; โข remove temp files and dir that isn't supposed to be pulic. Temp are those starting with โxxโ ; โข remove emacs backup files, osx's โ.DS_Storeโ ; โข create a parent dir and add css files and icon files ; โข for each file, remove the javascript lines that are Google's web stat bug ; โข for each file, fix no longer correct relative links to โhttp://xahlee.org/...โ. ;;;; user parameters ; root dir to work with (setq webroot "/Users/xah/web/") ; must end in slash ; list of source dirs relative to webroot (setq sourceDirsList (list "p/time_machine")) ; destination dir path, relative to webroot (setq destDirRelativePath "diklo") ; dest zip archive name (without the โ.zipโ suffix) (setq zipCoreName "time_machine") ; whether to use gzip or zip. (setq use-gzip-p nil) ;;;; (setq destRoot (concat webroot destDirRelativePath "/")) (setq destDir (concat destRoot zipCoreName "/")) ;;;; copy to destination (mapcar (lambda (x) (let (fromDir toDir) (setq fromDir (concat webroot x)) (setq toDir (xah-drop-last-slash (concat webroot destDirRelativePath "/" zipCoreName "/" x)) ) (make-directory toDir t) (shell-command (concat "cp -R " fromDir " " toDir)) ) ) sourceDirsList) ; copy the style sheets over, and icons dir (shell-command (concat "cp /Users/xah/web/lang.css " destDir)) (shell-command (concat "cp /Users/xah/web/lbasic.css " destDir)) (shell-command (concat "cp /Users/xah/web/lit.css " destDir)) (shell-command (concat "cp -R /Users/xah/web/ics " destDir)) ; remove emacs backup files, temp files, mac os x files, etc. (shell-command (concat "find " destDir " -name \"*~\" -exec rm {} \\;")) (shell-command (concat "find " destDir " -name \"#*#\" -exec rm {} \\;")) (shell-command (concat "find " destDir " -type f -name \"xx*\" -exec rm {} \\;")) (shell-command (concat "find " destDir " -type f -name \"\\.DS_Store\" -exec rm {} \\;")) (shell-command (concat "find " destDir " -type f -empty -exec rm {} \\;")) (shell-command (concat "find " destDir " -type d -empty -exec rmdir {} \\;")) (shell-command (concat "find " destDir " -type d -name \"xx*\" -exec rm -R {} \\;")) ;; change local links to โhttp://โ links. Delete the google javascript snippet, and other small fixes. (setq make-backup-files nil) (require 'find-lisp) (mapc (lambda (x) (mapc (lambda (fPath) (clean-file fPath (concat webroot (substring fPath (length destDir))))) (find-lisp-find-files (concat destDir "/" x) "\\.html$")) ) sourceDirsList ) ;; zip the dir (setq default-directory (concat webroot destDirRelativePath "/")) (when (equal 0 (if use-gzip-p (shell-command (concat "tar cfz " zipCoreName ".tar.gz " zipCoreName)) (shell-command (concat "zip -r " zipCoreName ".zip " zipCoreName)) )) (shell-command (concat "rm -R " destDir)) ) ;;---------------------------- ; read me text (setq readMeText " This is โXah'S Emacs Tutorialโ by Xah Lee. -------------------------------------------------- The โemacsโ dir is emacs and elisp tutorial. The โelispโ dir is elisp manual. -------------------------------------------------- The tutorial is updated few times a year. The download location is: http://xahlee.org/diklo/xah_emacs_tutorial.zip -------------------------------------------------- PERMISSION TO COPY โXah'S Emacs Tutorialโ is licensed under โCreative Commons Attribution-Noncommercial-No Derivative Works 3.0 United States License.โ available at http://creativecommons.org/licenses/by-nc-nd/3.0/us/ The elisp manual is licensed under โGNU Free Documentation Licenseโ, available at http://www.gnu.org/copyleft/fdl.html ") ;; create the read me file. (find-file (concat destDir "read_me.txt")) (insert readMeText) (save-buffer) (kill-this-buffer)
now on Microsoft Windows, emacs file encoding issues comes up.
Emacs: File Encoding
new version of emacs tutorial out. produced in sparkling PowerShell and golang on Windows! (instead of elisp and python on Mac.) Pick up emacs lisp in 3 hours! Buy it at [ Buy Xah Emacs Tutorial]
xah-run-current-file
now you can
customize extensions.
Emacs: Run Current File ๐
Also in
Emacs: Xah Fly Keys ๐ฆ
emacs calling windows shell problem

Emacs: Move Image File ๐
more code update. now support ShareX screenshot directory.
Emacs: Open File in External App ๐ updated
better many commands that call shell on Microsoft Windows:
โข xah-open-in-external-app
โข xah-show-in-desktop
โข xah-open-in-terminal
โข xah-open-in-vscode
โข xah-show-in-desktop
on its own page. and updated Emacs Fun Index
Emacs: Novel Reading Mode ๐
code update. increased space between lines.
Xah Emacs Packages
updated
Emacs: Move Image File ๐
updated
xah fly keys, setup major mode keys
those asking about how to setup key in magit, here's a good solution.
Added to:
Emacs: Xah Fly Keys Customization
xah-dired.el
Lots update to emacs lisp commands that call shell. Fixed a few that don't work in Microsoft Windows. If you find a problem, tell me in xah discord.
- new
xah-dired-optimize-png
- updated
xah-dired-remove-all-metadata
- change name
xah-image-autocrop
toxah-dired-image-autocrop
and code fix - change name
xah-image-remove-transparency
toxah-dired-image-remove-transparency
and many more changes.
these commands are now in a package, see Emacs: Xah Dired Mode (xah-dired.el) ๐ฆ
code update Emacs: Move Image File ๐
changed text-scale-increase
to
Ctrl+= , was Ctrl++ . modern app use Ctrl+= , instead of the Ctrl+Shift+= (the more logical control with plus, requiring to press shift)
Emacs: HTML Image Path to Img Tag code update
added
โข xah-html-convert-to-jpg
โข xah-html-resize-img
to
Emacs: Xah HTML Mode ๐ฆ,
and major version release. Many key changes.
xah-move-image-file
code change. now works better on Microsoft Windows when calling
optipng
and
exiftool
minor updates.
RSI stories of Ben Wing, The architect of xemacs
peculiar stories of Ben Wing.
- Stories of characters http://web.archive.org/web/20070715145810/http://www.666.com/stories/
- http://web.archive.org/web/20090813060259/http://www.666.com/ben/mole.html
- http://web.archive.org/web/20041019094002/http://666.com/ben/chronic-pain/index.htm
- http://web.archive.org/web/20041022234330/http://666.com/ben/chronic-pain/account-at-dimension-x.html
Elisp: Create Function Templates
updated formatting.
minor updates.
Emacs: Xah HTML Mode ๐ฆ
added xah-html-remove-tag-pair
ใCtrl+c uใ
Xah Talk Show 2021-01-03 elisp coding, why golang is easier to learn than python
Emacs: Xah Fly Keys ๐ฆ
added toggle-truncate-lines
ใSpace n yใ (dvorak notation)
qwerty is ใSpace l tใ.
This is a useful command, when you want to see the line structure. I used to just toggle full screen for it. But this is a better solution.