Xah Emacs Blog Archive 2014-01 to 2014-01
On Mac OS X, you can set up the right ⌘ command key or right ⌥ option to be ▤ Menu key. You can also set the Caps Lock to be Home. Use PCKeyboardHack. See: Mac: Key Remapping and Keybinding Tools
xah fly keys (updated)
Mac OS X. DoubleCommand is revived. See Mac: Key Remapping and Keybinding Tools
a emacs tip. When doing a shell command that generates tens thousands lines of output, such as git checkout a huge 2G repository, don't do it within emacs. Because, the huge amounts of output will slow down the process. Emacs seems to have some sort of buffering… the display slows down to a crawl (when your cursor is at the bottom), but am not sure if it actually throttles (slows) the input. Anyone knows?
post comment at https://plus.google.com/113859563190964307534/posts/cWVxw15KGAu
keys, keys, i want moar keys. Programable Keypads (updated)
Apple's “Menlo” Font for Coding
“Menlo” is a fixed-width (monospaced) sans-serif font introduced in Mac OS X 10.6 (Snow Leopard; 2009)
it is almost the same as “DejaVu Sans Mono”. (my fav. 〔►see Best Unicode Fonts for Programer〕 ) Both are based on “Bitstream Vera Sans Mono”
more about font at Font Articles Index
Emacs: Font Configuration (minor update)
several layouts. Xah's Truly Ergonomic Keyboard Layouts. More interesting there is the related article about layouts, at bottom.
Programing: Decimalize Latitude Longitude
sometimes i post programing challenges. This is a old one from 2012. Programing: Decimalize Latitude Longitude
Just cleaned up and tested everyone's solutions. Also, I finally put my solution up. My solution does some extra input validation.
just collecting and verify people's code actually take a huge amount time. Because, often, they do not always work, or the input output need to be tweaked in order to compare. You also need to add the right credit, people's name, source of the code. Profiling each also takes a lot time. Also, understand each person's code.
for this one, my plan was big. I myself have a solution in emacs lisp. But due to master plan, never actually got to post my own solution. At least now i post it. I mean to add explanation on exactly how my code differ from others, and i still haven't wrote commentary on how each solution works… oh well, maybe next time. I didn't do that yet because to read my own code will take 20 min or so. Yesterday i already spent a hour to verify and tweak all the solutions so that they are in one consistent format good for comparison.
you are still free to supply solutions in your favorite language. Post in comment, and or with link to your github or pastebin.
this is the best companion to your keyboard, for real hacker use for coding. Best Keypad: Razer Orbweaver, Mechanical Keys
basic emacs lisp. Emacs Lisp: Change URL into HTML Link (minor update)
Is Mouse Bad for Programer?
added a video review of the Naga Hex. Best Mouse for Programers: 17 Buttons
Every time i post about mouse, a lot hacker type of coder will gratuitously say programer don't need mouse, or something similar. See Mouse vs Keyboard: Is Mouse Bad for Programer?
Best Mouse for Programers: 17 Buttons (new mouse, Razer Naga Hex)
Emacs: View Info Page (minor update)
emacs's “describe-” commands
describe-function command, and many other that starts with “describe-”. They are in general giving you help or info.
by default, there are 2 keys to invoke them, 【F1】 or 【Ctrl+h】. e.g.
describe-function→ 【Ctrl+h f】
describe-function→ 【Ctrl+h f】
〔►see Emacs Keys Overview〕
here's my own usage, ordered roughly in frequency of use. (with my own keys, plus a few of my own commands)
<menu> h f describe-function <menu> h k describe-key <menu> h 3 man <menu> h 9 xah-lookup-word-definition <menu> h 8 xah-lookup-wikipedia <menu> h 7 xah-lookup-google
<menu> h 4 elisp-index-search <menu> h c describe-char <menu> h m xah-describe-major-mode <menu> h v describe-variable <menu> h e view-echo-area-messages
<menu> h a apropos-command <menu> h l view-lossage <menu> h s describe-syntax <menu> h 0 lookup-all-dictionaries
<menu> h C describe-coding-system <menu> h F Info-goto-emacs-command-node <menu> h I Info-goto-emacs-key-command-node <menu> h L describe-language-environment <menu> h S info-lookup-symbol <menu> h b describe-bindings <menu> h d apropos-documentation <menu> h i info <menu> h n view-emacs-news <menu> h p finder-by-keyword <menu> h r info-emacs-manual <menu> h w where-is
if you are new to emacs, here's some emacs terms explanation:
- point → cursor position (beginning of file is 1)
- frame → window
- window → a pane/frame, as in split window
- buffer → a opened file, or working area like “tab”.
- mark → a cursor position, that begin text selection.
- region → text selection
- transient mark mode → a preference setting, to have text selection highlighted
- cua-mode → a preference setting, to have standard copy/cut/paste/undo keys
if you want my elisp commands:
- they are in ergoemacs-mode (https://ergoemacs.github.io/).
- search my github emacs init https://github.com/xahlee/xah_emacs_init
- define it yourself. Emacs: Lookup Google, Dictionary, Documentation
How to Edit Lisp Code with Emacs (minor update)
How to Evaluate Emacs Lisp Code (minor update)
Emacs Lisp: Documentation Lookup (minor update)
When doc string isn't enough,
elisp-index-search is useful. Call it, type the function name. It'll go to the elisp manual on that.
elisp-index-search doesn't have a key. I use it often, so i give it a easy key. Like this:
(global-set-key (kbd "<f8>") 'elisp-index-search)
〔►see Emacs: How to Define Keys〕
Mark Tarver, inventor of Qi and Shen lisp, provided a solution. Programing Challenge: Constructing a Tree Given Its Edges (sorry i haven't had time to look at the lisp solutions)
some re-organization of emacs keys articles. Emacs Keybinding, Keyboard, Articles Index.
Emacs: Move Cursor by Text Block (on its own page)
lisp's cons, get rid of it!
if you haven't read this yet, you should. Guy Steele on Parallel Programing: Get rid of cons!.
Lisp's cons, is the MOST damaging thing in lisp, bar none. It is the worst thing in computer language history. 〔►see Programing Language: Fundamental Problems of Lisp〕
programing challenge. Python: Constructing a Tree Given Its Edges. See if you can do in emacs lisp.
did you know that Scheme Lisp co-inventor Guy Steele's language, Fortress, uses Unicode brackets? Problems of Symbol Congestion in Computer Languages; ASCII Jam vs Unicode
New version of emacs tutorial is out. Buy Xah Emacs Tutorial. I'll be emailing out the update. Thank you for support.
Emacs: Backup Current File (updated)
How to Set Emacs's User Interface (updated)
emacs: list buffers, switch buffer
split into 2 pages:
Keyboards without Numeric Keypad (updated) The best quality/price ratio is probably the Cooler Master.
Logitech has a new mouse. Logitech G602 Wireless Gaming Mouse with 250 Hour Battery Life Buy at amazon
long tooth blog-like article. Emacs Lisp: Process HTML, span, code, Key, Title, Markups. Sometimes it's good to see blog-style articles, because it leaves a trail of history, record, and you can see what you were thinking, where were you, your progress.
emacs moving to git, we hope!
ground-breaking news. It seems, emacs repo would move to git in the near future.
thanks to, the controversial head Eric S Raymond. See the thread here: http://lists.gnu.org/archive/html/emacs-devel/2014-01/msg00005.html
every time i dip into emacs dev list, it pains me to see the utter inefficiency and arguments there. Everybody argues. Argue, and argue, philosophy waxing, and argue, and you see one hundred weird utterly stupid wild ideas (excuse me) on everything, from dinosaurs of the 1980s insisting their ways, to clueless FSF fanatics who haven't wrote a single line of code but is gung-ho about emacs. In between is every cock who think only he knows how things should be, meanwhile, those who have written respected software or contributed tons of elisp, are treated just like nobody — a complete egalitarian dystopia.
emacs, sucks the weirdos of the world. Count me in.
On this, we must also thank John Wiegley, who daringly and humbly pushed for git 9 months ago. See http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00776.html
linux, working on remote server
sometimes working on remote server, there's no emacs. (For example, server must kept lean, etc.) So, some vim and terminal skill is good.
here's a vim/emacs comparison cheatsheet. http://karl-voit.at/vim-emacs-cheatsheet_of_freezing_hell.txt
thanks to Kev Percy for the tip.
for some other tips, see https://plus.google.com/113859563190964307534/posts/RkyCEhBmFqN
tmux is essential. Suppose you are in a coffee-shop. Then, got a emergency call to fix server. You ssh in and start to work on it. After 1 hour, the coffee-shop is closing and you have to leave. If you close your laptop, you'll be disconnected. But, if you are using
tmux, you can just say
tmux detach. Then, when you get on internet again, you can resume by
tmux a. Btw, there's also GNU
screen for the same purpose, but tmux is better.