;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&\210\313\314\315\316\317DD\320\321\322\307\304&\210\313\323\315\316\324DD\325\321\326\307\304&\210\327\330\331\332\307\304%\210\327\333\305\334\307\304%\207" [require cl-lib thingatpt custom-declare-group focus nil "Dim the font color of text in surrounding sections." :group font-lock :prefix "focus-" custom-declare-variable focus-mode-to-thing funcall function #[0 "\300\207" [((prog-mode . defun) (text-mode . sentence))] 1] "An associated list between mode and thing.\n\nA thing is defined in thingatpt.el; the thing determines the\nnarrowness of the focused section.\n\nNote that the order of the list matters. The first mode that the\ncurrent mode is derived from is used, so more modes that have\nmany derivatives should be placed by the end of the list.\n\nThings that are defined include `symbol', `list', `sexp',\n`defun', `filename', `url', `email', `word', `sentence',\n`whitespace', `line', and `page'." :type (repeat symbol) focus-read-only-blink-seconds #[0 "\300\207" [1] 1] "The duration of a cursor blink in `focus-read-only-mode'." (float) custom-declare-face focus-unfocused ((t :inherit font-lock-comment-face)) "The face that overlays the unfocused area." focus-focused "The face that overlays the focused area."] 8) #@41 Used to restore the users `cursor-type' (defvar focus-cursor-type cursor-type (#$ . 1401)) #@73 Overrides the choice of thing dictated by `focus-mode-to-thing' if set. (defvar focus-current-thing nil (#$ . 1498)) (make-variable-buffer-local 'focus-current-thing) #@59 Local reference to the buffer focus functions operate on. (defvar focus-buffer nil (#$ . 1671)) (make-variable-buffer-local 'focus-buffer) #@60 The overlay that dims the text prior to the current-point. (defvar focus-pre-overlay nil (#$ . 1816)) (make-variable-buffer-local 'focus-pre-overlay) #@59 The overlay that surrounds the text of the current-point. (defvar focus-mid-overlay nil (#$ . 1972)) (make-variable-buffer-local 'focus-mid-overlay) #@56 The overlay that dims the text past the current-point. (defvar focus-post-overlay nil (#$ . 2127)) (make-variable-buffer-local 'focus-post-overlay) #@145 Timer started from `focus-read-only-cursor-blink'. The timer calls `focus-read-only-hide-cursor' after `focus-read-only-blink-seconds' seconds. (defvar focus-read-only-blink-timer nil (#$ . 2282)) (make-variable-buffer-local 'focus-read-only-blink-timer) #@59 Return the current thing, based on `focus-mode-to-thing'. (defalias 'focus-get-thing #[0 "\206\"\303\304 \"\305\n\"\206\306\307\"\211\203\310 \"A\202 \311\266\202\207" [focus-current-thing focus-mode-to-thing major-mode mapcar car cl-find apply derived-mode-p assoc sentence] 5 (#$ . 2543)]) #@56 Return the current bounds, based on `focus-get-thing'. (defalias 'focus-bounds #[0 "\300\301 !\207" [bounds-of-thing-at-point focus-get-thing] 2 (#$ . 2851)]) #@123 Move the focused section according to `focus-bounds'. If `focus-mode' is enabled, this command fires after each command. (defalias 'focus-move-focus #[0 "rq\210\301 \211\205\302@A\"\262)\207" [focus-buffer focus-bounds focus-move-overlays] 4 (#$ . 3017)]) #@88 Move `focus-pre-overlay', `focus-mid-overlay' and `focus-post-overlay'. (fn LOW HIGH) (defalias 'focus-move-overlays #[514 "\303e#\210\303 #\210\303\nd#\207" [focus-pre-overlay focus-mid-overlay focus-post-overlay move-overlay] 6 (#$ . 3286)]) #@257 This function is run when command `focus-mode' is enabled. It sets the `focus-pre-overlay', `focus-min-overlay', and `focus-post-overlay' to overlays; these are invisible until `focus-move-focus' is run. It adds `focus-move-focus' to `post-command-hook'. (defalias 'focus-init #[0 "\206 ?\2054\304ee\"\304ed\"\304dd\"p\305\n\306\307#\210\310\311 D\"\210\312\313\314\315\316$\210\312\317\320\315\316$\207" [focus-pre-overlay focus-post-overlay focus-mid-overlay focus-buffer make-overlay overlay-put face focus-focused mapc #[257 "\300\301\302#\207" [overlay-put face focus-unfocused] 5 "\n\n(fn O)"] add-hook post-command-hook focus-move-focus nil t change-major-mode-hook focus-terminate] 5 (#$ . 3543)]) #@228 This function is run when command `focus-mode' is disabled. The overlays pointed to by `focus-pre-overlay', `focus-mid-overlay' and `focus-post-overlay' are deleted, and `focus-move-focus' is removed from `post-command-hook'. (defalias 'focus-terminate #[0 "\205 \205\303\304\n E\"\210\305\306\307\310#\210\311\211\311\211\207" [focus-pre-overlay focus-post-overlay focus-mid-overlay mapc delete-overlay remove-hook post-command-hook focus-move-focus t nil] 6 (#$ . 4267)]) #@50 Move point to the middle of BOUNDS. (fn BOUNDS) (defalias 'focus-goto-thing #[257 "\211\205\211@A\\\300\245b\210\301\302!\207" [2 recenter nil] 3 (#$ . 4757)]) #@278 Adjust the narrowness of the focused section for the current buffer. The variable `focus-mode-to-thing' dictates the default thing according to major-mode. If `focus-current-thing' is set, this default is overwritten. This function simply helps set the `focus-current-thing'. (defalias 'focus-change-thing #[0 "\301\302\303\"\304!\211\207" [focus-current-thing (defun line list paragraph sentence sexp symbol word) completing-read "Thing: " intern] 4 (#$ . 4928) nil]) #@75 Pin the focused section to its current location or the region, if active. (defalias 'focus-pin #[0 "\301\300!\205\205\302 \203\303\304 \305 \"\210\306\307\310\311#\207" [focus-mode boundp region-active-p focus-move-overlays region-beginning region-end remove-hook post-command-hook focus-move-focus t] 4 (#$ . 5407) nil]) #@28 Unpin the focused section. (defalias 'focus-unpin #[0 "\301\300!\205\205\302\303\304\305\306$\207" [focus-mode boundp add-hook post-command-hook focus-move-focus nil t] 5 (#$ . 5742) nil]) #@71 Move the point to the middle of the Nth next thing. (fn &optional N) (defalias 'focus-next-thing #[256 "\300 \301 \302\"\210\300 \232\203\302\303!\"\210\304\300 !\207" [focus-bounds focus-get-thing forward-thing cl-signum focus-goto-thing] 7 (#$ . 5942) "p"]) #@75 Move the point to the middle of the Nth previous thing. (fn &optional N) (defalias 'focus-prev-thing #[256 "\300[!\207" [focus-next-thing] 3 (#$ . 6216) "p"]) #@125 Hide the cursor. This function is triggered by the `focus-read-only-blink-timer', when `focus-read-only-mode' is activated. (defalias 'focus-read-only-hide-cursor #[0 "rq\210\304\301!\205 \205\n??\205\305\211\211)\207" [focus-buffer focus-read-only-mode focus-read-only-blink-timer cursor-type boundp nil] 3 (#$ . 6384)]) #@141 Make the cursor visible for `focus-read-only-blink-seconds'. This is added to the `pre-command-hook' when `focus-read-only-mode' is active. (defalias 'focus-read-only-cursor-blink #[0 "rq\210\306\301!\205' \205'\n\307>?\205' \203\310 !\210\f\311\f\312\313#\211)\207" [focus-buffer focus-read-only-mode last-command focus-read-only-blink-timer focus-cursor-type cursor-type boundp (focus-next-thing focus-prev-thing) cancel-timer run-at-time nil focus-read-only-hide-cursor focus-read-only-blink-seconds] 4 (#$ . 6722)]) #@222 Run when `focus-read-only-mode' is activated. Enables `read-only-mode', hides the cursor and adds `focus-read-only-cursor-blink' to `pre-command-hook'. Also `focus-read-only-terminate' is added to the `kill-buffer-hook'. (defalias 'focus-read-only-init #[0 "\302\303!\210\304p\305\306\307\304\310$\210\305\311\312\304\310$\207" [cursor-type focus-buffer read-only-mode 1 nil add-hook pre-command-hook focus-read-only-cursor-blink t kill-buffer-hook focus-read-only-terminate] 5 (#$ . 7258)]) #@161 Run when `focus-read-only-mode' is deactivated. Disables `read-only-mode' and shows the cursor again. It cleans up the `focus-read-only-blink-timer' and hooks. (defalias 'focus-read-only-terminate #[0 "\303\304!\210\n\203\305\n!\210\306\307\310\311\312#\210\307\313\314\312#\207" [focus-cursor-type cursor-type focus-read-only-blink-timer read-only-mode -1 cancel-timer nil remove-hook pre-command-hook focus-read-only-cursor-blink t kill-buffer-hook focus-read-only-terminate] 4 (#$ . 7759)]) #@34 Turn off `focus-read-only-mode'. (defalias 'focus-turn-off-focus-read-only-mode #[0 "\300\301!\207" [focus-read-only-mode -1] 2 (#$ . 8264) nil]) #@89 Non-nil if Focus mode is enabled. Use the command `focus-mode' to change this variable. (defvar focus-mode nil (#$ . 8416)) (make-variable-buffer-local 'focus-mode) #@597 Dim the font color of text in surrounding sections. This is a minor mode. If called interactively, toggle the `Focus mode' mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode. If called from Lisp, toggle the mode if ARG is `toggle'. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number. To check whether the minor mode is enabled in the current buffer, evaluate `focus-mode'. The mode's hook is called both when the mode is enabled and when it is disabled. (fn &optional ARG) (defalias 'focus-mode #[256 "\302 \303=\203 ?\202\247\203\304W\203\305\202\306\307\301!\2031\310\300 \"\2031\300 B\203;\311 \210\202>\312 \210\313\314\203H\315\202I\316\"\210\317\320!\203k\302 \203]\211\302 \232\203k\321\322\203g\323\202h\324\325#\210\210\326 \210\207" [focus-mode local-minor-modes current-message toggle 1 nil t boundp delq focus-init focus-terminate run-hooks focus-mode-hook focus-mode-on-hook focus-mode-off-hook called-interactively-p any message "Focus mode %sabled%s" "en" "dis" " in current buffer" force-mode-line-update] 6 (#$ . 8588) (byte-code "\203\n\301!\202 \302C\207" [current-prefix-arg prefix-numeric-value toggle] 2)]) (defvar focus-mode-hook nil) (byte-code "\300\301N\204\f\302\300\301\303#\210\302\300\304\305#\210\302\300\306\307C#\207" [focus-mode-hook variable-documentation put "Hook run after entering or leaving `focus-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] 4) #@26 Keymap for `focus-mode'. (defvar focus-mode-map (byte-code "\300 \301\302\303#\210\211\262\304!\203\207\211<\203\305!\207\306\307\"\207" [make-sparse-keymap define-key "" focus-read-only-mode keymapp easy-mmode-define-keymap error "Invalid keymap %S"] 5) (#$ . 10267)) (byte-code "\301\302\303\303\211%\207" [focus-mode-map add-minor-mode focus-mode nil] 6) #@109 Non-nil if Focus-Read-Only mode is enabled. Use the command `focus-read-only-mode' to change this variable. (defvar focus-read-only-mode nil (#$ . 10644)) (make-variable-buffer-local 'focus-read-only-mode) #@610 A read-only mode optimized for `focus-mode'. This is a minor mode. If called interactively, toggle the `Focus-Read-Only mode' mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode. If called from Lisp, toggle the mode if ARG is `toggle'. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number. To check whether the minor mode is enabled in the current buffer, evaluate `focus-read-only-mode'. The mode's hook is called both when the mode is enabled and when it is disabled. (fn &optional ARG) (defalias 'focus-read-only-mode #[256 "\304 \305=\203 ?\202\247\203\306W\203\307\202\310\311\301!\2031\312\300 \"\2031\300 B\n\2037\n\203A\313 \210\202D\314 \210\315\316\203N\317\202O\320\"\210\321\322!\203q\304 \203c\211\304 \232\203q\323\324\203m\325\202n\326\327#\210\210\330 \210\207" [focus-read-only-mode local-minor-modes cursor-type focus-cursor-type current-message toggle 1 nil t boundp delq focus-read-only-init focus-read-only-terminate run-hooks focus-read-only-mode-hook focus-read-only-mode-on-hook focus-read-only-mode-off-hook called-interactively-p any message "Focus-Read-Only mode %sabled%s" "en" "dis" " in current buffer" force-mode-line-update] 6 (#$ . 10857) (byte-code "\203\n\301!\202 \302C\207" [current-prefix-arg prefix-numeric-value toggle] 2)]) (defvar focus-read-only-mode-hook nil) (byte-code "\300\301N\204\f\302\300\301\303#\210\302\300\304\305#\210\302\300\306\307C#\207" [focus-read-only-mode-hook variable-documentation put "Hook run after entering or leaving `focus-read-only-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] 4) #@36 Keymap for `focus-read-only-mode'. (defvar focus-read-only-mode-map (byte-code "\300 \301\302\303#\210\301\304\303#\210\301\305\306#\210\301\307\306#\210\301\310\311#\210\301\312\311#\210\211\262\313!\2030\207\211<\2039\314!\207\315\316\"\207" [make-sparse-keymap define-key "n" focus-next-thing " " "p" focus-prev-thing [33554464] "i" focus-turn-off-focus-read-only-mode "q" keymapp easy-mmode-define-keymap error "Invalid keymap %S"] 5) (#$ . 12701)) (byte-code "\301\302\303\303\211%\210\304\305!\207" [focus-read-only-mode-map add-minor-mode focus-read-only-mode nil provide focus] 6)