Xah Emacs Blog

You, put $5 in my patreon. https://www.patreon.com/xahlee

Emacs: Insert Random Number/Hex/String (minor code update.)

Emacs: Best Undo/Redo Mode (updated)

create thumbnail elisp 2018 04 19 932ba
spontaneous emacs lisp

Emacs Lisp Basics (added conversion of int/float)

For their first basic task, it took me 35 keystrokes to finish the task and to close the file (with xah-fly-keys of course 😉 ). Which is just 4 key presses more than most efficient vim solution posted on the vimgolf website. —Arkady 2018-04-17 emacs and vi: Science of Command Efficiency#comment-3859081101

thanks!

Emacs: Convert Image Files in Dired (code minor update)

emacs magit mode annoyance. By convention, generated buffer such as diff should have name starting with *. But since last year or so, magit's generated buffer no do that anymore. e.g. magit-process, magit-diff. so your buff switch code can't tell which's which.

Emacs: Insert Date Time (code update. added a new format)

emacs keyboard macro

this may seem counter-intuitive, but for many tasks, keyboard macro takes 5 minutes, but writing elisp will take 30 min.

learn it today! Emacs: Keyboard Macro

Elisp: Functions on Line (minor update)

Emacs: Delete Whitespace around Cursor (code complete rewrite)

best ergonomic keyboard for vanilla emacs users

another reddit discusssion https://www.reddit.com/r/emacs/comments/88xr18/best_ergonomic_keyboard_for_vanilla_emacs_users/

my comment:

ergodox got thumb problems. If you don't have largish hand, don't go with it. If you really want it, make sure to move whole hand instead of stretching thumb.

see this horror story Ergodox Keyboard Thumb Keys Pain

Kinesis advantage 2 is what i use.

Better than ergodox, but still, most thumb keys require reach, for Asian hand. I move whole hand to press thumb keys other than the 2 nearest ones.

Keyboardio i tried. Don't have much experience so i can't say. The pinky column is much lower than all keyboards, so requires more learning.

There are some others similar to your list i think that's worth looking into.

I can't say which is best, because it all depends on how you value cost, tented vs none, 1 piece vs 2 pieces, and firmware programable vs not, or driverless programable.

another one worth mentioning, is the cheap Microsoft Sculpt. (don't get the similar Microsoft Surface one) The Sculpt is particularly nice because it's got huge Alt keys, especially if you use emacs default keys. Just swap Ctrl and Alt.

I have a review of them here Ergonomic Keyboard Reviews

Emacs: Change Brackets/Quotes (updated code)

Emacs: URL to Link Command (major rewrite)

Am update html related pages.

Emacs: Xah Math Input Mode

(added “cp” for , function composition)

hydra and god mod

seems lots people use hydra and god mode.

i think they are 2 of the most worthless keybinding packages.

they don't do much, creates complications, and what they do is one of the least useful for keybinding efficiency.

you can easily create key sequences Emacs: Define Key Sequence

and you should do so for all frequently used commands.

comment on reddit https://www.reddit.com/r/Xah/comments/87kxcv/emacs_hydra_and_god_mod_most_worthless/

is lisp a failed language

my post on reddit https://www.reddit.com/r/emacs/comments/867trt/developer_survey_results_2018_machine_learning_on/dw7rnvc/

well, i wouldn't say failed language. Remember that airplane ticket company (ITA Software) written in Common Lisp and bought by google some decade ago? afaik, it's still in Common Lisp in 2012.

Google even have a Common Lisp style guide https://google.github.io/styleguide/lispguide.xml , written by François-René Rideau, a old acquaintance.

AutoLisp was a success. (i was introduced to AutoCAD inventor by Wolfram) in 1995. The guy John Walker is interesting. He is on twitter https://twitter.com/Fourmilab and his website has many weird interesting things.

AutoCAD and AutoLisp is hugely popular in China. I suppose due to massive pirated version in 1990s. I think it's used in every college and is the standard in any 3d.

as far as i know, a decade ago, i read in Wikipedia that AutoCAD replaced autoLISP by visual basic. What's the situation now?

also, Scheme Lisp is still used in places. Arc Lisp of Paul Graham still runs hackernews as far as i know.

and clojure has a corner in enterprise java.

[see Clojure Tutorial]

and remember John Carmack (of Doom and id software fame) created a scheme lisp language for Oculus in 2015? (any know what's up with that?)

emacs lisp is still going, albeit is now far worse than any of perl ruby JavaScript. emacs dev has lots serious problems. The language stagnated for about 20 years now. And emacs community hush about it. And the millennials dunno better, pushing for Language Server Protocol, which will drive a nail in emacs lisp coffin.

[see Emacs Lisp Sucks Donkey Ass. Please Grow Emacs, Not External Tools]

so, i wouldn't say lisp is failed language. And in 1980s, it was one of the perhaps top 3, most successful language.

also, although i don't buy the fanaticism about nested parenthesis as most lispers, but i do think it has a significant advantage, in fact i want even more pure nested parenthesis (e.g. rid of special reader syntax such as # . ; ,@). If lisp rids of these, and in addition, adds m-expr layer as in Wolfram Language, that'd be the best syntax system possible.

See also:

why isn't lisp in today's artificial intelligence scene

https://www.reddit.com/r/emacs/comments/867trt/developer_survey_results_2018_machine_learning_on/dw5to94/

lisp was the language of Artificial Intelligence. That's mostly back in the 80s.

it wasn't today because most languages do better. Starting with perl in the 1990s, where 'was said perl is a lisp. (due to, that it supports list/array dynamically. (of course, almost every language since does)). Then, we constantly hear python is a good-enough lisp (e.g. first from the AI/LISP expert Peter Novic), then it's said ruby is a lisp (which bear some truth, as its inventor Matz based ruby on perl and lisp). (am pretty sure if you search reddit emacs here you'll find articles of these sentiments that was widely read) (JavaScript, before or after ES2015, actually is more similar to lisp than python or ruby. (the designer Brendan Eiche modeled js after Scheme Lisp and Self).)

in my opinion, lisp hasn't moved on because the language stagnated due to cult. Common Lisp and Scheme. CL is stuck in 1980s standard and never moved on. Scheme confines itself to academia and obsesses with concept of elegance, tail recursion forever. (and the biggest fort of Scheme Lisp abandoned it, created Pyret. (which is scheme lisp in python syntax.))

The other major lisp of late, Clojure, began in late 2000s. But Clojure changed the nature of lisp significantly. ① It destroyed the regular nested parenthesis syntax by introducing tons of incomprehensible meta syntax. (like lisp's 「# ; . ' ` ,@」 but ~20 more), ② and it intertwine itself to JVΜ and Java the language and enterprise computing, ③ and it invented many unpopular/hard-to-understand concepts/semantics for concurrency.

It picked up users in the Java enterprise space, but seems also have lost steam for a number of years now. Especially because newer shiny functional languages are popping up every few months. In particular, kotlin is eating the pie in Java space. (one famous lisp expert and lover, Steve Yeggs, highly praises kotlin, as he has done with ruby and ocaml in the past.)

i myself do not see lisp as particular suitable to AI, except its highlevel nature (in comparison to other languages at the time). In my opinion, it was in the past, because, ① social timing is right. There was little or no alternative. ② the disassociation with machine hardware, but takes a functional programing and math oriented approach to programing, which i still think are the best aspects of lisp.

but i do think lisp's functional programing focus, and regular nested bracket, are big advantages. It could do much better even today. One success story is Mathematica (aka Wolfram Language), where it actually does Artificial Intelligence today in its own way. e.g. wolframAlpha. Wolfram Language has a syntax layer what John McCathy called “meta-expression” (m-expr, in contrast to s-expr), which the lispers of the 1990s heavily belittles. (most of the Common Lisp or Scheme lispers do not actually understand it. They think it's just infix notation. Actually, the gist is a two-way syntactic isomorphism, that the mexp and sexp can be transformed into each other syntactically, anytime (as in pressing a button in emacs) without any loss of info, and are 100% equivalent semantically. (most so-called “sugar syntaxes” in computer language, including Scheme, are not 100% semantically equivalent.))

But most lispers i've talked to, do not view lisp the way i see, instead, they are prone to machine hardware stuff aspects (reference, pointers, memory address, compiled code, etc low-level efficiency, obsesses with concepts of list being nested references, cons, anti-array, circular list, thread, object oriented lisp (CLOS), etc), as are most industrial programers are, and have never in their life invested in math oriented programing or languages. (Wolfram Language, APL, Julia, Matlab, etc.)

emacs undo/redo corruption

see Emacs: Best Undo/Redo Mode

Emacs used by 4.1% of Stackoverflow users, Why are they not using Emacs? How can we attract them?

https://www.reddit.com/r/emacs/comments/85lhie/emacs_used_by_41_of_stackoverflow_users/dvzkt5n/

it's easy to double emacs users within 1 year.

just make the 7 standard keybindings, open close save, copy cut paste undo.

this needs to be done at emacs core. Turning on cua-mode by default is a step forward, but what really need to happen is for emacs dev to change at the core.

see Why Emacs Keys are Painful

if, out of the box, any one who knows notepad can use emacs without learning anything, then emacs users will double within 1 year.

See also: Modernization of Emacs: Simple Changes Emacs Should Adopt

emacs lisp coding style??

my take. https://www.reddit.com/r/emacs/comments/853ka5/modern_emacs_lisp_development_question/dvw3waw/

am probably gonna be voted down to hell, but here's my way:

The result, should be most simple, lean, readable, maintainable, and fast, code.

the gist of the advices above is, stick to only computer science basis, avoid programer fashions, and do not hack.

if you run into a problem, such as elisp seriously lacking string function, lacking namespace, named parameter, ask emacs dev to add them. (e.g. the limbo state of (require 'subr-x) for string-trim et al.)

Emacs: Unicode Tutorial (minor update)

follow xah

follow me on my new mastodon account at https://mstdn.io/@xahlee and on reddit https://www.reddit.com/user/xah

Emacs: Set Minibuffer Font Size

Emacs: Font Setup (minor update)

emacs and vi: Science of Command Efficiency

to understand all issues about keyboarding science, start with that article.

major update to the doc of emacs xah-fly-keys

https://www.patreon.com/posts/17529030

Emacs: xah-find.el, Find Replace in Pure Elisp (package update)

to my patreons, an intro to Xah Lee, is that right?

https://www.patreon.com/posts/17455187

RMS the Emacs Tyrant

https://www.reddit.com/r/emacs/comments/82l16v/rms_on_which_improvements_to_emacs_would_be_truly/dvbxgx8/

full thread of exchange here Richard Stallman, Emacs Tyrant

typescript javascript elisp 2018 03 01 55852
galamapain, dealing with typescript, javascript, then have to deal with emacs lisp that runs my code. xah-run-current-file, xah-ts-compile-file, xah-js-mode, xah-ts-mode.

typically, what happens is, i code JavaScript, but actually TypeScript because ES2015 etc, find something not working well, i modify my emacs JavaScript mode, or my TypeScript mode, or xah-fly-keys.

this applies to coding elisp with xah-elisp-mode or clojure with xah-clojure-mode.

See also:

replace invisible unicode chars https://www.patreon.com/posts/17392376

more code update, run current file, and compile TypeScript https://www.patreon.com/posts/17344133

emacs JavaScript mode war https://www.patreon.com/posts/17343934

Emacs: Ido Mode (minor update)

Lisp Machine Keyboard, High Cool Factor, Lousy Design Factor

reddit question on lisp machine keyboard and emacs, at https://www.reddit.com/r/emacs/comments/817bp5/since_lisp_keyboards_are_looong_time_gone/

my answer:

the lisp machine keyboard has high cool factor but ergonomically it's really the worst.

[see Lisp Machine Keyboards]

any cheap mechanical keyboard would beat it in terms of ease of use, comfort, macro abilities, typing speed, etc.

if any is really interested in keyboarding efficiency, i recommend keyboardio, smartyao, Microsoft sculpt, kinesis, x-bows, kinessis gaming, or ergodox and many variants.

they feature one or more of:

If you don't touch type and don't plan to learn, and do not have typing load as heavy writer, then you can immediate rule out those split ones, since split isn't useful for non-touch typers that much.

[see Touch-Typing, a Relic of Keyboard Design?]

as for the space-cadget keyboard:

[see How Many Keyboard Shortcuts Are There]

there's a nice video view of space-cadget keyboard by a keyboard switch expert chyrosran22, see Symbolics Space-Cadet Keyboard

Emacs: Show Cursor Position

on its own pag. from Emacs: Init File Tutorial

updated.

updated.

Elisp: Interactive Form (updated)

emacs most negative comment here is holier-than-thou syndrome.

reddit discussion. Master emacs in 1 year. https://www.reddit.com/r/emacs/comments/7z6pjb/master_emacs_in_one_year/dutha0x/

my comment.

most negative comment here is holier-than-thou syndrome.

people wants to attach mythical quality to emacs.

as tooling goes, mastery of atom editor or code editor and its js language, is far more deep and rewarding, financially or how modern software system works.

if a tool kept you thinking you always don't know something, there's something wrong with the tool or the community.

in fact, vast majority of emacs users for over 10 years, only know how to use the very bare basic features, and know no emacs lisp at all. I know, in part because lots such users told me so, in email or in comment. (most, will not disclose their names in public)

and there are very old users (over 20 years emacs), who even have problems with upgrading emacs, and still stick to how emacs ways of 20 years ago, with their 20 years old habits and config.

most emacs users, they do not read online emacs blogs, or, maybe a couple of times per year. What we see on reddit or other emacs forums, are not typical emacs users.

emacs pinky wedge on control key

emacs pinky wedge 2018 02 24

added to How to Avoid Emacs Pinky

See also:

Control Key and Capslock Key Positions in Old Keyboards

Emacs: Init File Tutorial (updated)

new index page. Emacs Init Setup

Elisp: File and Directory Functions (minor update)

Elisp: Regex Tutorial (updated)

Emacs: Open File Path Under Cursor (code update. Now open f.ts if exist, instead of f.js)

Elisp: String Functions (on its own page, expanded)

Emacs: Compile Current TypeScript File

if you like my work, put $5 at https://www.patreon.com/xahlee

or, Buy Xah Emacs Tutorial

Emacs: Run Current File (more code update. TypeScript part changed)

xah-fly-keys integration

discussion on reddit https://www.reddit.com/r/emacs/comments/7yprnq/xahflykeys_integration/

post your experience there.

emacs keys how-to

emacs keys howto 2018 02 20 71222
Emacs Keybinding, Keyboard, Articles Index

Emacs: Convert Straight/Curly Quotes (code update)

Elisp: Change URL into HTML Link (updated code)

Xah Emacs Sitemap, with random page button

Emacs: Run Current File (bug fix. No more buffer not found error when eval a elisp buffer)

iOS Crash with Indian Unicode Characters

ios unicode crash 2018 02 15 55551
[see Search Unicode]

ok, i found a emacs bug! this sequence U+0915 U+094D U+0930 U+200C U+093E results in क्र‌ा the last char does not combine in emacs! now, crash your Mac!

Emacs: Xah Math Input Mode now support U+ prefix, e.g. u+3b1α

emacs grep, gnu grep, problems

my reply on a reddit question:

https://www.reddit.com/r/emacs/comments/7xljw0/of_you_emacs_users_on_macos_which_grep_version_do/dubem1l/

in 1990s to 2000s, first thing on any machine, is to install gnu version of file utils and text utils (which includes grep).

now, i don't bother. These tools, wasn't as important as in the past. e.g. python ruby golang etc, one can write trivially and do much better.

new ones keep cropping up every 5 years. as well as new shells. But i never bothered. For speed, a flash drive is much more important than spinning disk. Most time spent is loading files. (i 'grep' or do find/replace on 5 thousand files every week for past 10 years)

also, gnu text util has unicode bug, but they refuse to consider it as bug. see Linux Shell Util uniq Unicode Bug

so today, i use unix grep only when i need to search a word. If the search involves unicode, or multi-line text, or programing language code with lots slash or backslash, i either use xah-find.el i wrote that stays in pure elisp (avoiding unicode problem, multi-line problem, and toothpick syndrom escape problem), or go to a python script i wrote, for 5x faster speed. (gonna do a golang version soon)

See also:

Emacs: Run Current File (updated code. Now, there's output, switch to the output buffer.)

emacs controversy. What causes emacs slowness

https://www.reddit.com/r/emacs/comments/7wezb4/how_can_i_make_line_rendering_faster/du0a87s/

That's Xah vs Eli

MELPA No Longer Distributes Packages from Emacswiki

Buy Xah Emacs Tutorial

The best emacs + emacs lisp tutorial in existence, by far, of depth, breath, and readability. Get my book.

Buy Xah Emacs Tutorial

Patreon me $5 patreon

Or Buy Xah Emacs Tutorial

Or buy a nice keyboard: Best Keyboard for Emacs

Patreon me $5. Ask me question on patreon