conf-hideshow.el 609 B

123456789101112131415161718192021222324
  1. (defun toggle-selective-display (column)
  2. (interactive "P")
  3. (set-selective-display
  4. (or column
  5. (unless selective-display
  6. (1+ (current-column))))))
  7. (defun toggle-hiding (column)
  8. (interactive "P")
  9. (if hs-minor-mode
  10. (if (condition-case nil
  11. (hs-toggle-hiding)
  12. (error t))
  13. (hs-show-all))
  14. (toggle-selective-display column)))
  15. (load-library "hideshow")
  16. (global-set-key (kbd "C-+") 'toggle-hiding)
  17. (global-set-key (kbd "C-\\") 'toggle-selective-display)
  18. (hs-minor-mode 1)
  19. (provide 'conf-hideshow)