Xah Emacs Blog

Buy Xah Emacs Tutorial. Master emacs benefits for life.

Tips & Tricks for emacs and emacs lisp.

Emacs Lisp: Single Key to Copy/Paste from Register (updated. No longer requiring a lib.)

in emacs's 1k+ default bindings , i only use 6, arrows and page up/down. Banish Key Chords Banish Key Chords

comment at https://plus.google.com/113859563190964307534/posts/hys14XrtDtX

does linux tiling window really suck? a challenge

F9 is switch to emacs

this is superb. you should, too. Tiling window is no good.

for how, and related tips, see:

vim: set your capslock to esc

if you use vim, it is critical that the Esc be a easy key. Some people make it “jj”, that's not good enough. The ideal position is either under your thumb, with a big key, or the traditional Caps Lock key position, and, must be a single key, not key chord.

See updated: Vim: How to Remap Escape Key?

for vim fans: Linux: How to Swap Caps Lock & Escape Keys?

what switch does space-cadget keyboard use?

i learn that, the Symbolics lisp machine's Space-cadet Keyboard uses Honeywell Hall Effect key switch, which is the highest quality key switch.

space-cadet keyboard 5
Space-cadet Keyboard

According to: http://deskthority.net/wiki/Honeywell_Hall_Effect:

Introduced in 1968, Micro Switch (a division of Honeywell) adapted their Hall effect switch technology to work in keyboards. These switches are among the highest quality ever produced by any keyboard switch company, with reliability being paramount to their design. For increased reliability, there are both 3 pin and 4 pin designs of the switch. The 4 pin are +5, GND and dual open-collector outputs, allowing wired-or of the X, Y keyboard matrix. These switches are naturally bounce-free!

The patent itself originates from 1969, but the design is aesthetically very different from the produced switches.

The Honeywell Hall Effect switch is most famous on some Symbolics keyboards, as well as the Space-cadet keyboard.

Keyfeel: Smooth linear switch, makes Cherry MX Black switches feel like they have sandpaper on the stems.

thanks to Yuriy Pitometsu

a new emacs binary site for Microsoft Windows. http://emacs-bin.sourceforge.net/

thx to Aaron Peromsik

see also Which Emacs to Download for Windows and Mac?

Keyboard Layouts Fight! Dvorak, Colemak, Workman, NEO, Bépo, … (minor update)

I do not believe, there's another soul in this world, who has a keyboard & keybinding setup more efficient than me.

sorry my friends. I had to say that.

Emacs: How to Override Minor Mode Keybinding (major update)

emacs: show isearch keys

try the command isearch-describe-bindings. It will list all keys for isearch. That is, when you call isearch-forwardCtrl+s】.

Thanks to Matt Fidler of ergoemacs-mode

see also: Emacs: How to Override Minor Mode Keybinding

smart whitespace-cleanup before save

Steve Purcell got a great idea about whitespace-cleanup.

whitespace-cleanup-mode is a minor mode which calls whitespace-cleanup before saving the current buffer, but only if the whitespace in the buffer was initially clean. It determines this by quickly checking to see if whitespace-cleanup would have any effect on the buffer.

see whitespace-cleanup-mode.

Emacs's Key Notation: What's the difference between "<return>" and "RET"? (thanks to Kumar)

Emacs's Key Notations Explained (/r ^M C-m RET <return> M- meta) (minor update)

Emacs Lisp: Delete Trailing Whitespace on Save and Compact Empty Lines (updated)

Emacs: Interactive Abbrev in Shell (major update)

Emacs Inferior Shell vs Terminal: What's the advantage of running shell inside emacs? (on its own page)

D

Emacs: What's the difference between {shell, term, ansi-term, eshell}? (on its own page)

emacs: using smex as ido interface to describe-function

if you are using smex, when in smex, you can press 【Ctrl+h f】to jump to describe-function of current command. This is fantastic, because, it basically becomes a ido interface for using describe-function. (the alternative is to use icomplete-mode, but that isn't as good as ido.)

Sacha Chua interviews Mickey Petersen of MasteringEmacs.org

See: 〔Emacs Chat: Mickey Petersen — Mastering Emacs By Sacha Chua. @ http://emacslife.com/emacs-chats/chat-mickey-petersen.html

Sacha Chua is super cute there. And, she's very intelligent, and nice, person. I must say, Mickey Petersen turns out to be a handsome dude. From this video, Mickey is in his spacious living room, well-groomed, wears a sparkling clean white shirt, into cooking. So is a bit different from typical hacker one'd imagine.

emacs vs vim tip jars 2014-09-04
“The Philz baristas at Facebook have learned their customers' weakness as evidenced by these tip jars. ” (from Jeremy Morrell)

comment at https://plus.google.com/113859563190964307534/posts/6QBHaBSocF8

emacs bookmark-jump

discovered bookmark-jump, updated at Emacs: Using Bookmark Feature. Somehow, i've never used that. (thanks to diesch and RobThorpe on reddit at http://www.reddit.com/r/emacs/comments/2f15sh/emacs_using_bookmark_feature/)

I haven't used bookmark for a couple of years. I use Emacs Lisp: Hotkeys to Open File Fast. Will have to give bookmark another shot.

emacs with-syntax-table pain

it turns out, if you use

(with-syntax-table (standard-syntax-table)
    (modify-syntax-entry ?\« "(»")
    (modify-syntax-entry ?\» ")«")
    ;;     )

it'll actually modify the global syntax table, the one returned by standard-syntax-table that is also used by fundamental-mode. (you can check by defining a function containing the above. Call the function. Then, open a new buffer, set it to “fundamental-mode”, then call “describe-syntax”, and check the french quote character's syntax. (by default, it has a syntax of punctuation.))

(info "(elisp) Standard Syntax Tables")

To work around it, you can just create a new syntax table and set it to a local variable, then call with-syntax-table with that.

for a sample code, see Emacs Lisp: How to Modify Syntax Table Temporarily (updated again. Refresh)

i haven't had time to figure out the detail why “with-syntax-table” is doing that. Maybe a bug, i don't know.

comment at https://plus.google.com/113859563190964307534/posts/WB5r4bg8ifZ

emacs syntax table is a major pain in the ASS!

after a hour, discovered that if you use “with-syntax-table”, and modify the syntax entry, it actually modifies the syntax table globally.

that is, for example, if you define the following:

(defun xah-select-text-in-bracket ()
  "Select text between the nearest brackets.
⁖  () [] {} «» ‹› “” 〖〗 【】 「」 『』 () 〈〉 《》 〔〕 ⦗⦘ 〘〙 ⦅⦆ 〚〛 ⦃⦄ ⟨⟩."
  (interactive)
  (with-syntax-table (standard-syntax-table)
    (modify-syntax-entry ?\« "(»")
    (modify-syntax-entry ?\» ")«")
    (modify-syntax-entry ?\‹ "(›")
    (modify-syntax-entry ?\› ")‹")
    (modify-syntax-entry ?\“ "(”")
    (modify-syntax-entry ?\” ")“")

    (let (pos p1 p2)
      (setq pos (point))
      (search-backward-regexp "\\s(" nil t )
      (setq p1 (point))
      (forward-sexp 1)
      (setq p2 (point))
      (goto-char (1+ p1))
      (set-mark (1- p2)))))

and call the command, then, open a new buffer, set it to “fundamental-mode”, then call “describe-syntax”, you'll see tha the standard syntax table used by “fundamental-mode” is actually changed.

haven't had time to figure this one out yet. Just want to put out a warning first. My code here: Emacs Lisp: How to Modify Syntax Table Temporarily is not good since it modifies global syntax table. Keep tuned in for updates.

Emacs Lisp: How to Modify Syntax Table Temporarily (updated. Thanks to Jon Snader's mention @ http://irreal.org/blog/?p=2945)

Like it? or share

Past Articles by Date