Commits

Fuco  committed f918525

Add allout

  • Participants
  • Parent commits af2b8e7

Comments (0)

Files changed (2)

File files/allout.el

+(use-package allout
+  :commands allout-mode
+  :config
+  (progn
+    ;; redefine this to make it work with smartparens
+    (defun allout-pre-command-business ()
+      "Outline `pre-command-hook' function for outline buffers.
+
+Among other things, implements special behavior when the cursor is on the
+topic bullet character.
+
+When the cursor is on the bullet character, self-insert
+characters are reinterpreted as the corresponding
+control-character in the `allout-mode-map-value'.  The
+`allout-mode' `post-command-hook' insures that the cursor which
+has moved as a result of such reinterpretation is positioned on
+the bullet character of the destination topic.
+
+The upshot is that you can get easy, single (ie, unmodified) key
+outline maneuvering operations by positioning the cursor on the bullet
+char.  When in this mode you can use regular cursor-positioning
+command/keystrokes to relocate the cursor off of a bullet character to
+return to regular interpretation of self-insert characters."
+
+      (if (not (allout-mode-p))
+          nil
+        (setq allout-command-counter (1+ allout-command-counter))
+        (setq allout-this-command-hid-text nil)
+        ;; Do hot-spot navigation.
+        (if (and (memq this-command '(sp--self-insert-command self-insert-command))
+                 (eq (point)(allout-current-bullet-pos)))
+            (allout-hotspot-key-handler))))))
 (load "files/mode-line")
 (load "files/smex")
 (load "files/ack")
+(load "files/allout")
 
 ;; vendor
 (vendor 'yasnippet)