Hoist an outline in Emacs

Saturday, April 29th, 2006

I’ve been customizing my copy of Emacs (Aquamacs) over the past few weeks, and I’ve been happy with how it’s coming along. I’ve switched over to Emacs for most of my writing and all of my programming.

One annoyance has been Emacs’ lack of an obvious hoist function, like you’ll find in OmniOutliner or Tinderbox. (Note to Mark Bernstein: It would be great to give Hoist a keyboard command). I still use OmniOutliner for lists and agendas, and Tinderbox for thinking, managing all my projects and to do’s, and writing long documents. I miss their advanced functions when using Emacs.

Eventually, I found the narrow-to-region and widen commands. You need to enable the narrow-to-region command, because it’s disabled by default. Give them a useful keychord (I’ve selected Apple-H and Apple-Option-H to match OmniOutliner), and voila, instant hoist!

From my .emacs:

;;;; Enable Narrow to region
(put ‘narrow-to-region ‘disabled nil)

;;;; Hoist
(global-set-key [?\A-H] ‘narrow-to-region)

;;;; Un-Hoist
(global-set-key [?\A-\M-H] ‘widen)

Sharing is Caring:

Comments