Xah Emacs Blog Archive 2020-01

damn i need to create a comprehensive emacs abbrev for unicode emojis. That's gonna be hours of work. Need $$$

subscribe, goodies Xah keyboard Blog

Lisp Machine Keyboards

Kinesis Savant Elite2 Foot Pedal

updated.

Elisp: Command to Update RSS/Atom Webfeed

design of keybinding. Is 【Space k j】 easier to hit or 【space u】? (on qwerty)

keybinding design space k j vs space u 2020-04-24 9sdg6
keybinding design space k j vs space u 2020-04-24 9sdg6

twitter poll https://twitter.com/xah_lee/status/1253865660699959296

and join xahlee discord. fantastic people, variegated opinions.

Emacs: Xah Fly Keys
now has colemak layout diagram.

spent 6 hours working on my site.

the following, the svg has changed. Changed from inkscape file to pure svg. typically, reducing file size to 1/3, and remove the inkscape junk tags.

wrote this on the spot.

(defun xah-bracket-caps ()
  "add ‹› to sequence of CAP LETTERS, on selection or current text block.

Example:
 Change value in PLIST of PROP to VAL
becomes
 Change value in ‹PLIST› of ‹PROP› to ‹VAL›

This function is mostly used as help writing elisp doc.

Version 2020-04-19"
  (interactive)
  (let ($p $p2 (case-fold-search nil))
    (if (use-region-p)
        (setq $p1 (region-beginning) $p2 (region-end))
      (save-excursion
        (if (re-search-backward "\n[ \t]*\n" nil "move")
            (progn (re-search-forward "\n[ \t]*\n")
                   (setq $p1 (point)))
          (setq $p1 (point)))
        (if (re-search-forward "\n[ \t]*\n" nil "move")
            (progn (re-search-backward "\n[ \t]*\n")
                   (setq $p2 (point)))
          (setq $p2 (point)))))
    (save-restriction
      (narrow-to-region $p1 $p2)
      (goto-char (point-min))
      (while (re-search-forward "\\b\\([A-Z][A-Z]+[0-9]*\\)\\b" nil t)
        (replace-match (concat "‹" (match-string 1) "›") t )))))

Elisp: How to Write a Toggle Command
added to elisp example panel.

Elisp: Symbol Property List
updated

Elisp: Property List major update.

Xah Fly Keys, Major Rewrite of Key Engine

Major key engine rewrite, by Dan Langlois and Will Dey (wi11dey).

Much thanks to them, the mode is now more efficient and powerful. Now it works with magit. The minor mode can be turned on and off. More efficient when you switch between command/insert modes.

The code is updated on github. And probably on MELPA already or later today. For user, it should not have any visible changes.

The older version is still available, named xah-fly-keys_old_2020-04-18.el on github.

I'm still going thru the code. Still need to update my page about customization and how it works. I'll be working on them in the next few days.

Emacs: Xah Fly Keys

Following i start to write notes about changes. Mostly just for myself, as i update my docs.

new customizable variables:

internal change:

Saw your notes in your blog and think I figured out why the recursive-load was happening: because of the way the Customize interface works, it tries to use the setter (same as the custom-set property) to set the default value. However, the setter is xah-fly-keys-set-layout, which reloads the file to update the keybindings to the new layout. Loading the file again calls the setter again which reloads the file, etc which causes the recursive load.

I've fixed this by not making the Customize interface dependent on xah-fly-keys-set-layout and only have it reload the file if it was already loaded and the new value is different than the old one. Otherwise, the bindings will not be updated to use the new layout when people set the layout through Customize. (Also removed the extra quote I added for the Customize choices)

xah-fly-keys-set-layout just calls the same function that Customize would have, for people who don’t like the Customize interface or just want to do it lisp-only. The widget-prompt-value just asks the human-friendly names for the keyboard layouts during completion, but it will never be called for users who don’t call xah-fly-keys-set-layout interactively.

