Xah Emacs Blog

Tips & Tricks for emacs and emacs lisp.

Emacs Lisp: Replace Invisible Unicode Chars

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

Emacs Lisp Toothpick Syndrome

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.

second, there's technical issues. It'll be time consuming to detail it, but basically, you don't want url to change, and yet, articles are in different directories, but the content isn't nicely group by directories (because they are written in 10 years, and many articles, really can't be categorized into A or B or C…, and also, to create a system of categories is a non-trivial classification problem by itself, think of Dewey Decimal system), and am using relative links because i want my whole site to be 100% usable offline and fast, and without requiring JavaScript. (each page's side panel source code need to be exactly the same) In short, it's not all that easy to do.

Daniel Weinreb Rebuttal to Richard Stallman's Story of LISP History

xah-select-block, repeat extend downward

Emacs: Select Line, between Quotes, Extend Selection

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.

emacs gnu apl mode xmas tree 2016-07-22
GNU APL mode lights up like xmas tree

emacs ido switch window/frame problem

Emacs: Delete Paragraph, Text Block (new)

emacs major mode keys not compatible as key sequence

new version. Find/Replace in Pure Elisp xah-find.el

Emacs: 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.

see:

how to remove file name association with a major mode?

like this:

(setq auto-mode-alist (rassq-delete-all 'js-mode auto-mode-alist))

Emacs: Set File to Open in a Major Mode

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)

Keyboard and RSI, Forearm Pronation, is Keyboard Tenting Important?

Emacs Keybinding, Keyboard, Articles Index

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

see Microsoft Sculpt Ergonomic Keyboard Review

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.)

removed article links 2016-07-14
removed links
xah emacs packages melpa 2016-07-14
Xah Emacs Packages

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)

Emacs: Reformat Lines for Source Code

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)

Emacs Lisp: Command to Change Earth-Coordinate to Google Map Link (updated)

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!

an eulogy to sigils ξ φ

Emacs: Xah CSS Mode

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!

emacs lisp sigil war 03115
emacs lisp sigil war! which do you prefer?

please vote at

https://plus.google.com/113859563190964307534/posts/YskMtvB7rkn

or

https://twitter.com/ErgoEmacs/status/752008581411540992

New Xah Emacs Tutorial version out. Buy it.

Buy Xah Emacs Tutorial

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!

emacs's narrow-to-defun and 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 narrow-to-defun.

(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.

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.

〔➤see Language Syntax: Brackets vs Begin/End vs Indentation for Nesting

〔➤see What Does it Mean When a Programing Language Claims “Whitespace is Insignificant”?

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. )))

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.)

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.

see also Programing: Why Idiomatic Programing Are Bad

Programing Language Design: Syntax Sugar Problem: Irregularity vs Convenience

Emacs Lisp: Batch Script to Validate Matching Brackets

repost. Example of elisp as script.

Emacs Lisp: Parsing Date Time (minor update)

Emacs: Xah CSS Mode

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. #abc)

Eric S Raymond keyboardio 2015-06-18-s
Eric S Raymond and keyboardio

Past Articles by Date

2016-062016-052016-042016-022016-012015-122015-112015-102015-092015-082015-072015-062015-052015-042015-032015-022015-012014-122014-112014-102014-092014-082014-072014-062014-052014-042014-032014-022014-012013-122013-112013-102013-092013-082013-072013-062013-052013-042013-032013-022013-012012-122012-112012-102012-092012-082012-072012-062012-052012-042012-032012-012011-122011-112011-102011-072011-052011-012010-102010-062009-12

Like it? Buy Xah Emacs Tutorial. Thanks.

or, buy something from my keyboard store.