Xah Emacs Blog Archive 2015-12 to 2015-12
Flexible isearch without a package
;; make isearch treat space dash underscore newline as same (setq search-whitespace-regexp "[-_ \n]")
see also Emacs: Search / Highlight Words
Reddit, on emacs undo
in summary, once a month or two, you tried to undo but unable, because something's broken.
see also Emacs Undo and Emacs Cult Problem
Emacs's Key Syntax Explained (updated)
See also: Emacs Keys Overview
Implementing Queue in Lisp
someone asked me about how to implement queue. He showed a code using list as data structure and lisp macros and stuff that's just totally wrong.
if you don't know, a “queue” is data structure that's “first-in-first-out”. It's like when you go to a restaurant, you have to wait in line. You can only add to the end, and remove from front.
A naive solution is simply to use a list, by popping front and appending to end. The problem is that doing anything to the end of list is expensive.
Here's a article that shows how to implement queue properly.
〔 FIFO Queues in Scheme and Lisp By jcs. At http://irreal.org/blog/?p=40〕
for lisp beginners, see:
JetBrain, IntelliJ, WebStorm, and keyboard
here's a incredible article. The article is about the reaction time the moment you press a key on your keyboard, to the moment it shows up on screen.
Seems silly and useless, but, it went over so many interesting aspects, with hard data and tens of links to other articles, and, specifically, measure some 10 editors/IDEs with data diagrams. Here it is:
〔 Typing with pleasure By Pavel Fatin. At https://pavelfatin.com/typing-with-pleasure/〕
It will take me days to go over the article! He took my arena! I've read the article quickly, and many remarks it says by the wayside, ranging from details of the working of emacs to details of the working of keyboard, i can see it's spot on! Very well researched! Yet it covers so many other things i have no idea of. I need to go over every of its claims and tens of links in detail. Days.
it's written by a JetBrain employee.
a new command, “xah-toggle-previous-letter-case”. See updated Emacs: Toggle Letter Case
Emacs Lisp: How to Write a Toggle/Cycle Command (major rewrite)
Emacs: toggle-word-wrap (on its own page)
for those of you really interested in keyboards. Stenotype Machine
Sacha Chua Interview New Emacs Maintainer John Wiegley
The video is 50 minutes.
The first 23 minutes, is really a demo about gnus, a very old, powerful, package in emacs for reading newsgroup, mailing list, and mails.
The rest, is about John's experience as the new emacs maintainer, and GNU Emacs directions.
One thing particular that John emphasizes is that, there are a lot emacs devs, who haven't been involved in emacs core development, but now it's time for you perhaps to join again, and John welcomes you very much, and will workout any issues you might have, as he sees this as even more important than emacs technical issues.
You can find the video topics break down at Sacha's site at http://sachachua.com/blog/2015/12/2015-12-10-emacs-chat-john-wiegley-maintaining-emacs-can-help/, or a voice recording version to download. (you won't miss much without video, for this one.)
Atreus Keyboard ⌨ (on its own page)
by Phil Hagelberg, who is a major coder of emacs and clojure. Now you can buy it.
new command, xah-open-in-terminal. See bottom at Emacs: Open File in External App
new version of emacs tutorial is out. Buy Xah Emacs Tutorial. Buy it. Thanks.
Emacs: 1 Key to Copy/Paste from Register (updated)
turn the scroll bar off not
in emacs culture, often you'll hear hacker type that says to turn off scroll bar. They consider it useless, and they look at the percentage in the mode line instead.
this is, the most idiotic advice. It is why am often agaist these hacker types or emacs advocate's opinions.
The visual scroll bar, is more effective at indicating the cursor position within a file, and it also gives you a hint of how vertically long is the file. The bigger the file, the scroll bar becomes smaller.
Visual scroll bar is also in your peripheral vision. You don't need to look at it, yet info is convey'd to you.
The percentage in the mode line, needs to go thru a brain cycle to decipher, also, you need to gaze down to the bottom to look at it. Also bad, is that it changes to “Top” when it is 0%, and changes to “Bot” when cursor is at the bottom. The jarring change to “Top”/“Bot” is Extremely bad User Interface. (i wrote a bug report (suggestion) few years ago. Of course, the emacs dev hacker types, will have none of it. In fact, add injury to insult, they “fixed” a bug that relates to how the percentage is calculated.) 〔►see Emacs Mode Line Problem〕
Also, sometimes they say turning off scroll bar saves you screen space. Well yes, it saves 2 to 3 char's width. (and exactly these hacker types will insist that lines be only 70 chars long, so you waste 10 chars worth of space)
Part of the issue the hacker types do these things is that, turning off the scroll bar, doesn't matter if it is technically good move or bad, it is nevertheless a expression of being advanced user. As in, “real programer don't use the mouse”, “real programer uses command line only”, “real programer codes in C”…. This phenomenon, of one-upmanship, superiority, is with us, in any field of mostly males.
Emacs Lisp: Replace HTML Entities (updated code.)
curly quotes in emacs lisp doc string
btw, recently (about 2 months ago), emacs dev introduced curly quotes in doc string. (of actually using the unicode curly quotes “”). All is implemented and done in the development branch, by Paul Eggert. Then, it got hundreds of debates, many want nothing except ASCII in code. The maintainer was still Stefan Monnier. He didn't turn it down as far as i know. But, rms, eventually, just make a remark and it is reverted (under heavy pressure). I am really annoyed by that. rms, although isn't maintainer, but he exercise significant clout on decisions, even purely non-political issues. The list is pretty much a opinion war ground. Louder and numerousness wins. I hoped what whoever rms select as maintainer, will be absolute dictator for his term. I think that'd be better.
tangential discussion from reddit https://www.reddit.com/r/emacs/comments/3v19uj/is_there_anything_emacs_cant_do/
append-to-buffer to accumulate text. Updated at Emacs: Copy/Paste and kill-ring History
Emacs: Copy File Path of Current Buffer (code updated. Now, result is always full path)