%PDF- %PDF-
Direktori : /usr/local/share/emacs/27.2/lisp/ |
Current File : //usr/local/share/emacs/27.2/lisp/battery.elc |
;ELC ;;; Compiled ;;; in Emacs version 27.2 ;;; with all optimizations. ;;; This file contains utf-8 non-ASCII characters, ;;; and so cannot be loaded into Emacs 22 or earlier. (and (boundp 'emacs-version) (< (aref emacs-version (1- (length emacs-version))) ?A) (string-lessp emacs-version "23") (error "`%s' was compiled for Emacs 23 or later" #$)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301!\210\302\303\304\305\306\307\310\311&\210\312\313\314\315\316\317\320\321\310\303& \207" [require timer custom-declare-group battery nil "Display battery status information." :prefix "battery-" :group hardware custom-declare-variable battery-upower-device "battery_BAT1" "Upower battery device name." :version "26.1" :type string] 10) (defalias 'battery--find-linux-sysfs-batteries #[nil "\303\304\305\306\"\303\211\2030 \n@\307 !\204 \310 !\203) \311\312\313 \"!\203) B\nA\211\204 *\237)\207" [dirs file --dolist-tail-- nil directory-files "/sys/class/power_supply/" t file-directory-p file-symlink-p file-exists-p expand-file-name "capacity"] 5]) (byte-code "\300\301\302\303\304\305\306\307&\210\300\310\311\312\304\313\306\307&\207" [custom-declare-variable battery-status-function (cond ((and (eq system-type 'gnu/linux) (file-readable-p "/proc/apm")) #'battery-linux-proc-apm) ((and (eq system-type 'gnu/linux) (file-directory-p "/proc/acpi/battery")) #'battery-linux-proc-acpi) ((and (eq system-type 'gnu/linux) (file-directory-p "/sys/class/power_supply/") (battery--find-linux-sysfs-batteries)) #'battery-linux-sysfs) ((and (eq system-type 'berkeley-unix) (file-executable-p "/usr/sbin/apm")) #'battery-bsd-apm) ((and (eq system-type 'darwin) (condition-case nil (with-temp-buffer (and (eq (call-process "pmset" nil t nil "-g" "ps") 0) (> (buffer-size) 0))) (error nil))) #'battery-pmset) ((fboundp 'w32-battery-status) #'w32-battery-status)) "Function for getting battery status information.\nThe function has to return an alist of conversion definitions.\nIts cons cells are of the form\n\n (CONVERSION . REPLACEMENT-TEXT)\n\nCONVERSION is the character code of a \"conversion specification\"\nintroduced by a `%' character in a control string." :type (choice (const nil) function) :group battery battery-echo-area-format "Power %L, battery %B (%p%% load, remaining time %t)" "Control string formatting the string to display in the echo area.\nOrdinary characters in the control string are printed as-is, while\nconversion specifications introduced by a `%' character in the control\nstring are substituted as defined by the current value of the variable\n`battery-status-function'. Here are the ones generally available:\n%c Current capacity (mAh or mWh)\n%r Current rate of charge or discharge\n%B Battery status (verbose)\n%b Battery status: empty means high, `-' means low,\n `!' means critical, and `+' means charging\n%d Temperature (in degrees Celsius)\n%L AC line status (verbose)\n%p Battery load percentage\n%m Remaining time (to charge or discharge) in minutes\n%h Remaining time (to charge or discharge) in hours\n%t Remaining time (to charge or discharge) in the form `h:min'" (choice string (const nil))] 8) #@37 String to display in the mode line. (defvar battery-mode-line-string nil (#$ . 3182)) (byte-code "\300\301\302\303\304\305\306\307\310\311& \210\300\312\313\314\306\315\310\311&\210\300\316\317\320\306\307\310\311&\210\300\321\322\323\306\307\310\311&\210\300\324\325\326\306\307\310\311&\207" [custom-declare-variable battery-mode-line-limit 100 "Percentage of full battery load below which display battery status." :version "24.1" :type integer :group battery battery-mode-line-format (cond ((eq battery-status-function 'battery-linux-proc-acpi) "[%b%p%%,%d°C]") (battery-status-function "[%b%p%%]")) "Control string formatting the string to display in the mode line.\nOrdinary characters in the control string are printed as-is, while\nconversion specifications introduced by a `%' character in the control\nstring are substituted as defined by the current value of the variable\n`battery-status-function'. Here are the ones generally available:\n%c Current capacity (mAh or mWh)\n%r Current rate of charge or discharge\n%B Battery status (verbose)\n%b Battery status: empty means high, `-' means low,\n `!' means critical, and `+' means charging\n%d Temperature (in degrees Celsius)\n%L AC line status (verbose)\n%p Battery load percentage\n%m Remaining time (to charge or discharge) in minutes\n%h Remaining time (to charge or discharge) in hours\n%t Remaining time (to charge or discharge) in the form `h:min'" (choice string (const nil)) battery-update-interval 60 "Seconds after which the battery status will be updated." battery-load-low 25 "Upper bound of low battery load percentage.\nA battery load percentage below this number is considered low." battery-load-critical 10 "Upper bound of critical battery load percentage.\nA battery load percentage below this number is considered critical."] 10) #@24 Interval timer object. (defvar battery-update-timer nil (#$ . 5006)) #@185 Display battery status information in the echo area. The text being displayed in the echo area is controlled by the variables `battery-echo-area-format' and `battery-status-function'. (defalias 'battery #[nil "\302\303\203 \203 \304 \"\202 \305\"\207" [battery-echo-area-format battery-status-function message "%s" battery-format "Battery status not available"] 5 (#$ . 5082) nil]) #@281 Non-nil if Display-Battery mode is enabled. See the `display-battery-mode' command for a description of this minor mode. Setting this variable directly does not take effect; either customize it (see the info node `Easy Customization') or call the function `display-battery-mode'. (custom-declare-variable 'display-battery-mode nil '(#$ . 5478) :set 'custom-set-minor-mode :initialize 'custom-initialize-default :group 'battery :type 'boolean) #@497 Toggle battery status display in mode line (Display Battery mode). If called interactively, enable Display-Battery 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 text displayed in the mode line is controlled by `battery-mode-line-format' and `battery-status-function'. The mode line is be updated every `battery-update-interval' seconds. (defalias 'display-battery-mode #[(&optional arg) "\306 \307\310 \311=\203 \312\310!?\202 \313 !\314V\"\210\315\204! \316\f\203) \317\f!\210 \203R $\203R \204? \320\302\"\202Y \321\303\302\322#\210\323\324%\325#\326 \210\202Y \327\330!\210\324\331\332\312\310!\203e \333\202f \334\"\210\335\336!\203\223 \337\310!\210\306 \203~ \306 \232\203\223 \315&\327\340\312\310!\203\215 \341\202\216 \342&#\210))\343 \210\312\310!\207" [#1=#:last-message arg battery-mode-line-string global-mode-string battery-update-timer battery-status-function current-message set-default display-battery-mode toggle default-value prefix-numeric-value 0 #2="" (#2#) cancel-timer delq add-to-list t run-at-time nil battery-update-handler battery-update message "Battery status not available" run-hooks display-battery-mode-hook display-battery-mode-on-hook display-battery-mode-off-hook called-interactively-p any customize-mark-as-set "Display-Battery mode %sabled%s" "en" "dis" force-mode-line-update battery-mode-line-format battery-update-interval local] 4 (#$ . 5928) (list (or current-prefix-arg 'toggle))]) (defvar display-battery-mode-hook nil) (byte-code "\301\302N\204\f \303\301\302\304#\210\305\306\307\310\300!\205 \307\211%\207" [display-battery-mode-map display-battery-mode-hook variable-documentation put "Hook run after entering or leaving `display-battery-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 display-battery-mode nil boundp] 6) (defalias 'battery-update-handler #[nil "\300 \210\301\302!\207" [battery-update sit-for 0] 2]) #@53 Update battery status information in the mode line. (defalias 'battery-update #[nil "\205 \306\307 \236A!@\310\203&