Xah Emacs Blog
You, put in a few bucks in my patreon. https://www.patreon.com/xahlee
Found a problem with ivy mode. If you run
repeat-complex-command, it bloats up your history like this:
emacs 26 force typing yes/no for deleting dir?
in emacs 26, when deleting a directory, it now force user to type full “yes”/"no".
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.
emacs lisp byte code internal
here's a great article.
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
- smex instead of M-x.
- ivy. Replaces builtin ido, icomplete, M-x. (i started to use ivy just yesterday)
- ibuffer (builtin) instead of list-buffers.
- company-mode replaces complete-symbol and hippie-expand.
- xah-fly-keys replaces viper-mode.
- xah-find.el replaces grep, rgrep, dired-do-find-regexp-and-replace
- xah-elisp-mode replaces emacs-lisp-mode
- xah-reformat-lines instead of fill-region
- xah-toggle-letter-case instead of upcase-region, downcase-region, upcase-initials-region
- xah-insert-bracket-pair instead of electric-pair-mode
- xah-delete-backward-char-or-bracket-text instead of delete-backward-char
- xah-close-current-buffer replaces kill-buffer.
- xah-open-file-at-cursor replaces find-file-at-point
- xah-copy-line-or-region instead of kill-ring-save
- xah-comment-dwim instead of comment-dwim
ok. that's one too many.
now, a reverse replacement.
- emacs abbrev instead of yasnippet.
- basic emacs lisp, instead of s.el f.el, dash.el. (if any use it, i am like no thank you.)
- xah-extend-selection instead of expand-region mode.
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.
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
ido-mode, but it doesn't cover M-x or C-h f.
icomplete-mode does, but
its UI is way inferior. and
hippie-expand adds to the total
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 PLUS. 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 crawls 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 collaborative 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, e.g. abo abo, eli, insists and deny, any problem whatsoever. gnu people are nice, emacs dev is smooth, rms is god, all's well.
Emacs: Copy/Cut Current Line If No Selection (minor code update. Now, when copy, don't print a message)
emacs 26 problem: 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”
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 the Emacs Pinky Problem (minor update. updated all hand toys.)
now on its own page
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
How to Write a Emacs Major Mode for Syntax Coloring (minor update)
removed use of global variables.
i was, using setq for temp variables.
was that way, because it's simpler for beginner to understand, instead of
but now, 10 years later, time's changed.
Emacs's Command Frequency Statistics (repost)
remember, that linum mode makes your emacs super slow.
download emacs 26, and
for linux, download and compile it. Emacs: How to Build Emacs from git Repository
for MacOS, get emacs 26 beta at https://emacsformacosx.com/builds
also, whenever you upgrade emacs, you may need to recompile, or update, all your external packages.
My Typing/RSI Experience 1992 to 2017 (updated)
the following pages, have been reviewed/updated
emacs window/frame management problem
an emacs frequently asked questions, the window/pane config reset problem. https://www.reddit.com/r/emacs/comments/7evidd/windmove_shortcuts/
that's a frequently asked questions, comes up every few months.
Best solution, is to stop 1-window full-screen workflow. Because, all sorts of emacs commands will constantly pop up and split your nicely setup panes. You'll have to fight it every few minutes.
This 1-window style came from terminal and IDEs. The former, are conditioned to have just 1 window (unless you make another connection to server). The latter, the IDEs, are based on pallette idea, where you have a fixed pane config, and every tool is predefined to sit in some pane/drawer/tab that lets you open or collapse them.
there are various packages that help you “reset” your windows config. But they just add more work to your fingers.
Instead, use 2 windows side by side workflow. This way, your window config never changes unexpectedly. And, operating system provides much more flexible and powerful ways to control them. (e.g. Mac expose, or various linux tiling managers, and virtual screens) And, you can now fully utilize emacs split/unsplit horizontal/vertical on any window as you work, view different parts of a buffer, run calc, calendar, dired, shell, etc. Fluid and flexible.
check out my article on effective windows management for screenshots and detail.
Best Keyboard for Emacs (more update)
2 new commands for Mac. xah-open-in-textedit, xah-open-in-safari
emacs lisp, still don't have trim string. how many more years?
in any language, trim string is a fundamental string function. #emacs lisp still don't have it! sitting in limbo for 3 years. How many more years? see
code example for 30 new list functions
emacs lisp. Planning to write example for each of the 30 new elisp functions.
patreon tip me if you like to see it.
better nav panel, emacs + elisp in 1 place
now, the side panel, contain both emacs and elisp in one place, for easy navigation.
empty cache and refresh browser. (in chrome, shift+f5)
tip me at my patreon. https://www.patreon.com/xahlee
emacs lisp sequence functions finally here
emacs 25.1 added over 10 list processing functions. Finally. For detail, see
removed comment system on my site
just removed disqus comment on all my sites for now. They are now forcing image ads. And their ads are those low quality sensational types. To opt ad free, would be $10/month. But, comment takes 30min/day to reply, and 95% are garbage. (i have 5 thousand pages on my sites) might add back, we'll see. let me know what you think.
important update. For isearch-forward, make these equivalent: sequence of: space newline tab hyphen underscore
before, i didn't add a plus sign, so that if you isearch a text with newline followed by 2 spaces, emacs will not find the next occurrence. Possibly a emacs bug.
science of Keybinding Design ⌨
lisp is dead
today is probably a good day to declare lisp dead. For a few years now, you don't hear lisp as cool stuff anymore. Not even much clojure. A new generation of programers, unceremoniously took place.
I think time moved on. No new Common Lisp coders. Scheme quietly went away, replaced by pyret (python) by themselves. Clojure struggle among tons of new langs, confined in enterprise coding on java platform. emacs lisp remain in handful of emacs users.
San Francisco Bay Area Keyboard Meetup Impressions. i smashed 100 keyboards! see San Francisco Bay Area Keyboard Meetup 2017-11 Impressions
updated the following.
Emacs: Eww Web Browser (major update. new screenshot. added keybinding, and a new rename function)
buy me a coffee at my patreon. https://www.patreon.com/xahlee thanks.
Emacs: Regex Tutorial (minor update)
Tips on Long Term Emacs Productivity (updated)
thanks to jcs for mention, at http://irreal.org/blog/?p=6733
jcs is a long time emacs blogger, check out his blog, containing many tips i don't cover much here, especially on using org mode, TeX, and web security.
Emacs Opening Large File Slow (on its own page)
Emacs: 𝔗ℌ𝔒𝔘 𝔖ℌ𝔄𝔏𝔗 𝔈𝔐𝔄ℭ𝔖 (minor update)
another emacs rsi
Elisp: Find String Inside HTML Tag (minor update)
How to Write grep in Emacs Lisp (minor update)
Emacs: xah-lookup.el, Lookup the Web (corrected a init setup doc error.)
Emacs: Cycle Fonts by Command (minor update)
Emacs: Effective Windows Management (minor update)
the following line wrap articles have been reviewed and updated
the following has been reviewed and updated
New version of xah emacs tutorial is sent to previous buyers. If you haven't already, buy it now.
Thanks to many who requested to be kept on the update list. You'll continue to receive updates.
Elisp: Simple Emacs Lisp Examples (updated)
Emacs: Select Line, between Quotes, Extend Selection (updated xah-select-line, xah-select-block, so that they don't depend on my other functions.)
emacs on Mac!
Why Run Shell in Emacs? (added a Mac screenshot!)
since am now on a Mac (after 5 years on linux desktop), am going to add more Mac screenshots.
by the way, my history of emacs desktop (at home) is:
- 1998 to 2009. Emacs on Mac. (and also, 1999 to 2002 emacs on Microsoft Windows NT)
- 2009 to 2012. Emacs on Microsoft Windows
- 2012 to 2017. Emacs on Linux
- 2017. Emacs on Mac again.
Start Emacs with New Empty Buffer
updated. now it returns the buffer. With instructions on how to start emacs with empty buffer.
thanks to Vaddi3 asking on https://www.reddit.com/r/emacs/comments/79wsn7/mx_helppls_startup_empty_buffer_error/
Emacs: GUI Emacs vs Terminal Emacs (updated)
ask me questions on patreon
San Francisco Bay Area Mechanical Keyboard Meetup, Saturday, November 11th, 2017
I'll be going! Thanks to Andy Lee.
i'll be there probably 10am to afternoon. Exactly i don't know yet. email or twitter me if you want to get in touch.
so far there are 200 people registered. Be sure to register. I think they allow max of 300.
Best Keyboard for Emacs (updated)
put a few bucks in my patreon. https://www.patreon.com/xahlee
or buy my emacs tutorial. Buy Xah Emacs Tutorial
I highly recommended this keyboard for emacs.
ask me question on reddit https://www.reddit.com/r/MechanicalKeyboards/comments/73zhle/xbows_keyboard_unboxing/
San Francisco Bay Area Mechanical Keyboard Meetup, November 11th, 2017
San Francisco Bay Area Mechanical Keyboard Meetup, November 11th, 2017. any going? give me a holler.
I would like to announce that the Bay Area Mechanical Keyboard Meetup 2017 that is organized by the combined forces of Input Club and myself will be held on November 11th, 2017. Andrew@Inputclub (/u/inputclub), Haata@inputclub (/u/triplehaata), and I, have joined forces to create the BEST, Bay Area/NorCal meetup. We would also like to extend our thanks and gratitude to Yuppie for making this possible. Without Yuppie we would have never been able to secure such an amazing venue. We hope we can see you there.
- At a glance, here are the relevant details:
- Date: November 11th, 2017
- Time: 10am-5pm
- Lunch: Yes
- Nest Headquarters
- 3400 Hillview Ave.
- Palo Alto, CA 94304
- Parking is available
- Transit: Caltrain is a 20 minute walk from California Avenue Station - Also close to the VTA 522 and 22
patreon me. https://www.patreon.com/xahlee
emacs: fix displaying emoji on Mac
it's interesting that emacs on macOS does not do unicode by default.
FSF GNU emacs disabled displaying color emoji on Mac, so that Mac won't work better than linux
download font “symbola” at Download Free Unicode Fonts
then put this in your emacs init file:
;; specify font for all unicode characters (when (member "Symbola" (font-family-list)) (set-fontset-font t 'unicode "Symbola" nil 'prepend))
[see Emacs: Font Setup]
patreon me. https://www.patreon.com/xahlee Thanks.
in September, i'll be blogging on my patreon account only.
If you like my stuff, i hope you patreon me there.
new command xah-image-autocrop
the new version improves the old one. Because, it can work on a image file itself, no need to be in dired. And, now the code is standalone.
if you like it, patreon me please. https://www.patreon.com/xahlee
Emacs: Copy File Path of Current Buffer (updated the code. Now, when in dired, it'll target the file the cursor is on, or marked files.)
new command to check parenthesis/brackets balance. Early patreon access. https://www.patreon.com/posts/14043280
2017-11-01, now here Emacs: Check Parenthesis/Brackets Balance
Emacs: Change Brackets and Quotes (code update. Now works on text block if no selection)
added 20 new CSS keywords and about 80 abbreviations.
new emacs command, change space to new lines
If you are my patreon, you get to read it first. It'll be open to public after 3 days.
If you are not my patreon, might try to write it yourself. Good elisp exercise.
Emacs Copy Append Text
Emacs: Interactive Abbrev (code update)
to my patreon supporters, new article https://www.patreon.com/posts/13809835
lisp quiz: insert random hex algorithms
insert random hex algorithms. which is more efficient? which is more random? lisp
Emacs: Abbrev Mode (added how to add abbrev for major mode)
Emacs: Run Current File (now supports golang, with gofmt before run)
Or Buy Xah Emacs Tutorial
Or buy a nice keyboard: Best Keyboard for Emacs
Ask me question on patreon