View file File name : type-break.elc Content :;ELC ;;; Compiled ;;; in Emacs version 27.1 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. ;;; This file does not contain utf-8 non-ASCII characters, ;;; and so can be loaded in Emacs versions earlier than 23. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301\302\303\304\305\306\307&\210\310\311\312\313\314DD\315\316\317\306\301&\210\310\320\312\313\321DD\322\323\324\316\317\306\301& \210\310\325\312\313\326DD\327\316\330\306\301&\210\310\331\312\313\332DD\333\323\334\316\335\306\301& \210\310\336\312\313\337DD\340\316\341\306\301&\210\310\342\312\313\343DD\344\316\317\306\301&\210\310\345\312\313\346DD\347\316\350\306\301&\210\310\351\312\313\352DD\353\316\354\306\301&\210\310\355\312\313\356DD\357\316\317\306\301&\210\310\360\312\313\361DD\362\316\363\306\301&\210\310\364\312\313\365DD\366\316\367\306\301&\210\310\370\312\313\371DD\372\316\373\306\301&\210\310\374\312\313\375DD\376\316\373\306\301&\210\310\377\312\313\201@ DD\201A \201B \201C \316\201D &\207" [custom-declare-group type-break nil "Encourage the user to take a rest from typing at suitable intervals." :prefix "type-break" :group keyboard custom-declare-variable type-break-interval funcall function #[0 "\300\207" [3600] 1] "Number of seconds between scheduled typing breaks." :type integer type-break-good-rest-interval #[0 "\301\245\207" [type-break-interval 6] 2] "Number of seconds of idle time considered to be an adequate typing rest.\n\nWhen this variable is non-nil, Emacs checks the idle time between\nkeystrokes. If this idle time is long enough to be considered a \"good\"\nrest from typing, then the next typing break is simply rescheduled for later.\n\nIf a break is interrupted before this much time elapses, the user will be\nasked whether or not really to interrupt the break." :set-after (type-break-interval) type-break-good-break-interval #[0 "\300\207" [nil] 1] "Number of seconds considered to be an adequate explicit typing rest.\n\nWhen this variable is non-nil, its value is considered to be a \"good\"\nlength (in seconds) for a break initiated by the command `type-break',\noverriding `type-break-good-rest-interval'. This provides querying of\nbreak interruptions when `type-break-good-rest-interval' is nil." (choice (const nil) integer) type-break-keystroke-threshold #[0 "\301\302\303\304\245#\211\302\245\211B\207" [type-break-interval 35 5 * 60] 7] "Upper and lower bound on number of keystrokes for considering typing break.\nThis structure is a pair of numbers (MIN . MAX).\n\nThe first number is the minimum number of keystrokes that must have been\nentered since the last typing break before considering another one, even if\nthe scheduled time has elapsed; the break is simply rescheduled until later\nif the minimum threshold hasn't been reached. If this first value is nil,\nthen there is no minimum threshold; as soon as the scheduled time has\nelapsed, the user will always be queried.\n\nThe second number is the maximum number of keystrokes that can be entered\nbefore a typing break is requested immediately, pre-empting the originally\nscheduled break. If this second value is nil, then no pre-emptive breaks\nwill occur; only scheduled ones will.\n\nKeys with bucky bits (shift, control, meta, etc) are counted as only one\nkeystroke even though they really require multiple keys to generate them.\n\nThe command `type-break-guesstimate-keystroke-threshold' can be used to\nguess a reasonably good pair of values for this variable." (type-break-interval) (cons (choice integer (const nil)) (choice integer (const nil))) type-break-query-function #[0 "\300\207" [yes-or-no-p] 1] "Function to use for making query for a typing break.\nIt should take a string as an argument, the prompt.\nUsually this should be set to `yes-or-no-p' or `y-or-n-p'.\n\nTo avoid being queried at all, set `type-break-query-mode' to nil." (radio function (function-item yes-or-no-p) (function-item y-or-n-p)) type-break-query-interval #[0 "\300\207" [60] 1] "Number of seconds between queries to take a break, if put off.\nThe user will continue to be prompted at this interval until he or she\nfinally submits to taking a typing break." type-break-time-warning-intervals #[0 "\300\207" [(300 120 60 30)] 1] "List of time intervals for warnings about upcoming typing break.\nAt each of the intervals (specified in seconds) away from a scheduled\ntyping break, print a warning in the echo area." (repeat integer) type-break-keystroke-warning-intervals #[0 "\300\207" [(300 200 100 50)] 1] "List of keystroke measurements for warnings about upcoming typing break.\nAt each of the intervals (specified in keystrokes) away from the upper\nkeystroke threshold, print a warning in the echo area.\nIf either this variable or the upper threshold is set, then no warnings\nwill occur." (repeat integer) type-break-warning-repeat #[0 "\300\207" [40] 1] "Number of keystrokes for which warnings should be repeated.\nThat is, for each of this many keystrokes the warning is redisplayed\nin the echo area to make sure it's really seen." type-break-time-stamp-format #[0 "\300\207" [#1="[%H:%M] "] 1 #1#] "Timestamp format used to prefix messages.\nFormat specifiers are as used by `format-time-string'." string type-break-demo-functions #[0 "\300\207" [(type-break-demo-boring type-break-demo-life type-break-demo-hanoi)] 1] "List of functions to consider running as demos during typing breaks.\nWhen a typing break begins, one of these functions is selected randomly\nto have Emacs do something interesting.\n\nAny function in this list should start a demo which ceases as soon as a\nkey is pressed." (repeat function) type-break-demo-boring-stats #[0 "\300\207" [nil] 1] "Show word per minute and keystroke figures in the Boring demo." boolean type-break-terse-messages #[0 "\300\207" [nil] 1] "Use slightly terser messages." type-break-file-name #[0 "\300\301\302\"\207" [locate-user-emacs-file "type-break" ".type-break"] 3] "Name of file used to save state across sessions.\nIf this is nil, no data will be saved across sessions." :version "24.4" file] 10) #@466 Hook run indirectly by `post-command-hook' for typing break functions. This is not really intended to be set by the user, but it's probably harmless to do so. Mainly it is used by various parts of the typing break program to delay actions until after the user has completed some command. It exists because `post-command-hook' itself is inaccessible while its functions are being run, and some type-break--related functions want to remove themselves after running. (defvar type-break-post-command-hook '(type-break-check) (#$ . 6247)) #@63 Format of messages in the mode line concerning typing breaks. (defvar type-break-mode-line-format '(type-break-mode-line-message-mode ("" type-break-mode-line-break-message type-break-mode-line-warning)) (#$ . 6788)) (defvar type-break-mode-line-break-message '(type-break-mode-line-break-message-p type-break-mode-line-break-string)) (defvar type-break-mode-line-break-message-p nil) (defvar type-break-mode-line-break-string " *** TAKE A TYPING BREAK NOW ***") (defvar type-break-mode-line-warning '(type-break-mode-line-break-message-p ("") (type-break-warning-countdown-string (" *** " "Break in " type-break-warning-countdown-string " " type-break-warning-countdown-string-type "***")))) #@285 If non-nil, this is a countdown for the next typing break. This variable, in conjunction with `type-break-warning-countdown-string-type' (which indicates whether this value is a number of keystrokes or seconds) is installed in `mode-line-format' to notify of imminent typing breaks. (defvar type-break-warning-countdown-string nil (#$ . 7488)) #@112 Indicates the unit type of `type-break-warning-countdown-string'. It will be either "seconds" or "keystrokes". (defvar type-break-warning-countdown-string-type nil (#$ . 7840)) (defvar type-break-alarm-p nil) (defvar type-break-keystroke-count 0) (defvar type-break-time-last-break nil) (defvar type-break-time-next-break nil) (defvar type-break-time-last-command (current-time)) (defvar type-break-current-time-warning-interval nil) (defvar type-break-current-keystroke-warning-interval nil) (defvar type-break-time-warning-count 0) (defvar type-break-keystroke-warning-count 0) (defvar type-break-interval-start nil) (byte-code "\300\301\302\303\304DD\305\306\307\310\311\312\313\314\315&\207" [custom-declare-variable type-break-mode funcall function #[0 "\300\207" [nil] 1] "Non-nil if Type-Break mode is enabled.\nSee the `type-break-mode' command\nfor a description of this minor mode.\nSetting this variable directly does not take effect;\neither customize it (see the info node `Easy Customization')\nor call the function `type-break-mode'." :set custom-set-minor-mode :initialize custom-initialize-default :group type-break :type boolean] 12) #@3689 Enable or disable typing-break mode. This is a minor mode, but it is global to all buffers by default. If called interactively, enable Type-Break mode if ARG is positive, and disable it if ARG is zero or negative. If called from Lisp, also enable the mode if ARG is omitted or nil, and toggle it if ARG is `toggle'; disable the mode otherwise. When this mode is enabled, the user is encouraged to take typing breaks at appropriate intervals; either after a specified amount of time or when the user has exceeded a keystroke threshold. When the time arrives, the user is asked to take a break. If the user refuses at that time, Emacs will ask again in a short period of time. The idea is to give the user enough time to find a good breaking point in his or her work, but be sufficiently annoying to discourage putting typing breaks off indefinitely. The user may enable or disable this mode by setting the variable of the same name, though setting it in that way doesn't reschedule a break or reset the keystroke counter. If the mode was previously disabled and is enabled as a consequence of calling this function, it schedules a break with `type-break-schedule' to make sure one occurs (the user can call that command to reschedule the break at any time). It also initializes the keystroke counter. The variable `type-break-interval' specifies the number of seconds to schedule between regular typing breaks. This variable doesn't directly affect the time schedule; it simply provides a default for the `type-break-schedule' command. If set, the variable `type-break-good-rest-interval' specifies the minimum amount of time which is considered a reasonable typing break. Whenever that time has elapsed, typing breaks are automatically rescheduled for later even if Emacs didn't prompt you to take one first. Also, if a break is ended before this much time has elapsed, the user will be asked whether or not to continue. A nil value for this variable prevents automatic break rescheduling, making `type-break-interval' an upper bound on the time between breaks. In this case breaks will be prompted for as usual before the upper bound if the keystroke threshold is reached. If `type-break-good-rest-interval' is nil and `type-break-good-break-interval' is set, then confirmation is required to interrupt a break before `type-break-good-break-interval' seconds have passed. This provides for an upper bound on the time between breaks together with confirmation of interruptions to these breaks. The variable `type-break-keystroke-threshold' is used to determine the thresholds at which typing breaks should be considered. You can use the command `type-break-guesstimate-keystroke-threshold' to try to approximate good values for this. There are several variables that affect how or when warning messages about imminent typing breaks are displayed. They include: `type-break-mode-line-message-mode' `type-break-time-warning-intervals' `type-break-keystroke-warning-intervals' `type-break-warning-repeat' `type-break-warning-countdown-string' `type-break-warning-countdown-string-type' There are several variables that affect if, how, and when queries to begin a typing break occur. They include: `type-break-query-mode' `type-break-query-function' `type-break-query-interval' The command `type-break-statistics' prints interesting things. Finally, a file (named `type-break-file-name') is used to store information across Emacs sessions. This provides recovery of the break status between sessions and after a crash. Manual changes to the file may result in problems. (fn &optional ARG) (defalias 'type-break-mode #[256 "\306 \307\300\310=\203 \311\300!?\202 \312!\313V\"\210\314 \210\203z \203- r\315 \316\"q\210\317)\2043 \320\321 \210\322\323!\210\324 \206A \325 \326\323\f\203f \327\f\323\"\211\262 W\203f \330 ,\331-!\210\f- Z\202p \325 -\331-!\210 \262- #\210\202\235 \321 \210\322\323!\210\332 \210\333 \210 \203\235 r\315 \316\"q\210\334\323!\210\335 \210\336 \210)\337\340\311\300!\203\251 \341\202\252 \342\"\210\343\344!\203\324 \345\300!\210\306 \203\302 \211\306 \232\203\324 \346\347\350\311\300!\203\317 \351\202\320 \352#\266\210\353 \210\311\300!\207" [type-break-mode type-break-file-name buffer-save-without-query global-mode-string type-break-time-last-break type-break-interval current-message set-default toggle default-value prefix-numeric-value 0 type-break-check-post-command-hook find-file-noselect nowarn t (#1="") type-break-keystroke-reset type-break-mode-line-countdown-or-break nil type-break-get-previous-time current-time type-break-schedule type-break-time-difference type-break-get-previous-count type-break-file-time type-break-cancel-schedule do-auto-save set-buffer-modified-p unlock-buffer kill-current-buffer run-hooks type-break-mode-hook type-break-mode-on-hook type-break-mode-off-hook called-interactively-p any customize-mark-as-set #1# message "Type-Break mode %sabled%s" "en" "dis" force-mode-line-update type-break-keystroke-count type-break-interval-start] 7 (#$ . 9001) (byte-code "\206 \301C\207" [current-prefix-arg toggle] 1)]) (defvar type-break-mode-hook nil) (byte-code "\301\302N\204\f \303\301\302\304#\210\305\306\307\310\300!\205 \311\211%\210\312\313\314\315\316DD\317\320\321\322\323\324\325\326\327&\207" [type-break-mode-map type-break-mode-hook variable-documentation put "Hook run after entering or leaving `type-break-mode'.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" add-minor-mode type-break-mode type-break-mode-line-format boundp nil custom-declare-variable type-break-mode-line-message-mode funcall function #[0 "\300\207" [nil] 1] "Non-nil if Type-Break-Mode-Line-Message mode is enabled.\nSee the `type-break-mode-line-message-mode' command\nfor a description of this minor mode." :set custom-set-minor-mode :initialize custom-initialize-default :group type-break :type boolean] 12) #@646 Toggle warnings about typing breaks in the mode line. If called interactively, enable Type-Break-Mode-Line-Message mode if ARG is positive, and disable it if ARG is zero or negative. If called from Lisp, also enable the mode if ARG is omitted or nil, and toggle it if ARG is `toggle'; disable the mode otherwise. The user may also enable or disable this mode simply by setting the variable of the same name. Variables controlling the display of messages in the mode line include: `mode-line-format' `global-mode-string' `type-break-mode-line-break-message' `type-break-mode-line-warning' (fn &optional ARG) (defalias 'type-break-mode-line-message-mode #[256 "\300 \301\302\303=\203 \304\302!?\202 \305!\306V\"\210\307\310\304\302!\203$ \311\202% \312\"\210\313\314!\203O \315\302!\210\300 \203= \211\300 \232\203O \316\317\320\304\302!\203J \321\202K \322#\266\210\323 \210\304\302!\207" [current-message set-default type-break-mode-line-message-mode toggle default-value prefix-numeric-value 0 run-hooks type-break-mode-line-message-mode-hook type-break-mode-line-message-mode-on-hook type-break-mode-line-message-mode-off-hook called-interactively-p any customize-mark-as-set "" message "Type-Break-Mode-Line-Message mode %sabled%s" "en" "dis" force-mode-line-update] 7 (#$ . 15077) (byte-code "\206 \301C\207" [current-prefix-arg toggle] 1)]) (defvar type-break-mode-line-message-mode-hook nil) (byte-code "\301\302N\204\f \303\301\302\304#\210\305\306\307\310\300!\205 \307\211%\210\311\312\313\314\315DD\316\317\320\321\322\323\324\325\326&\207" [type-break-mode-line-message-mode-map type-break-mode-line-message-mode-hook variable-documentation put "Hook run after entering or leaving `type-break-mode-line-message-mode'.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" add-minor-mode type-break-mode-line-message-mode nil boundp custom-declare-variable type-break-query-mode funcall function #[0 "\300\207" [nil] 1] "Non-nil if Type-Break-Query mode is enabled.\nSee the `type-break-query-mode' command\nfor a description of this minor mode." :set custom-set-minor-mode :initialize custom-initialize-default :group type-break :type boolean] 12) #@395 Toggle typing break queries. If called interactively, enable Type-Break-Query mode if ARG is positive, and disable it if ARG is zero or negative. If called from Lisp, also enable the mode if ARG is omitted or nil, and toggle it if ARG is `toggle'; disable the mode otherwise. The user may also enable or disable this mode simply by setting the variable of the same name. (fn &optional ARG) (defalias 'type-break-query-mode #[256 "\300 \301\302\303=\203 \304\302!?\202 \305!\306V\"\210\307\310\304\302!\203$ \311\202% \312\"\210\313\314!\203O \315\302!\210\300 \203= \211\300 \232\203O \316\317\320\304\302!\203J \321\202K \322#\266\210\323 \210\304\302!\207" [current-message set-default type-break-query-mode toggle default-value prefix-numeric-value 0 run-hooks type-break-query-mode-hook type-break-query-mode-on-hook type-break-query-mode-off-hook called-interactively-p any customize-mark-as-set "" message "Type-Break-Query mode %sabled%s" "en" "dis" force-mode-line-update] 7 (#$ . 17366) (byte-code "\206 \301C\207" [current-prefix-arg toggle] 1)]) (defvar type-break-query-mode-hook nil) (byte-code "\301\302N\204\f \303\301\302\304#\210\305\306\307\310\300!\205 \307\211%\207" [type-break-query-mode-map type-break-query-mode-hook variable-documentation put "Hook run after entering or leaving `type-break-query-mode'.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" add-minor-mode type-break-query-mode nil boundp] 6) #@43 Auto-save name of `type-break-file-name'. (defvar type-break-auto-save-file-name (byte-code "\302 )\207" [type-break-file-name buffer-file-name make-auto-save-file-name] 1) (#$ . 18895)) #@92 File break time in `type-break-file-name', unless the file is locked. (fn &optional TIME) (defalias 'type-break-file-time #[256 "\205\"