Xah Emacs Blog

Xah Emacs Blog Archive

for keyboard fans, goto Xah keyboard Blog

Emacs: Define Key Sequence
minor update. thanks to ctietze

Why Emacs Keys are Painful

Elisp: Doc String Markup

Emacs: Show Line Numbers updated.

Xah Talk Show 2020-12-02 emacs Sentence Lines, my RSI, Microsoft Sculpt Keyboard, Function Keys

Elisp: Reformat to Sentence Lines

Emacs: Upcase Sentences
Code update. Now in html, if space follows p tag, still works.

updated. Best Keyboards for Emacs

I got a Microsoft Sculpt Ergonomic Keyboard. Because i need a wireless. Not bad. But the key feel is not great for long typing session. I think i gonna need Epomaker Niz Plum . Never try to save on keyboard, you end up spending more.

been typing too much again.

xah rsi 20201117-s250
Xah Lee Emacs Pinky 2020

EmacsConf 2020 morrow

EmacsConf 2020 https://emacsconf.org/2020/ Nov 28, 29 9am-5pm Toronto/EST time; equivalently, 6am-2pm PST, 2pm-10pm UTC, 3pm-11pm Zurich/CET

thanks to sacha https://twitter.com/sachac/status/1332704763742449668

emacs lisp add period to line end

Written on the spot. This is useful because when in online chat, often you don't type the ending period. But when you copy and paste to a blog and reformat it to HTML, you want the ending period.

(defun xah-add-period-to-line-end ()
  "Add a period to each end of line that does not have one.
Work on current paragraph if there is no selection.
Version 2020-11-25"
  (let ($p1 $p2)
    (if (use-region-p)
        (setq $p1 (region-beginning) $p2 (region-end))
        (if (re-search-backward "\n[ \t]*\n+" nil "move")
            (progn (re-search-forward "\n[ \t]*\n+")
                   (setq $p1 (point)))
          (setq $p1 (point)))
        (re-search-forward "\n[ \t]*\n" nil "move")
        (setq $p2 (point))))
      (narrow-to-region $p1 $p2)
      (goto-char (point-min))
      (while (search-forward "\n" nil "move" )
        (backward-char )
        (if (eq (char-before ) ?\. )
          (insert "."))
        (forward-char )))))

Author of Intro to Emacs Lisp Robert J Chassell Died
added a book photo

new version is made. buy it. Buy Xah Emacs Tutorial

minor format updates.

Emacs: Open File in External App
fixed xah-open-in-terminal on macOS now won't close terminal if emacs quit.

Emacs: Open File in External App
fixed xah-show-in-desktop on Mac. So when in dired and cursor is not on a file, still works.

emacs vs vscode memory 2020-11-18
emacs vs vscode memory 2020-11-18

Xah Fly Keys Testimonial
new love


Emacs: Repeat Last Command
added a section about repeat command.

These commands are very useful. I use it daily now. repeat-complex-command repeat

See also:

installed emacs 27.1 on Windows 10

emacs 27.1 win10 2020-11-13 5y6tZ
emacs 27.1 win10 2020-11-13

it fixed the problem of emacs being slug slow when you have chinese or unicode math symbols in buffer. Sometimes each cursor movement takes half a second.

this is because emacs 27 uses HarfBuzz text engine.

Download Emacs for Windows, Mac, Linux

Elisp: Chinese Char To Reference Link
updated code.

Emacs: Change Brackets/Quotes
minor code update. better names in prompt.

MacBook broken option key 2020-10-30 dmZdd
MacBook broken option key 2020-10-30 https://twitter.com/davidcapello/status/1083430018171179008

Xah Lee Emacs Pinky 2020

This Emacs Pinky, pained me from 2018 to 2020. but now, it's mostly cured! Once you found the source of RSI, then things are good.

Emacs: Compile TypeScript File
renamed xah-ts-compile-file to xah-typescript-compile-file

Emacs: Run Current File
code update. now JavaScript and TypeScript code runs in deno (instead of node.js). Requires deno.

Emacs: Open File Path Under Cursor
code update. now can open html file with #fractionPart

updated. emacs 27.1 change. focus-out-hook to after-focus-change-function

Emacs: Byte Compile Elisp Files

