I've been drinking too much caffeine lately, and if you know me, you know what that means--I start getting weird urges to play with Emacs.
One of the things that always drives me crazy about Emacs is indentation. It's hard to get it to do what I want it to do in cases where there is no mode that matches what I'm coding. I have a ton of files written using vimoutliner, and I don't feel like switching them to Emacs' own format. It's a simple outline format. Four space wide tabs are used for nesting.
I could never figure out how to get Emacs to just "do the right thing" with these .otl files. I finally figured out the right magical incantation, thanks to some hints from Jesse Montrose. Updated:
One of the things that always drives me crazy about Emacs is indentation. It's hard to get it to do what I want it to do in cases where there is no mode that matches what I'm coding. I have a ton of files written using vimoutliner, and I don't feel like switching them to Emacs' own format. It's a simple outline format. Four space wide tabs are used for nesting.
I could never figure out how to get Emacs to just "do the right thing" with these .otl files. I finally figured out the right magical incantation, thanks to some hints from Jesse Montrose. Updated:
;; Add support for Vim outline files.Viola! Editing .otl files just became possible!
(defun otl-setup ()
(setq outline-regexp "\t+")
(setq indent-tabs-mode t) ;; Use real tabs.
(setq tab-width 4))
(setq auto-mode-alist
(cons '("\\.otl$" . outline-mode)
auto-mode-alist))
(add-hook 'outline-mode-hook
'otl-setup)
Comments
(defun otl-setup ()
(setq outline-regexp "\t+")
(setq indent-tabs-mode t) ;; Use real tabs.
(setq tab-width 4))
(setq auto-mode-alist
(cons '("\\.otl$" . outline-mode)
auto-mode-alist))
(add-hook 'outline-mode-hook
'otl-setup)
Since I am normally a die-hard Vim user, I already have a ton of files in vimoutliner mode. I don't want to have to convert these to Emacs' outline-mode.
It looks like a very sophisticated outline tool.