Xah Emacs Blog Archive 2017-12

Emacs: Xah Fly Keys now supports programer's dvorak layout. That is, dvorak with number/symbol row swapped. Thanks to akater.

Emacs: Open File in External App 🚀

updated. Fixed a bug for xah-show-in-desktop, in MacOS, when current directory is empty.

Thanks to FSF/GNU, and 2 Kinds of Thanks

first, i like to say i'm thankful to FSF. No, i was a fanatic of rms, and has been ban'd in mailing lists (around 2002) for pro fsf/gnu/rms harsh opinions. People have called me a rms fanboy.

but, i don't like criticism of fsf/gnu/rms gets voted down for disagreement of opinion than lack of points.

as to appreciation, we, need to thank our mom. She gave birth to us. But we need to thank our dad too, else, we wouldn't exist. Then, we need to thank society, because mom and dad can't survive by themselves. And, we need to thank our firemen, for, he protects us, and soldiers. Thanks to our teachers and philosophers too, sans of which, i haven't clawed your eyeballs out yet.

there are 2 kinds of thanks. One is which they do by themselfs. The previous paragraph, are such. Your mom and dad no really need thanks from you because they'd birthed someone else anyway.

the other thanks, is person do because of you and for you sans necessity. If i give you a buck, or been kind to you, you thank me, a dear thank, because i don't have to. In this regard, the average parents, firemen, soldier, teacher, family, your church, school, company, government, don't qualify. But particular good persons, qualify. I have many people in emacs community am thankful to in this regard, too.

2017-12-23, context: https://www.reddit.com/r/emacs/comments/7la3qv/the_elisp_interpreter_inside_of_emacs/drmb7k5/

emacs history: major changes in emacs core

Emacs Version History

ELisp: load, load-file, autoload (updated)

emacs, best simple package source code to learn from?

someone asked on reddit.

my answer https://www.reddit.com/r/emacs/comments/7l98a8/best_simple_package_source_code_to_learn_from/drkrnbs/

well, i run a emacs tutorial on writing major modes. If you haven't seen already, The topics covered are:

How to Write Major Mode

Syntax Table

see Emacs Lisp How to Write Major Mode

if you read the emacs lisp manual, it recommends that the text-mode is a simple mode you can learn from.

For programing modes, i learned things from the builtin css-mode written by the previous emcas leader Stefan Monnier.

but other than that, i didn't learn writing mode much from looking at other modes. I learned mostly from reading elisp manual and writing your own, and looking at source code of arbitrary builtin functions when necessary.

emacs lisp: how to undefine a face

someone asked at https://www.reddit.com/r/emacs/comments/7l42rc/how_do_a_unbind_a_face/

my answer: https://www.reddit.com/r/emacs/comments/7l42rc/how_do_a_unbind_a_face/drjerh6/

detail at

ELisp: How to Define Face

ido-completing-read doesn't take obarray

emacs, current problem is, ido-completing-read doesn't take obarray. very annoying. so now, like, i need to rewrite ido-mode

here's the problem. ido-completing-read doesn't take an obarray. (obarry is a special array that hold all elisp symbols) And that's probably why ido doesn't do M-x.

To use ido for M-x, you need to convert obarray to a list of strings. But you don't wannna do this everytime M-x is called. length of obarray is 15k.

Thus, a cache idea is born. So that's probably why smex has cache, probably as after thought. with added feature of sorting most frequently used command. But note, cache adds complexity, cuz now you have the issue of when to regenerate cache.

the emacs completion is truly a mess. The mothership don't change due to org problems, so you have a wild bunch packages trying to improve it, for the past 20 years. Note that, icomplete is from 1993. What really should be done is fix emacs completing-read (it's in C)

hippie-expand, complete-symbol, iswitch (now defunct), icicles, ido, ivy, helm, company, auto-complete, yasnippet, all tries to implement their own completion.

elisp, What's the difference between set and setq

someone asked on reddit. My answer:

https://www.reddit.com/r/emacs/comments/7jyv0o/whats_the_difference_in_setq_and_set/draapog/

but more detailed answer is here ELisp: Symbol

Should Beginner Programer Learn Emacs Lisp

ivy mode minibuffer history corruption bug

emacs 26 force typing yes/no for deleting dir

emacs 26 dired deleting directory force user to type full “yes/no”. exceedingly annoying. apparently, it's hardcoded, bypassing yes-or-no-p alias to y-or-n-p

this is hardcoded in dired--yes-no-all-quit-help at dired.el

This is super annoying. Why's this change?

it used to be, the code calls yes-or-no-p, and user can alias it to y-or-n-p, so that typing y or n is enough.

comment at https://www.reddit.com/r/emacs/comments/7iypxo/emacs_26_force_typing_yesno_for_deleting_dir/

emacs lisp byte code internal

here's a great article.

http://nullprogram.com/blog/2014/01/04/

