Definite's Extractor

My findings on Life, Linux, Open Source, and so on.

Monthly Archives: September 2014

Sticky note solution that is reliable, cross-platfrom, off-line and synchronizable

I have tried quite a few note taking app/programs, includes tomboy/GNote, xpad, Knote and several others web app. However, none of them have both crucial features, namely off-line mode and easy synchronization.

I was using xpad for some months, it is small and quick and looks like a sticky note. However, for some reason, it started create a lot of empty note that I have no way to delete them from GUI, nor can it synchronized with other devices.

I eventually come up with following combination: emacs as editor, asciidoc for format and styling, and git to sync.

emacs is surprising good for note taking, as it

  • Can change background/foreground color, so it can looks more like a stick note
  • Fast enough start up (I have a special setting for that)
  • Variable font sizes and styles (so you can emphasize text with larger, bold and italic fonts)
  • Great offline support ๐Ÿ™‚
  • Full feature text editing ๐Ÿ™‚

asciidoc provides simple yet powerful markup. Some might say that asciidoc is complex, but hey, for note taking propose, basic text decoration making is sufficient.

This is how I set my environment:

  1. Install emacs
    sudo yum -y install emacs
  2. Configure emacs
    Edit the file ~/note.el

    (custom-set-variables
     ;; custom-set-variables was added by Custom.
     ;; If you edit it by hand, you could mess it up, so be careful.
     ;; Your init file should contain only one such instance.
     ;; If there is more than one, they won't work right.
     '(ansi-color-names-vector ["black" "#d55e00" "#009e73" "#f8ec59" "#0072b2" "#cc79a7" "#56b4e9" "white"])
     '(show-paren-mode t)
     '(make-backup-files nil)
     '(auto-save-visited-file-name t)
    )
    (custom-set-faces
     ;; custom-set-faces was added by Custom.
     ;; If you edit it by hand, you could mess it up, so be careful.
     ;; Your init file should contain only one such instance.
     ;; If there is more than one, they won't work right.
     '(default ((t (:family "DejaVu Sans Mono" :foundry "unknown" :slant normal :weight normal :height 240 :width normal)))))
    (add-to-list 'load-path "~/.emacs.d")
    (require 'adoc-mode)
     (add-to-list 'auto-mode-alist (cons "\\.adoc\\'" 'adoc-mode))
    (add-to-list 'default-frame-alist '(foreground-color . "black"))
    (add-to-list 'default-frame-alist '(background-color . "yellow"))
    (add-to-list 'default-frame-alist '(width . 30)) ; character
    (add-to-list 'default-frame-alist '(height . 20)) ; line
    (setq inhibit-startup-message t)
  3. Set up asciidoc for emacs
    You don’t actually need to install asciidoc itself.
    Follow the instruction of adoc-mode, and copy the .el files to ~/.emacs.d/
  4. Run the note taking program
    emacs -q -l ~/note.elย  -T Note note.adoc

    Basically that is it .

  5. Some optional final touches
    • sync: Put note.adoc in git or dropbox
    • You can also alias the command
      alias enote='emacs -q -l ~note.el -T Note note.adoc'
    • If your window manager support remember, let it remember the window location of “note”

Enjoy!