Note: doing (setq xah-fly-key-current-layout 'qwerty) before it is loaded is the same as calling xah-fly-keys-set-layout after it is loaded, and will speed up your init slightly since the file will only be loaded once.

As for the isearch: I think your solution with the isearch hooks is a good one, since isearch only tries to be careful if a transient map is started during isearch, but it replaces any maps that were there before it. This is bad behavior on the part of isearch (and I might try to make a change to upstream Emacs to convert it to set-transient-keymap too 😄), but for now it is ok to use the hooks since isearch is an exception to how modes should interact.

random articles of the day

Emacs: Set Line Spacing
updated.

New command, xah-toggle-margin-right at
Emacs: Novel Reading Mode

Xah Lee Emacs Pinky 2020

Emacs: Reformat Lines for Source Code

random tips of the day.

Kinesis/Ergodox Layout for Xah Fly Keys
redone the SVG keyboard layout diagram

Emacs: Tab/Space/Indent Setup
minor update.

Interactive Shell/REPL vs Notebook Interface

Emacs: Xah Fly Keys
redone the SVG key layout diagram

Emacs: Insert Brackets by Pair
renamed some functions by remove non-ascii , e.g.
xah-insert-double-curly-quote“” is now xah-insert-double-curly-quote

Emacs: Upcase Sentences
code update. Fix a bug that cap like this: xyz.com becomes xyz.Com

Elisp: Wikipedia URL Linkify
modified code. Now click on link opens a new window.

new version of xah emacs tutorial

generating a new version of my emacs tutorial. Thanks for those buying.

and, this time, gonna send the update to previous buyers.

if not already, Buy Xah Emacs Tutorial

new layout for kinesis for xah-fly-keys.
Kinesis/Ergodox Layout for Xah Fly Keys

Emacs: Have You Read Emacs Manual?
old rant.

updated.

and Proportional Font is actually more readable, even for code (except python) and window width can fit more words. see Emacs: Proportional Font

ergoemacs keybinding on macOS

Marlon Richert ergoemacs 2020-03-18 y7g2c
Marlon Richert ergoemacs 2020-03-18 y7g2c

from Marlon Richert @MarlonRichert

To improve my keyboard ergonomics, I created a system-wide @ErgoEmacs mode for macOS: https://ke-complex-modifications.pqrs.org/?q=ergoemacs#ergoemacs_mode It uses spacebar as the trigger key (instead of Alt or ⌘), so it doesn't override existing shortcuts.

(Requires @tekezo 's Karabiner-Elements.) @xah_lee @davidcapello

ergoemacs layout 2020-03-18 yhthz
ergoemacs layout 2020-03-18

Emacs: How to Define Keys
lots update.

xah-select-text-in-quote now supports backtick used in markdown. thanks to divansantana.

Emacs: Select Line, between Quotes, Extend Selection

wrote this on the spot.

(defun xah-remove-lenticular-brackets ()
  "Remove lenticular brackets 【】 in current block or region.
Version 2020-03-02"
  (interactive)
  (let ( $p1 $p2 $clist)
    (if (use-region-p)
        (setq $p1 (region-beginning) $p2 (region-end))
      (save-excursion
        (if (re-search-backward "\n[ \t]*\n" nil "move")
            (progn (re-search-forward "\n[ \t]*\n")
                   (setq $p1 (point)))
          (setq $p1 (point)))
        (if (re-search-forward "\n[ \t]*\n" nil "move")
            (progn (re-search-backward "\n[ \t]*\n")
                   (setq $p2 (point)))
          (setq $p2 (point)))))
    (save-excursion
      (save-restriction
        (narrow-to-region $p1 $p2)
        (let ((case-fold-search nil))
          (progn
            (goto-char (point-min))
            (while (search-forward "【" nil t)
              (replace-match "" )
              (push (buffer-substring-no-properties (point) (line-end-position)) $clist)))
          (progn
            (goto-char (point-min))
            (while (search-forward "】" nil t)
              (replace-match "" ))))))
    (mapcar (lambda (x) (princ "【") (princ x) (princ "\n")) (reverse $clist))))

fixed code xah-open-in-terminal and xah-run-current-file

Emacs: Open File in External App
updated code for xah-open-in-terminal for macOS Catalina.

Emacs: Run Current File
fixed xah-run-current-file to compile and run java source code.

also updated
Emacs: Xah Fly Keys

Emacs: Ido Mode Setup new page by itself.

Emacs: Upcase Sentences updated code. Now works also for question mark and exclamation.

Testimonial on Xah Emacs Tutorial
thanks yzcj

lots update on emacs site. Edited, improved tens of articles, and navigation panel.

Buy Xah Emacs Tutorial

major site User interface update

Check out
Practical Emacs Tutorial

emacs meetup San Francisco. next Saturday

Saturday, February 29, 2020. 11:00 AM to 1:00 PM https://www.meetup.com/Emacs-SF/events/268277146/

random old article

Elisp: Convert Decimal/Hexadecimal code rewrite.

xah-fly-keys xah-delete-current-file now do nothing when in dired. (used to delete current dir. very dangerous.)

Emacs: Open File in External App

changes:

emacs xah-fly-keys update https://github.com/xahlee/xah-fly-keys/commit/a7b2a5e1407b767cc910a23e908574e50cb6023f

xah thanks sergio t ruiz 2020-02-04 v7gcc
xah thanks 2020-02-04

Table of Contents and navbox reorg

minor changes to nav box or content.

am working on reorganization of the site's table of contents. So it's more coherent and consistent. Look around, most has been changed.

Buy my tutorial, and you'll get the latest when it's done. Buy Xah Emacs Tutorial

Emacs: Select Line, between Quotes, Extend Selection
updated

Emacs Lisp How to Write Major Mode
the nav box for how to write a major mode and syntax table has been combined into 1 coherent box.

Emacs: View Info Page
minor update

Emacs Keybinding, Keyboard, Articles Index

major rework. Now, there is table of contents nav box at bottom of each of the keyboard shortcut related page. so you can read them one by one.

Elisp: Replace HTML Entities

many name changes.

also happened in Emacs: Xah HTML Mode

Emacs: HTML, Lines to Table

Name change. xah-html-make-html-table → xah-html-lines-to-table done

used to have 2 table of contents pages, one on elisp command examples, one on elisp script examples. Now, merged into one. see

Emacs Lisp Examples

Elisp: Command to Extract URL

xah-html-extract-url now do full path too when buffer is not file

Best Tool for Yak Shaving: Emacs

the idiocy of emacs magit, supporting punch cards of 1950s https://youtu.be/cGQi_7CYDQk?t=3905

Richard Stallman on Open Source

old. the birth of xah-fly-keys

Emacs: HTML, Wrap Paragraph Tags

Emacs: HTML, Lines to List

Elisp: HTML Amazon URL Linkify
updated

Remove Formfeed Character

xah-fly-keys, colemak layout, on ergodox. By vandr0iy, 2020-01-05. See Kinesis/Ergodox Layout for Xah Fly Keys

My Typing/RSI Experience
updated.

xah-fly-keys with Ultimate Hacking Keyboard
more update

Author of Intro to Emacs Lisp Robert J Chassell Died

Should Beginner Programer Learn Emacs Lisp

rms what's vscode

rms whats vscode 2020-01-04 jsn4y
rms whats vscode 2020-01-04 [source https://lists.gnu.org/archive/html/emacs-devel/2020-01/msg00127.html]

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

ELisp Examples

ELisp Write Major Mode