summaryrefslogtreecommitdiff
path: root/.config/emacs/site-lisp/line-selection-mode.el
blob: 83da013cd23d8e941871629f76269b9b6b77dd3a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
;;; line-selection-mode.el --- Minor mode for selection by lines  -*- lexical-binding: t; -*-

(defvar-local line-selection-mode--cursor-type nil)

;;;###autoload
(define-minor-mode line-selection-mode
  "Enable `hl-line-mode' and hide the current cursor."
  :global nil
  :init-value nil
  (if line-selection-mode
      (progn
        (hl-line-mode)
        (setq line-selection-mode--cursor-type cursor-type)
        (setq-local cursor-type nil))
    (hl-line-mode -1)
    (setq-local cursor-type line-selection-mode--cursor-type)))

(provide 'line-selection-mode)