File: minor_mode

package info (click to toggle)
yasnippet-snippets 0~git20161123-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 5,000 kB
  • ctags: 19
  • sloc: lisp: 73; python: 23; ada: 4; makefile: 2
file content (20 lines) | stat: -rw-r--r-- 467 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# -*- mode: snippet -*-
# name: minor_mode
# key: minor
# --
(defvar ${1:mode}-modeline-indicator " ${2:indicator}"
  "call ($1-install-mode) again if this is changed")

(defvar $1-mode nil)
(make-variable-buffer-local '$1-mode)
(put '$1-mode 'permanent-local t)

(defun $1-mode (&optional arg)
  "$0"
  (interactive "P")
  (setq $1-mode
        (if (null arg) (not $1-mode)
          (> (prefix-numeric-value arg) 0)))
  (force-mode-line-update))

(provide '$1-mode)