Configurations for beautifying Emacs org mode

Configurations for beautifying Emacs org mode

1 Summary

  1. Purpose of the configuration: to beautify org-mode’s appearance with some eye-candies
  2. The configuration contains the following parts
    • choose the right font and fall-back font
    • enable utf coding
    • select org-bullet symbol set
    • select org-ellipsis symbol
    • define the faces of org-bullet

2 choose the font and fall-back font

;; set the fall-back font
;; this is critical for displaying various unicode symbols, such as those used in my init-org.el settings
;; http://endlessparentheses.com/manually-choose-a-fallback-font-for-unicode.html
(set-fontset-font "fontset-default" nil 
                  (font-spec :size 20 :name "Symbola"))

;; Setting English Font
(set-face-attribute
  'default nil :stipple nil :height 130 :width 'normal :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant 'normal :weight 'normal :foundry "outline" :family "DejaVu Sans Mono for Powerline")

3 enable utf coding

;; disable CJK coding/encoding (Chinese/Japanese/Korean characters)
(setq utf-translate-cjk-mode nil)

(set-language-environment 'utf-8)
(setq locale-coding-system 'utf-8)

;; set the default encoding system
(prefer-coding-system 'utf-8)
(setq default-file-name-coding-system 'utf-8)
(set-default-coding-systems 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
;; backwards compatibility as default-buffer-file-coding-system
;; is deprecated in 23.2.
(if (boundp buffer-file-coding-system)
    (setq buffer-file-coding-system 'utf-8)
  (setq default-buffer-file-coding-system 'utf-8))

;; Treat clipboard input as UTF-8 string first; compound text next, etc.
(setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING))

4 select org-bullet symbol set

  1. my candidate symbol lists
    • hexagrams

      “✡” “⎈” “✽” “✲” “✱” “✻” “✼” “✽” “✾” “✿” “❀” “❁” “❂” “❃” “❄” “❅” “❆” “❇”

    • circles

      “○” “☉” “◎” “◉” “○” “◌” “◎” “●” “◦” “◯” “⚪” “⚫” “⚬” “❍” “○” “⊙” “⊚” “⊛” “∙” “∘”

    • special circles

      “◐” “◑” “◒” “◓” “◴” “◵” “◶” “◷” “⚆” “⚇” “⚈” “⚉” “♁” “⊖” “⊗” “⊘”

    • crosses

      “✙” “♱” “♰” “☥” “✞” “✟” “✝” “†” “✠” “✚” “✜” “✛” “✢” “✣” “✤” “✥”

    • poker sybmols

      “♠” “♣” “♥” “♦” “♤” “♧” “♡” “♢”

    • yinyang

      “☯” “☰” “☱” “☲” “☳” “☴” “☵” “☶” “☷”

    • special symbols

      “☀” “♼” “☼” “☾” “☽” “☣” “§” “¶” “‡” “※” “✕” “△” “◇” “▶” “◀” “◈”

  2. my related org-mode settings
    ;; use org-bullets-mode for utf8 symbols as org bullets
    (require 'org-bullets)
    ;; make available "org-bullet-face" such that I can control the font size individually
    (setq org-bullets-face-name (quote org-bullet-face))
    (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))
    (setq org-bullets-bullet-list '("✙" "♱" "♰" "☥" "✞" "✟" "✝" "†" "✠" "✚" "✜" "✛" "✢" "✣" "✤" "✥"))
    

5 select org-ellipsis symbols

  1. my collection of org-ellipsis candidate symbols
    • right arrows

      “↝” “⇉” “⇝” “⇢” “⇨” “⇰” “➔” “➙” “➛” “➜” “➝” “➞”

      “➟” “➠” “➡” “➥” “➦” “➧” “➨”

      “➩” “➪” “➮” “➯” “➱” “➲”

      “➳” “➵” “➸” “➺” “➻” “➼” “➽”

    • arrow heads

      “➢” “➣” “➤” “≪”, “≫”, “«”, “»”

    • other arrows

      “↞” “↠” “↟” “↡” “↺” “↻”

    • lightening

      “⚡”

    • other symbols

      …, ▼, ↴, , ∞, ⬎, ⤷, ⤵

  2. my org-mode settings
    ;; org ellipsis options, other than the default Go to Node...
    ;; not supported in common font, but supported in Symbola (my fall-back font) ⬎, ⤷, ⤵
    (setq org-ellipsis "⚡⚡⚡");; ⤵ ≫
    

6 define the related faces

  1. trick 1: set the variable “org-bullets-face-name”, such that org-mode will use the face-name specified
    ;; make available "org-bullet-face" such that I can control the font size individually
    (setq org-bullets-face-name (quote org-bullet-face))
    
    
    1. Note: org-bullet-face is a face I set up myself. You can set this up using:
(custom-set-faces
 '(org-bullet-face ((t (:foreground "burlywood" :weight normal :height 1.5)))))
  1. trick 2: set the org-bullet-face (I defined this name in the previous line) to have a large font
    (set-face-attribute 'org-bullet-face 
        t :foreground "burlywood" :weight 'normal :height 1.6)
    

7 Appearance of the org buffer after the above configuration

appearance
org-ellipsis-appearance

Author: Da Zhang

Created: 2016-02-15 Mon 02:08

Emacs 25.0.91.1 (Org mode 8.3.3)

 

Advertisements

5 thoughts on “Configurations for beautifying Emacs org mode

  1. Pingback: 2016-02-15 Emacs News - sacha chua :: living an awesome life

  2. Pingback: Using Org Mode Displays for Presentations | Irreal

  3. hi, Da Zhang,
    I have tried to setup above emacs org on .emacs file, while compailing got error on last line of setting
    please let me know how to solve:

    Debugger entered–Lisp error: (error “Invalid face” org-bullet-face)
    internal-set-lisp-face-attribute(org-bullet-face :foreground burlywood t)
    set-face-attribute(org-bullet-face t :foreground burlywood :weight normal :height 1.6)
    eval((set-face-attribute (quote org-bullet-face) t :foreground (quote burlywood) (quote :weight) (quote normal) :height 1.6) nil)
    eval-last-sexp-1(nil)
    eval-last-sexp(nil)
    call-interactively(eval-last-sexp nil nil)
    command-execute(eval-last-sexp)

    • That’s a custom face I set up myself. You can have something similar to:
      (custom-set-faces
      ‘(org-bullet-face ((t (:foreground “burlywood” :weight normal :height 1.5)))))

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s