once in a while, byte compile your init files or elisp code, to discover emacs changes and other warnings.

Fixed yesterday's Chinese font update. Emacs: Font Setup
See also: Chinese Font

Emacs: Xah Emacs Lisp Mode code update. Added after-focus-change-function

minor updates.

am becoming a god at 4chan

4chan xahlee 2020-10-03 vDYsk
4chan xahlee 2020-10-03

Xah Talk Show 2020-10-03 Dumang Dk6 Keyboard, Idiocy of Typography, emacs, python MapThread

new version of my Emacs Tutorial is out. Buy it now! Buy Xah Emacs Tutorial Update sent to previous buyers.

major updates.

Emacs: Xah JavaScript Mode now support TypeScript. Still lots to work on. donate $$$ me.

Xah Talk Show 2020-09-23 Emacs Lisp Format JavaScript, the Idiocy of Formatting Style Guide

receiving bug report response after 12 years. Nice.

gnu emacs bug 1355 email 2020-09-20 q6mTV
gnu emacs bug 1355 email 2020-09-20 https://debbugs.gnu.org/cgi/bugreport.cgi?bug=1355

Not the first time it happened.

By the way, Lars Ingebrigtsen is a nice guy. He wrote gnus and Emacs: Eww Web Browser

See also: Emacs Mode Line Problem

xah fly keys lisp string vs symbol 2020-09-19 rth45
xah fly keys lisp string vs symbol 2020-09-19

Emacs Lisp: Symbol vs String

QWERTY Dvorak Layout Conversion Table

now the key layout diagram supports workman

todo, figure out emacs desktop save, save window but not font etc stuff. clean up emacs config for desktop mode

todo sent out new version of emacs

xah talk show 2020-09-15 emacs lisp live coding + tutorial. insert-br-tag

xah talk show 2020-09-13 emacs lisp xah-remove-console-log, live coding + tutorial

Emacs: Reformat Lines for Source Code
xah-reformat-lines now always make long line first. so, can be used in key macro.

code update

xah-run-current-file now use deno instead node for js. Emacs: Run Current File

Changed (region-active-p) to (use-region-p) for the following commands:

Elisp: xah-fix-datetime
on its own page and code update. Was at Elisp: Parse Date Time


Xah Talk Show 2020-09-07 Emacs Lisp, Insert/Parse Date Time

Testimonial on Xah Emacs Tutorial

screenshot 2020-09-06 75m5D
magit gave you this when you call repeat-complex-command

Xah Talk Show 2020-09-05, emacs lisp coding, write command to display html hr tag as line

Xah Talk Show 2020-09-04 Emacs Lisp. File Path to Link, Image Link, Get Title, Image Dimension

How to Avoid Emacs Pinky
minor updates.

Use Proportional Font for Code

large proportional font for code 2020-08-31 MxXgx
now experimenting with coding with large proportional font. So far i like it. (The screenshot page is Best Monitor, Xah Pick)

Emacs: Proportional Font


Elisp: Replace HTML Entities
again, major code update

Xah Talk Show 2020-08-30 emacs lisp, html named entities to unicode chars, thing at point

todo, review, work in progress Emacs: Set Minibuffer Font Size

XahTV 2020-08-29 emacs lisp, write xah-html-escape-char-to-entity that highlights changed places

Best Keyboards for Emacs

todo Emacs: Version Control

todo emacs has window-toggle-side-windows. it can be used to toggle the side pane of treemacs.

Thanks to Rick Naam for this tip.

XahTV 2020-08-26 lisp keyboards, arrow key history, emacs dash problem, open source problem

Emacs, Why Not Use Dash

xah talk show 2020-08-25 emacs, reaction on try out speedbar and treemacs

todo Emacs: Restore Opened Files, Windows Config

  (desktop-save-mode 1)
  (setq desktop-restore-frames nil)
  (setq desktop-auto-save-timeout 300)
  (setq desktop-globals-to-save nil)
(defcustom desktop-globals-to-save
  "List of global variables saved by `desktop-save'.
An element may be variable name (a symbol) or a cons cell of the form
\(VAR . MAX-SIZE), which means to truncate VAR's value to at most
MAX-SIZE elements (if the value is a list) before saving the value.
Feature: Saving `kill-ring' implies saving `kill-ring-yank-pointer'."
  :type '(repeat (restricted-sexp :match-alternatives (symbolp consp)))
  :group 'desktop)

(defcustom desktop-locals-to-save
  '(desktop-locals-to-save  ; Itself!  Think it over.
  "List of local variables to save for each buffer.
The variables are saved only when they really are local.  Conventional minor
modes are restored automatically; they should not be listed here."
  :type '(repeat symbol)
  :group 'desktop)

List of Emacs Hooks

Xah Fly Keys Testimonial more

Xah Talk Show 2020-08-21 emacs lisp, write command to highlight text

next online meetup, emacs sf

Thursday, September 3, 2020. 1PM, San Francisco time https://www.meetup.com/Emacs-SF/events/272722964

had a great meetup yesterday, saw Jeff, ag, John Wiegley, Sean, and several ohers. learned a few thing.

Xah Talk Show 2020-08-20 Emacs Lisp. Write Command to Clean Up YouTube Description


emacs 27 george 2020-08-20 W5h4Q
emacs 27 george 2020-08-20 W5h4Q
emacs 27 george 2020-08-21 3bVwW
emacs 27 george 2020-08-21 3bVwW
emacs 27 george 2020-08-21 XgrG8
emacs 27 george 2020-08-21 XgrG8

infamous KickbanXahLeeFromEmacsChannel.htm
cleaned up the HTML.

magit buffer name trounces gnu emacs convention

magit buffer name 2020-08-19 5NjY8
magit buffer name 2020-08-19

why is magit buffer name not starting with asterisk? that's against emacs convension?


magit Jonas Bernoulli 2020-08-19 VxczY
magit Jonas Bernoulli 2020-08-19 [ https://twitter.com/magit_emacs/status/1296050436286357506 ]

todo, review

Emacs: Problems of the Scratch Buffer

make-empty-file . be careful, if you call it and just hit enter for current dir, it wipes out the current file.

MELPA URL http://melpa.milkbox.net/packages/ dead

updated in

Xah Talk Show 2020-08-18 Emacs, Manage Project with Projectile

Xah Talk Show 2020-08-17 Emacs Lisp Coding, Display Formfeed as Line

minor updates and repost

Emacs: View Image File

Emacs: Mouse Config


xah talk show 2020-08-15, emacs/elisp tutorial, modify youtube linkify accept timestamp

online emacs meetup, hosted by our great Jeff T

Thursday, August 20, 2020 4:00 PM to 6:00 PM San Francisco time


Go there and sign up and Reserve. 20 people is the limit. Also mark your calendar.


todo, review

todo, work in progress Emacs 27.1 Features (released 2020-08)

xah talk show 2020-08-12, emacs 27 features

emacs tabbar screenshot 2013-04-20
emacs tabbar screenshot 2013-04-20
emacs tabbar mode
emacs tabbar mode

Xah Fly Keys Testimonial more

Xah Talk Show 2020-08-10, emacs, braille, python vs ruby vs perl vs emacs lisp

Xah Talk Show 2020-08-07, emacs lisp youtube-linkify, why shell in emacs, sigil war

Xah Talk Show 2020-08-04, emacs lisp coding, open buffer or link in chrome

GNU Emacs Logo
emacs logo on trackball

The Sigils WAR, Language Design and Coding Convention

emacs term nano xah fly keys 2020-07-25 JmtNp
emacs running term running nano with xah fly keys 2020-07-25
thanks to dxlr8r

Linus: Respect is Earned Not Given

more Xah Fly Keys Testimonial

more Testimonial on Xah Emacs Tutorial

Xah Talk Show 2020-07-18 gergo keyboard review and keyboard geeking

Emacs: HTML, Make Citation Link
code update. Now link open in new tab.

Elisp: URL to HTML Link
code update. Now link open in new tab.

Xah Talk Show 2020-07-15, emacs lisp command xah-html-remove-list

xah fly keys MELPA file not found fixed

old version of xah fly keys before the key engine change on 2020-04-27 is now linked from xah fly keys home page at Emacs: Xah Fly Keys

it's no longer on github, cuz it's causing file not found install problems.

thanks to @sarthak

new photo

LISP Logo new photos

Testimonial on Xah Emacs Tutorial

you can buy lisp logo stickers. see bottom, refresh: LISP Logo

Emacs: Xah Fly Keys
Fixed Space 3 from delete-other-windows to delete-window. Note, 3 is delete-other-windows.

the lisp logo stickers are gone.

send me your address, i'll mail it to you. I have about 4 of them. My request: you send back a photo of your laptop or device with the sticker on. For usa resident, i sent free. For outside of usa, donation of $5 paypal would be good. paypal to xah@xahlee.org First come first serve. I'll mail out in about a week.

Emacs: Toggle Letter Case
code update. Now also do non-Latin, such as Greek γ to Γ

Emacs: Regex Tutorial
minor update

Emacs: Quote Lines
code update

Emacs: Unicode Tutorial

Elisp: Chinese Char To Reference Link
code update

XahTV 2020-06-16 emacs lisp and html coding. etymology and mythology

emacs eww xahlee info 2020-06-15 dm976
emacs eww xahlee info 2020-06-15 dm976

Emacs: Eww Web Browser

Elisp: Save narrow-to-region


xah emacs lisp live coding 2020-06-10. join lines in a text block

Elisp: Get Text Block

Bozhidar Batsov RuboCop Incident

Elisp: Call Shell Command
added how to call PowerShell.

Elisp: Insert Random UUID
major rewrite and code update.

Xah Fly Keys Testimonial
new page

what keyboard did emacs use in 1970s when emacs was TECO? Emacs Meta Key History

new version of emacs tutorial is out. Buy it! Not gonna send update to previous buyers, because last one is just a month ago.

Xah Lee Emacs Pinky 2020

Emacs: Jump to Previous Position
Major update. by the way, a better way is to split buffer, do stuff, then move cursor back to the other pane, then unsplit.

Emacs: Init File Tutorial
updated basic init file. put this in your emacs init, and life will be good.

Emacs: Font Setup
added howto about setting up a font for Chinese characters and emoji.

reader macro and sigil

lisp reader macro 2020-05-27 xcq7p
lisp reader macro 2020-05-27

&option is just the syntax for rest parameters.

(:key1 val1 :key2 val2 ...) are syntax for key value pairs.

@ and $ are just part of name that i use. syntax coloring of them is due to these starting symbol, in Emacs: Xah Emacs Lisp Mode

The technical name for special symbol like ampersan & in &option [see Elisp: Function Optional Parameters] and colon : in (make-hash-table :test 'equal) [see Elisp: Hash Table], are called reader macro characters. Emacs lisp manual does not have a page explaining lisp reader macro. Elisp does not support user defined reader macro, but has a page about what reader do, on “Read and Print” (info "(elisp) Read and Print") Clojure does not support user defined reader macro neither, but clojure doc does talked about it and has a ton of it, see Clojure: Magic Characters ' \ @ ^ # ` ~ .

About my use of @ and $, blood has been shed over that.

XahTV 2020-05-26 Why Tiling Window Manager Sucks

Misc Technical Essays and Non-Technical Essays on Emacs Lisp

some reorganization of index page at Emacs Misc Index

in particular, created two navigation topic groups, one is Misc Technical Essays on Emacs Lisp see bottom of Emacs Lisp: Symbol vs String and the other is Non-Technical Essays on Emacs Lisp, see bottom of Which Chapters of Elisp Manual to Read?

There is quite a lot more to do about the reorganization of misc essays i've written in past 16 years. Will do in coming days.

XahTV 2020-05-23. Which programing language is worth learning? The Future of Lisp

Why emacs lisp haven't become a general purpose language?
on its own page.

Elisp vs Perl: Validate File Links

Emacs: Xah JavaScript Mode
code minor update.

XahTV 2020-05-06 how to avoid mouse hand pain, logitech g-hub crap, paradox of optimal keymap, substance vs milen, Candace Owens

XahTV. TRON Keyboard, NEC M-System keyboard Japan Thumb-Shift Keyboard. Topre. 2020-05-08

Emacs: xah-lookup.el, Lookup the Web

Xah Emacs Blog Archive

If you have a question, put $5 at patreon and message me.
Or Buy Xah Emacs Tutorial
Or buy JavaScript in Depth

Emacs Tutorial

Emacs Init

Emacs Keys


ELisp Examples

ELisp Write Major Mode