Xah Emacs Blog Archive 2014-04
Emacs: Open File in External App π (minor update)
Emacs: Pretty Format CSS π (old goodie, on its own page)
Emacs Lisp: Decoding Percent Encoded URL that Has Unicode Chars
emacs lisp. Solved a long time problem. Try to decode this using emacs lisp:
http://en.wikipedia.org/wiki/Saint_Jerome_in_His_Study_%28D%C3%BCrer%29
https://zh.wikipedia.org/wiki/%E6%96%87%E6%9C%AC%E7%BC%96%E8%BE%91%E5%99%A8
For solution see updated at: Elisp: URL Percent Decode/Encode
thanks to nns for the solution.
keyboard design.
Xah No Chord Keyboard
(updated)
see also, another new symmetric keyboard the Yager keyboard. Heart β₯ Keyboard, Butterfly Keyboard, Cat πΈ Keyboard, Star Trek Keyboard β¨ (refresh page)
emacs 24.4 prelease binary for 64 bits Windows. http://semantic.supelec.fr/popineau/programming-emacs.html#sec-2, by [Fabrice Popineau https://plus.google.com/+FabricePopineau/posts]
new version of emacs tutorial. Buy Xah Emacs Tutorial.
tweet, repost, share, buy. Thank you.
spent 3 hours hacking emacs lisp. Created syntax coloring for CSS3 HSL (Hue, Saturation, Lightness) syntax.
See updates at:
- Emacs: Xah CSS Mode π¦
- Emacs: List Colors, Name, Hexadecimal
- Elisp: Convert Color Formats: RGB HSL HSV
- CSS: HSL Color
there's functions at Emacs: List Colors, Name, Hexadecimal that you can call to color any file's hex/hsl color syntax.
Emacs: Copy Paste, kill-ring (updated)
30 minutes job with perl python ruby becomes 5 minutes with emacs lisp:
Emacs: Find Replace on Multiple Files by Function: Add Unicode Name in HTML
Emacs: List Colors, Name, Hexadecimal (updated)
Sacha Chua's Emacs Beginner Resources List, and Emacs Videos
Sacha Chua, the incredibly productive and unique emacs hacker, posted a blog about best emacs resources.
γEmacs beginner resources By Marie Alexis Miravite. At http://sachachua.com/blog/2014/04/emacs-beginner-resources/ , accessed on 2014-04-20γ
Thanks to Sacha and Marie for giving my site a high rating.
Sacha recently started to do a lot emacs videos. I've watched them all, except the new ones in the past month. Haven't had a chance to. If i can get over my stage fright, we'd do a emacs QοΌA or something similar down the road.
you can watch Sacha's videos, collected at http://sachachua.com/blog/tag/emacs-chat/
actually that's not all the emacs ones. I couldn't find one place that collects all at the moment. Check out all her YouTube at https://www.youtube.com/playlist?list=UUlT2UAbC6j7TqOWurVhkuHQ
her videos are very fun to watch.
comment at https://plus.google.com/113859563190964307534/posts/XPXgDiv9VSQ
Emacs Command: Change Unicode Char to HTML Markup
here's a useful emacs lisp command that turns a Unicode symbol into a HTML markup.
(defun xah-mark-unicode (p1) "Wrap γ<mark class=\"unicode\" title=\"U+β¦: βΉNAMEβΊ\"></mark>γ around current character. When called in elisp program, wrap the tag at cursor position p1." (interactive (list (point))) (let* ( (xcodepoint (string-to-char (buffer-substring-no-properties p1 (1+ p1))) ) (xname (get-char-code-property xcodepoint 'name)) ) (goto-char p1) (insert (format "<mark class=\"unicode\" title=\"U+%X: %s\">" xcodepoint xname) ) (forward-char 1) (insert (format "</mark>") ) ) )
For example:
β€
becomes
<mark class="unicode" title="U+26E4: PENTAGRAM" >β€</mark>
Emacs: Key Macro Example: Insert All Unicode Bullets
(updated. now with solution.)
Few days ago we have a challenge: Emacs: Key Macro Example: Insert All Unicode Bullets (updated)
For a Python solution, see: Python: Processing Unicode: unicodedata Module Tutorial.
learned a lesson. Never open a PDF in emacs. Never even do it accidentally.
emacs since version 23 can open PDF files. γsee Emacs 23.2 (Released 2010-05)γ It opens PDF file in doc-view-mode
. It works by converting the PDF file to png image files. Opening a PDF file in dedicated PDF reader takes 1 or 2 seconds, in emacs it takes 10 or freeze emacs. (and it doesn't work in Microsoft Windows or Mac, because it require some external libs.)
here's how to open PDF as hexadecimal, to prevent emacs freezing when accidentally hit a PDF file in dired.
;; open pdf files in hexadecimal mode (add-to-list 'auto-mode-alist '("\\.pdf\\'" . hexl-mode))
emacs 24.4 pretest version is out. Linux only. http://permalink.gmane.org/gmane.emacs.devel/171413
Emacs: Eww Web Browser (on its own page)
Emacs: Key Macro Example: Insert All Unicode Bullets (repost)
the Microsoft Sculpt Ergonomic Keyboard, a great ergonomic keyboard, reviewed by Γystein E Krog (see comment)
Elisp: load, load-file, autoload (updated)
one of the most important command, few people knew how to control case sensitivity. Emacs: Find Replace in Current File (minor update)
Emacs 24.4: Press F11 to Go Full Screen
emacs 24.4 feature. Alt+x toggle-frame-fullscreen
γF11γ to go to full screen.
Emacs: Set Unicode Specific Font
Here's how to set specific font for Unicode emoticons (or a range of Unicode characters)
;; specify font for all unicode characters (set-fontset-font t 'unicode "Symbola" nil 'prepend)
This is very useful. Because, even if you have Unicode font, but emacs still does not display some Unicode emoticons. For example, on latest iBook, Mac OS X, emacs won't display these characters: π π π± πΈ πΈ π½ π
updated at Emacs Init: Setup Font
Delete Duplicate Lines
delete-duplicate-lines
will delete duplicated lines in current text selection. The lines need not be sorted. You can try it on this:
aa bb cc aa bb aa bb
Emacs 24.4 hash-table-keys and hash-table-values
emacs 24.4 has new functions to extract keys from a hash table. Same for values. (but you need to load a library first.) See: Emacs 24.4 (Released 2014-10) and Elisp: Hash Table