Skip to content

Instantly share code, notes, and snippets.

@hgiddens
Created October 4, 2011 04:42
Show Gist options
  • Select an option

  • Save hgiddens/1260918 to your computer and use it in GitHub Desktop.

Select an option

Save hgiddens/1260918 to your computer and use it in GitHub Desktop.
For the Emacs users in the house
;; Lets you insert a lambda using C-' l
;; Got the idea from Tim Bray, hence the name. Would be better as a minor mode or
;; something but I'm lazy and this works.
(defun braysian-insert (c)
"Inserts a special character."
(interactive "c")
(let* ((braysian-insertion-map '((?z . #x200b) ; zero width space
(?S . #x2018) ; left single quote
(?s . #x2019) ; right single quote
(?' . #x2019)
(?* . #x2022) ; bullet
(?. . #x2026) ; horizontal ellipsis
(?D . #x201c) ; left double quote
(?d . #x201d) ; right double quote
(?i . #x221e) ; infinity symbol
(?m . #x2014) ; em dash
(?n . #x2013) ; en dash
(?H . #x2011) ; non-breaking hyphen
(?h . #x2010) ; hyphen
(?l . #x3bb))) ; lambda
(ucs-code (cdr (assoc c braysian-insertion-map))))
(when ucs-code (ucs-insert ucs-code))))
(global-set-key (read-kbd-macro "C-'") 'braysian-insert)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment