refactor(folding): Improve siren-folding module

- Add a siren-folding function which enables all folding-related modes,
  and change other modules to use this new function.
This commit is contained in:
2020-01-26 21:23:50 +00:00
parent 392d769816
commit abff344eb2
19 changed files with 82 additions and 77 deletions

View File

@@ -1,38 +0,0 @@
;;; siren-folding.el --- jimeh's Emacs Siren: folding configuration.
;;; Commentary:
;; Basic configuration for folding code.
;;; Code:
(use-package hideshowvis
:ensure nil ;; loaded from vendor
)
(defun siren-toggle-hiding (column)
"Toggle hiding/showing blocks via hs-mode.
Borrowed from: http://www.emacswiki.org/emacs/HideShow"
(interactive "P")
(if hs-minor-mode
(if (condition-case nil
(hs-toggle-hiding)
(error t))
(hs-show-all))
(siren-toggle-selective-display column)))
(defun siren-toggle-selective-display (column)
"Helper function for `siren-toggle-hiding'."
(interactive "P")
(set-selective-display
(or column
(unless selective-display
(1+ (current-column))))))
;; Keybindings
(global-set-key (kbd "C-=") 'siren-toggle-selective-display)
(global-set-key (kbd "C-c C-h") 'siren-toggle-hiding)
(provide 'siren-folding)
;;; siren-folding.el ends here