Home | About me | Miniblog | Playground
Español | Italiano
Published January 20, 2023

Journey with Org-mode (Jorg)

This are some personal notes, you are totally welcome if you wanna follow with me. Also, all the documentation (with examples) are on https://orgmode.org.

Some of the examples or information about org-mode that references this html document is no longer correct given that I’ve switched to hugo.

Why bother learning org-mode/emacs?

Thankfully I already answer this one. Two answers, rather two stages:

I’m the first time and I only write on emacs. Imagine a rich editor (uhm.. lisp interpreter) which support vim bindings..

Code blocks

Manual

This must be the best advice yet, just download both the org-mode manual and the org compact guide on pdf and it’s just a matter of searching a keyword on the document (or read it all…)

Compact Guide

Themes

So, after all my ricing (outside emacs), I decided to get a nice looking theme for emacs. I thought doom emacs default theme looks similar to onedark vim theme, so I felt like I was coding. Since I use org-mode for writting I can left apart the hacker inside me and use a theme other than dark.

Note: right click to see full image resolution

Default dark

doom-dark theme

Medium theme

doom-monokai-ristretto, neither dark or light

Light theme

light theme

Plan 9 emacs or gruvbox-light seems to be my liking. I’m still new to light modes but I want something that has sepia or the background color of an old book.

Publishing

Don’t ignore files that haven’t changed

    (setq org-publish-use-timestamps-flag nil)

Best tweaks

org hooks

This settings (rather functions) gets applied if the file extension is org. This does two things when entering a *.org file (you can understand it like autocmd on vim):

    (add-hook! org-mode
    	(setq-local display-line-numbers nil)
    	(+zen/toggle)
    )

Just QUIT

    (setq confirm-kill-emacs nil) ; Just quiiiiiit

Spell cheking

Apparently the best way is to use both ispell (basically aspell) and flyspell (hunspell).

ispell

This doesn’t checks for new words but it’s rather a buffer dictionary, the command is self descriptive, that has to be enabled and updated. I only have a caveat which is I don’t know how to switch between dictionaries.

flyspell

Like it’s name, spell checking on the fly. Many say it’s not that accurate, I’m still new to spellchecking so I coldn’t tell you.

Which one to use?

Like I said above, both. I will list a function to change dictionaries on ispell.

Here is a function from https://stackoverflow.com/a/27551890 (CC BY-SA 3.0) : I’ve made some changes to the original function to be more unix friendly and for my use case.

    (defface ispell-alpha-num-choice-face
      '((t (:background "black" :foreground "red")))
      "Face for `ispell-alpha-num-choice-face`."
      :group 'ispell)

    (defface ispell-text-choice-face
      '((t (:background "black" :foreground "forestgreen")))
      "Face for `ispell-text-choice-face`."
      :group 'ispell)

    (defun my-ispell-change-dictionaries ()
    "Switch between language dictionaries."
    (interactive)
      (let ((choice (read-char-exclusive (concat
              "["
              (propertize "E" 'face 'ispell-alpha-num-choice-face)
              "]"
              (propertize "nglish" 'face 'ispell-text-choice-face)
              " | ["
              (propertize "S" 'face 'ispell-alpha-num-choice-face)
              "]"
              (propertize "panish" 'face 'ispell-text-choice-face)))))
        (cond
          ((eq choice ?E)
            (setq flyspell-default-dictionary "english")
            (setq ispell-dictionary "english")
            (setq ispell-personal-dictionary "~/.local/share/dicts/en")
            (ispell-kill-ispell)
            (message "English"))
          ((eq choice ?S)
            (setq flyspell-default-dictionary "spanish")
            (setq ispell-dictionary "spanish")
            (setq ispell-personal-dictionary "~/.local/share/dicts/es")
            (ispell-kill-ispell)
            (message "Español"))
This work is licensed under CC-BY-SA 2.0, unless specified otherwise. Year: 2022