Chris Wellons is one of say top 5 elisp expert i know.

and i think he's about the only one, who writes emacs tech blog and writes well and in depth.

he not just know elisp in depth, but, programing and associated computer science.

i can't readily think of anyone else on emacs or emacs lisp.

most other elispers, when they have a blog or opinions, i find them idiotic.

emacs, recommended dropin replacements for standard packages

my own:

ok. that's one too many.

now, a reverse replacement.

The ones i consider actually harmful are:

* s.el f.el, dash.el, god mode, hydra.

They seem convenient, but actually don't do much, adds complexity and bloat. You can do what they do with plain emacs lisp trivially.

The ratio of power/simplicity is the key.

recommended dropin replacements for standard at reddit emacs

learn emacs source code to master computer science?

when i was younger, at one point i thought of studying emacs + elisp as a way of getting into or mastering “computer science”.

turns out, that was a very silly idea. You can master emacs source code but would learn basically 0 computer science and gain very little industrial coding skill. (as with respect to get a programing job. If you master emacs source code, but have no other coding experience, you probably won't find job. Sure you can, in the 1 job per year niche. (but, of course, for some, you might become star coder. But, for such person, he would be regardless of emacs.))

though, Matz the ruby guy, studied emacs lisp and created ruby, based on it.

[see Ruby Creator Matz: How Emacs Changed My Life]

its like this. Would you be a great writer, or get a writing job, if you, say, mastered Shakespere's play?

depends on what's your interest and goal, you probably better off to write a web app, read general programing book, computer science book, instead of looking into emacs source code.

but, if your focus is to contribute to emacs, then, yeah, and you do need to read emacs lisp manual.

as to how to approach emacs source code... i guess just dive in. e.g. say you don't like some command's behavior, or you find elisp lacking some function. You look at their source code, by describe-function, and soon you'll dig into from elisp to C. And, maybe, one thing leads to another.

from how to read and understand gnu emacs source code at reddit emacs

Hello, my name is rms, YOU belongs to me

emacs has ido-mode, but it doesn't cover M-x or C-h f. icomplete-mode does, but its UI is way inferior. and complete-symbol and hippie-expand adds to the total confusion.

each time these are brought up in emacs dev, one ball of philosophical flamewar flies, hundreds of debates and arguments, gouging each other's eyes. End result is nothing is done.

then, there's MELPA, of warlords, each oneupmanship other, for no money but fame. “Try Me”, “I'm Modern”, each bottle cries. And rms considered them foreign, wants people to fold to “GNU”, and sends an army to get them to switch from gpl2 to gpl3. Hello, my name is rms, YOU belongs to me.

Rms, lives in the woods, haven't been coding for like 20 years. Every few months, makes a outlandish statement. Like, Can somebody make emacs into Microsoft Word? What is magit? and why isn't it in GNU emacs? Can somebody make emacs change font size?

then, undying woodworkers crawl out of the woodwork, with suckling millennials, defending rms, like, a god. rms is always right. He sees the future!

The emacs dev list, has this culture of communism commune, where, every clueless joe is “equal”, and voices shit freely. So, any issue, is a debate ball, from all corners of the earth. No process. No rule. We are cooperative peace on earth, the heaven of equal opinions!

One'd expect that code contribution rules in emacs dev, at least. Well, get in line, regardless what celestial deity you are. Prostrate and bow to the GNU. Then, we might look at what your problem is. Then, mention ye code again. If it survives feast of opinions. Beg again. Maybe.

this emacs dev problem comes up every now and then thru the years, by many coders, big and small names, old and new. (reddit, hackernews) Each time, some, example: abo abo, eli, insist and deny, any problem whatsoever. gnu people are nice, emacs dev is smooth, rms is god, all's well.

Emacs: Copy Current Line If No Selection 🚀 (minor code update. Now, when copy, don't print a message)

emacs 26 bug: Error in post-command-hook (ido-exhibit): (error "Attempt to modify read-only object" "goto-char") problem seems to be smex. but hard to debug.

reproduce: M-x smex, then type “go”

2018-03-24 fixed in GNU Emacs 26.0.91

what if Xah lead emacs

ok, comes to be thinking, what if i am to lead emacs.

ok, first thing, axe all platforms other than mac, windows, linux.

then, axe, without mercy, any deprecated or obsolete code that's more than 10 years old.

then, axe, the common lisp fk in emacs lisp. Aggressively suck in the newer replacement from melpa people.

then, axe, anything complex, and anything approaches of a hack.

ok, char limit. something like that.

How to Avoid Emacs Pinky (minor update. updated all hand toys.)

Ask Xah, emacs, JavaScript, keyboard, 2017-12-01 at https://www.patreon.com/posts/15656041

Richard Stallman Pushing for GPL3, Kick Out Free Software from Free Software Platform (2017-08)

now on its own page