Xah Emacs Blog Archive 2018-05

Emacs: Display Key and Command in Real Time

my video review of Kinesis Advantage2

Best Keyboards for Emacs

or comment on reddit https://www.reddit.com/r/MechanicalKeyboards/comments/8n56bx/dear_millennials_i_am_your_father/

video tutorial on eshell

#emacs i learned many things about eshell, from video

https://www.youtube.com/watch?v=RhYNu6i_uY4 by @howardabrams

video on org mode

many asked about org mode video. I don't use it much.

here's a great video tutorial of org mode https://www.youtube.com/watch?v=fgizHHd7nOo by @johnkitchin

professor John Kitchin is an expert of org mode, and elisp too. you can see many of his videos, especially about org mode, at https://www.youtube.com/channel/UCQp2VLAOlvq142YN3JO3y8w

xah-fly-keys colemak layout back

#emacs apparently in my last commit for xah fly keys adding the colemak mod dh layout, by mistake i removed the colemak layout. (or maybe the previous pull request did). now fixed. Thanks to jeredjennings https://github.com/xahlee/xah-fly-keys/commit/3f6d9e7f83b1ecc247fe4cdb045517bf6b491622

emacs pinky pain

hackernews https://news.ycombinator.com/item?id=17132938

[Stopping the RSI pain that almost destroyed my programming career By Itamar Turner-Trauring. At https://codewithoutrules.com/2016/11/18/rsi-solution/ ]

Every few months, you see horror stories of emacs pinky. Hand pain, seeing doctors, tried everything, etc. This been going on for 20 years, ever since internet allows average people to talk.

next time you see emacs fanatics telling others to stick to emacs default keys, tell them to stop.

I've written a thousand times. Here's again. Repetitive Strain Injury is illusive. Each person's case and cause is different, and usually very hard to pinpoint exactly what's the cause other than using keyboard too much.

but, concretely, 2 most important things are,

other things, such as take breaks, exercise, standing desk, watch your posture, reduce stress, etc are all important. But as i said, it depends on each person.

the keyboard and emacs keybinding, are 2 most concrete, universal, things you can do to avoid Repetitive Strain Injury.

Without more detail, it's impossible to say which is the more important, good ergo keyboard or good keybinding set. For example, exactly which keyboard are you currently using, do you touch type, the amount of typing you actually do (average programer? prolific novelist?), your age, fitness level, current Repetitive Strain Injury status, etc.

… and there are young things, who are reading this with a smug face, because they think it'll never happen to them. Well, I am competitive athlete for most of my life, doing extreme sports stuff (walking on the tire of a unicycle, on college swimming team, free style roller blades and holding onto cars). I find it laughable i'd get Repetitive Strain Injury or getting old. You might be one of those lucky who can swim across ocean at age 100. Or you might drop dead at 40 healthy. Nature don't do favors.

here's a new links collection on emacs pinky

Emacs Keys

Many young people today are not aware there is a feud between open source and FSF Free Software. Here's latest video of Stallman

Richard Stallman talks about Microsoft Azure Sphere OS

made a video of me typing on the kinesis keyboard.

watch at Kinesis Advantage2 Keyboard Review

UI design, pie menu https://www.reddit.com/r/emacs/comments/8kkite/history_pie_menus_a_30_year_retrospective_don/dz9vozi/

Emacs in Microsoft Windows FAQ

Emacs: Run Elisp Code When File Opens (Persistent Highlight)

Xah Lee's Typing Experience and RSI (Repetitive Strain Injury)

thanks amir bajan 2018 05 15 cd72a
Thanks Amir Bajan. 2018-05-15

here's the full pic

Emacs Huge Screens

Best Keyboards for Emacs (added smartyao)

Emacs: Backup Current File 🚀 (code update. made the backup file name's timestamp format from x.html~20180515T102319~ to x.html~2018-05-15_102319~ )

should math notation be used in programing languages

my post at https://www.reddit.com/r/emacs/comments/8j5fz8/question_prettifysymbols_can_someone_sell_me_on/dyztuin/

if one simply replace function names by math symbol, such as λ φ ƒ → ∑ etc, then, no, it won't work. You need the programing language be designed for it, such as APL.

i've tried this. see Programing Style: Variable Naming: English Words Considered Harmful Variable Naming: English Words Considered Harmful

also, using math notation is absolutely advantageous. For example, see Mathematica vs Lisp Syntax

but you need a markup system as part of the syntax. (think of html/xml, org.)

see the isomorphism between Mathematica syntax and lisp here Mathematica vs Lisp Syntax

also, traditional math notation is not precise, true. However, when it is part of programing language (example: APL, Wolfram Language, Fortress, etc), then it necessarily is so.

example of Fortress here, using ← ⟦ ⟧ ⟨ ⟩ ℤ ≠ etc.

Fortress computer language Guy Steele
Fortress computer language Guy Steele

[see Problems of Symbol Congestion in Computer Languages; ASCII Jam vs Unicode]

the problem of math notation, and programing language replacement, is eloquently explained in Prologue of this book Functional Geometry, 2013, Sussman, Wisdom, Farr. Sussman is the same guy who is co-author of Structure and Interpretation of Computer Programs

also, traditional math notation sucks. But there's a movement, called calculational proofs, espoused by Edsger W Dijkstra (EWD), and today necessarily embraced in math proof systems/languages. (e.g. agda, idris, coq, homotopy type theory, sequent calculus, etc.) because when math notation becomes part of programing language syntax, the problems of traditional notation has to be fixed. It needs one that has precise grammar, yet, concise, readability, and uses 2d notation if possible.

a good notation, isn't just more readable, but it captures the structure, semantics, and guide future directions of thought. This has happened many times in history of math.

whether the notation should use non-ascii symbol as better, in general the answer is resounding yes. The obstacle we have in using them in programing languages, is old tradition momentum, and current softwares. Note, vast majority of programers in USA, don't know how to type non-ascii such as λ. Most programers are not even familiar with math notations and symbols. And those who know how to input λ φ ∑ ℤ → ≥ etc, don't know how to do it efficiently (this applies to most emacs devs).

if you are interested in this topic, there is a collection of articles here: https://github.com/hypotext/notation originally, it's about math notations, now it expanded to music and others.

Should You Use Pretty Lambda λ in Code?

reddit discussion https://www.reddit.com/r/emacs/comments/8j5fz8/question_prettifysymbols_can_someone_sell_me_on/

if you don't know what pretty lambda mode is, see Emacs Init: Display Lambda as λ

ho, lots info in your post. btw, the “remembering large complicated patterns” link has a typo.

i don't like pretty symbols mode, but for different reasons.

My reason is that, it introduces complexity. Namely, it renders words such as lambda by λ, but the underlying text is still “lambda”. So, especially in programing code, this is confusing.

another solution some people like is that there's a specially designed font ligature , so that == shows up without gap in between.

the project is called fira code, here https://github.com/tonsky/FiraCode

i don't like it neither due to complexity.

I do, however, love math symbols used in programing languages. However, the language must support defining operators using unicode. Very few languages have that feature. Mathematica is one. OCaml no, and last i looked, nor haskell. (note, defining operators e.g. ⊕, not needing extra parenthesis as part of syntax or similar.)

in my emacs lisp, JavaScript, i've used math symbols for function or variable names. e.g. φ ξ, i use them as sigil. (think of sigil to syntax as types to semantics) I've done this for 5 years or so, but eventually stopped, because most people can't swallow it. Now i use $ @ as sigils in elisp. $ for $localvar and @ for function @param.

had lots controversy. my story here The Sigils WAR, Language Design and Coding Convention (2016)

using math symbol or unicode in code is getting more and more popular. Lots mainstream programing language or project uses it, especially in documentation. Maybe few more years down the road, people will accept ∑(ξwidth, ξheight).

of the reason you gave, i agree, and is compatible with using math symbols in code. It does not necessarily enhance ease of reading, but nor degrade. (i am very much into the subject matter too, example: speed reading, cognizance, notation systems, snake_case vs camelCase, monospace vs proportional font etc. i read write chinese, and have studied its input systems, simplification issue, font styles, phonetic systems, etc.)

if you haven't already, subscribe to my keyboard blog. lots goodies.

Xah keyboard Blog

Emacs: Xah Fly Keys Customization

added how to change keys of command mode.

Emacs: Xah Fly Keys

some key changes, for the better. (all dvorak notation in this writeup)

Richard Stallman wrote a story in 2002, My Lisp Experiences and the Development of GNU Emacs

someone posted it on reddit again.

it's quite nasty. As they say, winner writes history.

see History of LISP, Emacs, Symbolics (Daniel Weinreb Rebut Richard Stallman)

See also: Lisp Programer Daniel Weinreb Died (1959 to 2012)

Emacs: Xah HTML Mode

that's the package i use to write my websites.

my websites, is some 6 thousand html files, manually crafted, over 20 years. 6k files not counting literature annotations such as Arabian Nights or Shakespeare stuff [see Literature Classics] nor mirrored tech docs such as elisp manual.

this manual system, is actually more efficient, than any org mode or markdown or whatnot octogerryhide you use to create websites or blogs. With respect to keystroke count.

but in short, if you work with pure static html5, the package might be useful to you.

who is using it? am guessing nobody except me.

major fix of a commit of the package

Emacs: xah-replace-pairs.el

if you got it yesterday, please update from github.

emacs Infinite loop bug

My emacs just froze. Infinite loop. Unable to cancel quit exit. Haven't had this for few years.

seems actually reproducible. let's see what's up.

when there's a crash, usually there's 2 things to do. 1, find the problem, fix it, move on. 2 drill down on what caused the crash exactly. Usually we just do 1 and move on, cuz lots things to do, lots opened files, in mid of projects. To do 2 usually is very time consuming.

the infinite loop is caused by xah-replace-pairs-region. It is using unicode private Private Use Area A. i.e. U+F0000 is intermediate replace string. Still, no reason it'd be inf loop.

ok. The situation is this. A find replace pairs function. Pairs is eg [["str1" "rep1"] ["str2" "rep2"]...]. When doing this, you want to introduce a intermediate replace string. Else, you get feedback loop problem of replacing char sequence that didn't exist in the original string.

read more about it here Emacs: xah-replace-pairs.el

currently, the moral is, never do clever hacks. They bite when any slight change happens. And when it happens, it's hell to debug.

at this point, i changed the xah-replace-pairs-region implementation to use a random string again. And move on. too lazy to try to see if there's an actual emacs bug. It's still possible something in emacs went wrong, because trying to replace unicode char in unicode private Private Use Area A shouldn't result in infinite loop.

Emacs: Xah Math Input Mode (xah-math-input.el)

more update. Now, use short abbrev of letter as much as possible. Not ascii punctuations that emulate the look. e.g. inf for ∞, not oo

Richard Stallman, Becoming Old Despot

[ https://twitter.com/HumanProgress/status/988084268554379265 accessed: 2018-05-01]

there are lots ignorant millennials today, in USA and i think in Europe too, who think communism is great. Note that open source and FSF, is a form of communism, of software. However, 20 years ago, they wouldn't admit it.

today, rms, have even become some sort of selfish tyrant. In past 30 years, he attacks unix, linux, gnome, kde, python, X11, saying they must be GPL compatible. But now he presses MELPA force people to GPL3, from GPL2 and other that are considered free software licenses by FSF.

in many ways, rms is just old (65), ideology issues aside. He now constantly voices the most blatant idiotic opinions about emacs and programing. He haven't been coding for 20 years, after all.

it was supposed to be, whoever is the emacs maintainer has final decision on technical issues, while political issues rms has final say. But actually, in current as well past maintainer, rms dictate technical decisions simply by voicing his opinion in a strong way, or when in argument with someone. Then, others, don't dare to counter him. Of course, you can, but if you want still be good party in the emacs dev, you better not. That's how things work.

see also

[Why Utopian Communities Fail By Ewan Morrison. At https://areomagazine.com/2018/03/08/why-utopian-communities-fail/ ]

Great in depth survey on what happens to utopian societies in the past and today.

[ https://twitter.com/ErgoEmacs/status/991423567072915456 accessed: 2018-05-01]

ttt fb60d