Xah Lee on Mickey Petersen's Mastering Emacs
Mickey Petersen wrote a book Mastering Emacs. The few times i read his articles, honestly, it's incomprehensible to me. He usually write in certain technical precise or comprehensive style that i think some hacker types prefer. Of his writing style, am often thinking, why would i read it instead of elisp manual? In fact, i prefer elisp manual, finding it actually easier to understand and definitely comprehensive.
but, as hackers wont say, YMMV. (Your Mileage May Vary)
Here's a example of Mickey Petersen's tutorial, check it out:
〔Mastering Key Bindings in Emacs By Mickey Petersen. @ https://www.masteringemacs.org/article/mastering-key-bindings-emacs〕
PS I find his book cover design extremely beautiful.
Emacs Lisp: Command to Extract URL (updated code.)
updated code. Twitter recently started to use the character ￼. It is invisible in Google Chrome, but Firefox shows a dashed square with word OBJ inside.
more side navigation panels and the classification problem and hardship of running a site
pages in misc directory now has side panel. See above link as example. Side panel are convenient for user, and connecting many disparate pages into a more weighty and convincing presentation.
I'm still working on some pages that don't have side panel.
it's quite tricky to do them for several reasons, some technical.
first, you have to make sure the contents are related, at least somewhat. You have to group them, put them together in the panel. This is the most time consuming. (you have to read them. And, nuance, style, attitude of article may change its category/subject-matter) If you don't categorize, you have one big pile of links of random articles, and in that case, having a side panel makes the page worse.
xah-select-block, repeat extend downward
new is the command
xah-select-block. It will extend selection downward when called repeatedly. This is, FANTASTIC!
xah-select-line is also new, similar.
Really, massive amount of work on my emacs stuff in past weeks.
new version. Find/Replace in Pure Elisp xah-find.el
new version. Now, the brackets are ASCII ones by default. And customizable.
This is perhaps my most useful package. I use it everyday to do find/replace on thousands of files for past 3 years. Before, it's various other methods in emacs. But this is the best. It's the only one written in elisp, that get rid of lots problems.
how to remove file name association with a major mode?
(setq auto-mode-alist (rassq-delete-all 'js-mode auto-mode-alist))
Someone asked on stackoverflow. (currently is down) Answer added to the above.
Emacs Lisp: Delete Current File (code update)
Emacs Lisp: Command to Extract URL (updated code)
Emacs: Convert Image Files in Dired (minor update)
All sigil has been syntematically replaced
there are 55 files.
1015 ξ and 298 φ
the file with the most sigil ξxi is Emacs Lisp: Command to Change Earth-Coordinate to Google Map Link, at 100 ξxi sigils.
also, turned on CSS coloring, so now all function parameters has its own coloring, and local variables has its own coloring.
for example, see Emacs Lisp: HTML image-link Command
Emacs Lisp: String Match in List (on its own page, originally from a 2014 post.)
Emacs Lisp: Setup Mouse Click to Highlight Matching Words (rid of φgreek ξsigil)
Emacs Lisp: Copy Rectangle Region to kill-ring (fixed broken code.)
Emacs Lisp: Multi-Pair String Replacement with Report (rid of φgreek ξsigil)
Emacs: Convert Straight/Curly Quotes (rid of φgreek ξsigil)
Emacs Lisp: Escape Quotes (rid of φgreek ξsigil)
Emacs Lisp: Copy File Path of Current Buffer (rid of φgreek ξsigil)
Emacs Lisp: Cycle Replace Space Hyphen Underscore (updated code. no more ξsigil)
major update. Now, the index on the navigation panel contains only relevant articles.
Good news. The Microsoft Sculpt Ergonomic Keyboard is not vunerable to the The KeySweeper password sniffing device
if you haven't subscribed to my keyboard blog yet, do so now
navigation panel index now like proper book table of contents
The navigation panel of Practical Emacs has been completely redone. Now, the index is like book's table of contents, of proper topics in organized way. (Pruned out 20 links that's misc and esoteric, such as bug reports or workaround of some packages, and emacs new features of past version.)
- Xah MELPA package collection. Simple code, thoughtful design. Craftsman's choice. 😹
- 杀杀 MELPA 包大全。代码简厉，设计周全。达人之器。😂
Emacs Lisp: HTML image-link Command (removed greek ξsigil)
Emacs: What's Major Mode? (For beginner. New page out of old writings.)
Emacs: Set Default Browser (minor update)
Emacs Lisp: Move Cursor to Beginning of Line/Block (code updated. Removed ξsigil)
Emacs: Move Cursor by Paragraph or Text Block (code updated. Removed ξsigil)
this is good for working with programing source code. see the page for detail. (refresh the page, lots edit)
Emacs Lisp: fill-region, unfill-region Toggle (code entirely rewritten and renamed.)
Emacs: Hard Wrap Lines, fill-paragraph, unfill-paragraph (minor rewrite)
removing Greek sigils ξxi φphi
I've removed Greek sigils in my packages. See them at Xah Emacs Packages
actually, replaced φ by *
and ξ by -
making variable distinct from other identifiers is still useful, and sigil helps.
ξsigil, is like a syntactic type. Sigil to syntax is types to semantics. #haskell #ocaml
each day, i'll update 1 or 2 pages of code on my emacs/elisp tutorial site.
Here's today: Emacs: Remove Accent Marks
if you haven't done so, read The Sigils WAR ξ φ, Ξblood of the Φsigils, an Eulogy to Sigils * - (updated. refresh page.)
Thanks for voting!
fully revamped. On MELPA now. Clean code, full featured, no more pesky Greek sigils ξ φ. Enjoy!
sigil war on reddit. https://www.reddit.com/r/emacs/comments/4s499h/emacs_lisp_sigil_war/
voice your thoughts there.
my reasons for sigil, is Sigil for Function Parameter Names
emacs lisp sigil war! make your choice!
please vote at
New Xah Emacs Tutorial version out. Buy it.
New version is being sent out to previous buyers. Thank you. If you changed email, just let me know.
emacs M-x list-non-matching-lines
several people wrote list-non-matching-lines. See https://www.reddit.com/r/emacs/comments/4rif8d/emacs_lisp_listnonmatchinglines/
I'll be going thru them tonight.
stop treating lines as hard-coded-format. Stop using paredit!
eval-defun are really annoying, because they DEPEND on the code to be formatted in a particular way.
if your code is not indented, they behave badly, such as eval wrong part of the code.
try this. Put the following in a file, place cursor in front of the interactive parenthesis, then call
(defun insert-p-tag () "Insert <p></p> at cursor point." (interactive) (insert "<p></p>") (backward-char 4))
What you get is just the interactive line.
What this means is that, you basically just don't want to use
eval-defun, because the behavior is unpredictable.
Unless, whenever you call that, your code is well-indented by emacs lisp convention.
this is my major bitch with format-dependent treatment of code, which is a idiocy that permeates the whole hackerdom, including, all the paredit, smarparen, style guide, etc conventions and practices.
i've wrote like tens of essays and argued for this for over a decade now, but it's hopeless. People do not get it. The lisper idiots, think you are an idiot or troll. And, now, after 2 decades, new generation comes, all my effort is unheared of.
very sad. am a sad man. and am dying.
if you want to understand the issue, you have to read the following.
- Emacs Lisp: Automatic Code Formatting, Auto Indentation
- Programing: the Harm of Hard-wrapping Lines
- A Text Editor Feature: Extend Selection by Semantic Unit
- Programing: Tab vs Space in Source Code
- Emacs: Why I Don't Use paredit
the point is, stop treating code as hard-formatted presentation.
Corollary: stop counting lines of code.
Corollary: your language should never have line-based syntax, or hard-format syntax such as in Haskell.
but, i think, the world is slowly getting it. golang has gofmt builtin, which is fantastic. It tears down the entire edifice of “code format convention”. AND, it enforces tabs, not spaces, for indentation! (that's good, because tab is semantic, while using spaces for indentation is hard-coded formatting. 〔➤see Programing: Tab vs Space in Source Code〕 )
of course, as steve job said, the only solution is to wait till the older generation die.
O, by the way, there's a guy in emacs community, also a big contributor in clojure, Bozhidar Batsov, who kept churning out Style Guides. Like, Style Guide for emac lisp, Style Guide for ruby, Style Guide for clojure. Very sad.
Actually, style guide for code formatting should be abolished in theory. In practice, not so fast, because we already are stuck with lots of things that basically dependent on hard-formatted code. (most of this hard-line practice, came from unix, the grand-daddy of hack.) (For another example, you know that magit annoyingly tells you your commit message line is longer than 70 chars? that is the idiocy.) (and, do you know where the 70 char convention came from? it's from punch-cards. And, unix back then, can't handle long lines, so many program silently cut it off. 〔➤see Unix, RFC, Line Truncation〕 (and, by the way, today, we still suffer such consequence in emacs. Try to have a file with very long lines. Emacs will slow down to a crawl. (and, by the by the way, about some 7 years ago, it was some hundred flame wars, to get emacs arrow down key to move by visual line instead of hard-line. Hundreds of flame war posts. The emacs die-hards, huffy-and-puffy. Many olbies blame the idiocy of new generation. Your truly, scarified an arm and a leg in red blood for visual lines. )))
- Rants on Emacs Visual Lines by Don Hopkins and Mark Crispin
- Emacs 23.1 New Features (released 2009-07)
- Emacs: Visual Line Mode, Wrap Lines at Word Boundaries
But the important key point here is that, we need to understand the concept, of why, it is no good. And most hackers, are blessed with ignorance here, but think they know it all! (yes, the hacker types. Those elite types, mentioning emacs vim all the time types, the style guide types.)
- What is a Tech Geeker?
- Computing Culture: What's Hacker?
- Paul Graham's Infatuation with the Concept of Hacker
Secondly, more controversially, coding style itself, in general, should be ban'd. I do not think there's any scientific evidence that they help. Of course, some common sense and consistency help, but not the way most style guides programer thoughts to be. We are getting into details here. As, you'll start to define exactly, which style guide is good or bad.
The only style guide, is rather, is language gotcha's that effect algorithmic efficiency. Such as Python: Append String in Loop.
repost. Example of elisp as script.
Emacs Lisp: Parsing Date Time (minor update)
updated. It's not on melpa, you'll need to get it on github.
Emacs: Working with CSS Color Values (now supports hexadecimal color of 3 digits. e.g.
Past Articles by Date
• 2016-06 • 2016-05 • 2016-04 • 2016-02 • 2016-01 • 2015-12 • 2015-11 • 2015-10 • 2015-09 • 2015-08 • 2015-07 • 2015-06 • 2015-05 • 2015-04 • 2015-03 • 2015-02 • 2015-01 • 2014-12 • 2014-11 • 2014-10 • 2014-09 • 2014-08 • 2014-07 • 2014-06 • 2014-05 • 2014-04 • 2014-03 • 2014-02 • 2014-01 • 2013-12 • 2013-11 • 2013-10 • 2013-09 • 2013-08 • 2013-07 • 2013-06 • 2013-05 • 2013-04 • 2013-03 • 2013-02 • 2013-01 • 2012-12 • 2012-11 • 2012-10 • 2012-09 • 2012-08 • 2012-07 • 2012-06 • 2012-05 • 2012-04 • 2012-03 • 2012-01 • 2011-12 • 2011-11 • 2011-10 • 2011-07 • 2011-05 • 2011-01 • 2010-10 • 2010-06 • 2009-12