;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\303\304\305\306\307\310\311\312\313\314& \210\303\315\316\317\307\310\311\320\313\321& \207" [require dash s custom-declare-variable wilt-mode-line-template "[WILT %.2f]" "The template used to render WILT in the mode line.\n\nThis string will be used as a format string, and the only\nargument passed to the template will be the current wilt value (a\nfloating point number)." :group wilt :type (string) :safe stringp wilt-update-conditions '(save new-line mode-enabled) "When the WILT metric should be recalculated for a buffer.\n\nThe variable is a list of events that may trigger parsing the\nbuffer for new completion:\n\n`save'\n Set buffer-needs-parse flag after the buffer was saved.\n\n`new-line'\n Set buffer-needs-parse flag immediately after a new\n line was inserted into the buffer.\n\n`mode-enabled'\n Set buffer-needs-parse flag after `wilt-mode' has been\n enabled.\n\nIf nil, never automatically recalculate WILT." (set (const :tag "After the buffer was saved" save) (const :tag "After a new line was inserted" new-line) (const :tag "After `wilt-mode' was enabled" mode-enabled)) listp] 10) #@130 Update the WILT if CONDITION is configured for update. See `wilt-update-conditions' for more information on update conditions.  (defalias 'wilt--conditional-update #[(condition) " >\205\302 \207" [condition wilt-update-conditions wilt--update-current] 2 (#$ . 1260)]) #@55 The most recently calculated WILT value for a buffer. (defvar wilt-current 0 (#$ . 1538)) (make-variable-buffer-local 'wilt-current) #@35 Calculate length of current line. (defalias 'wilt--line-length #[nil "\300 \301 Z\207" [line-end-position line-beginning-position] 2 (#$ . 1677)]) #@51 Count the leading whitespace in the current line. (defalias 'wilt--count-whitespace #[nil "\300 \207" [current-indentation] 1 (#$ . 1830)]) #@253 Return a list of leading whitespaces in a buffer. Empty lines are not included in this calculation, so you will often have more lines in a buffer than entries in this return value. Note that this list is reversed relative to the lines in the buffer. (defalias 'wilt--leading-whitespaces #[nil "\301\212eb\210m\204\302 \303V\203\304 B\305y\210\202))\207" [counts nil wilt--line-length 0 wilt--count-whitespace 1] 2 (#$ . 1977)]) #@40 Calculate WILT for the current buffer. (defalias 'wilt-calculate-wilt #[nil "\303 \304!G\211\305U\203\306\202\307 !G\245+\207" [ws total-ws count wilt--leading-whitespaces -sum 0 0.0 float] 3 (#$ . 2423)]) #@34 Show WILT in the message buffer. (defalias 'wilt-display-wilt #[nil "\300\301\302 \"\207" [message "%s" wilt-calculate-wilt] 3 (#$ . 2645) nil]) #@29 Get text for the mode line. (defalias 'wilt--mode-line-status-text #[nil "\302 \"\207" [wilt-mode-line-template wilt-current format] 3 (#$ . 2796)]) #@38 Update the current WILT calculation. (defalias 'wilt--update-current #[nil "\301 \302\303\304\"\207" [wilt-current wilt-calculate-wilt defalias wilt--on-save #[nil "\300\301!\207" [wilt--conditional-update save] 2 "Hook run after a save."]] 3 (#$ . 2952)]) #@39 Hook run after a command is executed. (defalias 'wilt--on-command #[nil "\301=\205 \302\303!\207" [this-command newline wilt--conditional-update new-line] 2 (#$ . 3216)]) #@30 Hooks which wilt hooks into. (defconst wilt-hooks-alist '((after-save-hook . wilt--on-save) (post-command-hook . wilt--on-command)) (#$ . 3395)) #@87 Non-nil if Wilt mode is enabled. Use the command `wilt-mode' to change this variable. (defvar wilt-mode nil (#$ . 3546)) (make-variable-buffer-local 'wilt-mode) #@442 Minor mode for calculating WILT metrics on your code. Just displays WILT metric in status line whenever it's configured to do so. When called interactively, toggle `wilt-mode'. With prefix ARG, enable `wilt-mode' if ARG is positive, otherwise disable it. When called from Lisp, enable `wilt-mode' if ARG is omitted, nil or positive. If ARG is `toggle', toggle `wilt-mode'. Otherwise behave as if called interactively. \{wilt-mode-map} (defalias 'wilt-mode #[(&optional arg) "\306  \307=\203\n?\202 \247\203 \310W\203\311\202\312\313\303!\2032\314\302 \"\n\2032\302 B\n\203Y\f\311\211\203U@\315 @ A\311\316$\210A\211\204?*\202x\f\311\211\203w@\317 @ A\316#\210A\211\204b*\320\321\n\203\202\322\202\203\323\"\210\324\325!\203\252\306 \203\227\306 \232\203\252\326\327\330\n\203\244\331\202\245\332#\210)\333\334!\210)\335 \210\n\207" [#1=#:last-message arg wilt-mode local-minor-modes wilt-hooks-alist hook current-message toggle 1 nil t boundp delq add-hook local remove-hook run-hooks wilt-mode-hook wilt-mode-on-hook wilt-mode-off-hook called-interactively-p any " in current buffer" message "Wilt mode %sabled%s" "en" "dis" wilt--conditional-update mode-enabled force-mode-line-update --dolist-tail--] 6 (#$ . 3714) (list (if current-prefix-arg (prefix-numeric-value current-prefix-arg) 'toggle))]) (defvar wilt-mode-hook nil) (byte-code "\301\302N\204\f\303\301\302\304#\210\303\301\305\306#\210\303\301\307\310C#\210\311\312\313\314\300!\205#\310\211%\210\315\316!\207" [wilt-mode-map wilt-mode-hook variable-documentation put "Hook run after entering or leaving `wilt-mode'.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" custom-type hook standard-value nil add-minor-mode wilt-mode (:eval (wilt--mode-line-status-text)) boundp provide wilt] 6)