?
Current Path : /usr/share/emacs/24.3/lisp/ |
Linux gator3171.hostgator.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 |
Current File : //usr/share/emacs/24.3/lisp/battery.elc |
;ELC ;;; Compiled by mockbuild@buildfarm06-new.corp.cloudlinux.com on Fri Oct 11 10:06:11 2024 ;;; from file /builddir/build/BUILD/emacs-24.3/lisp/battery.el ;;; in Emacs version 24.3.1 ;;; 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&\207" [require timer custom-declare-group battery nil "Display battery status information." :prefix "battery-" :group hardware] 8) (defconst battery--linux-sysfs-regexp "[bB][aA][tT][0-9]?$") (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/") (directory-files "/sys/class/power_supply/" nil battery--linux-sysfs-regexp)) 'battery-linux-sysfs) ((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 (cond ((eq battery-status-function 'battery-linux-proc-acpi) "Power %L, battery %B at %r (%p%% load, remaining time %t)") ((eq battery-status-function 'battery-linux-sysfs) "Power %L, battery %B (%p%% load, remaining time %t)") ((eq battery-status-function 'battery-pmset) "%L power, battery %B (%p%% load, remaining time %t)") (battery-status-function "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 (#$ . 3188)) (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 (#$ . 5011)) #@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 (#$ . 5087) nil]) #@281 Non-nil if Display-Battery mode is enabled. See the command `display-battery-mode' 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 '(#$ . 5483) :set 'custom-set-minor-mode :initialize 'custom-initialize-default :group 'battery :type 'boolean) #@415 Toggle battery status display in mode line (Display Battery mode). With a prefix argument ARG, enable Display Battery mode if ARG is positive, and disable it otherwise. If called from Lisp, enable the mode if ARG is omitted or nil. 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=\203 \n?\202 \310 !\311V\312\f\204 \313 \203$ \314 !\210!\203M \"\203M \n\204: \315\303\f\"\202S \316\304\303\317#\210\320\321#\322#\323 \210\202S \324\325!\210\321\326\327\n\203] \330\202^ \331\"\210\332\333!\203\203 \334\302!\210\306 \203v \306 \232\203\203 \324\335\n\203\200 \336\202\201 \337\"\210)\340 \210\n\207" [#1=#:last-message arg display-battery-mode battery-mode-line-string global-mode-string battery-update-timer current-message toggle 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" "en" "dis" force-mode-line-update battery-status-function battery-mode-line-format battery-update-interval] 4 (#$ . 5933) (list (or current-prefix-arg 'toggle))]) (byte-code "\301\302\303\304\300!\205\n \303\211%\207" [display-battery-mode-map 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\n\203 \307\310 \236A!@X\203 \311\n \"\202 \312\313\307\310 \236A!@\fX\205. \314\315\316%)\317 \207" [battery-status-function data battery-mode-line-format battery-mode-line-limit battery-load-critical battery-mode-line-string propertize read-from-string 112 battery-format "" face error help-echo "Battery status information" force-mode-line-update] 6 (#$ . 7608)]) #@54 Regular expression matching contents of `/proc/apm'. (defconst battery-linux-proc-apm-regexp "^\\([^ ]+\\) \\([^ ]+\\) 0x\\([0-9a-f]+\\) 0x\\([0-9a-f]+\\) 0x\\([0-9a-f]+\\) 0x\\([0-9a-f]+\\) \\(-?[0-9]+\\)% \\(-?[0-9]+\\) \\(.*\\)$" (#$ . 8085)) #@664 Get APM status information from Linux (the kernel). This function works only with the new `/proc/apm' format introduced in Linux version 1.3.58. The following %-sequences are provided: %v Linux driver version %V APM BIOS version %I APM BIOS status (verbose) %L AC line status (verbose) %B Battery status (verbose) %b Battery status, empty means high, `-' means low, `!' means critical, and `+' means charging %p Battery load percentage %s Remaining time (to charge or discharge) in seconds %m Remaining time (to charge or discharge) in minutes %h Remaining time (to charge or discharge) in hours %t Remaining time (to charge or discharge) in the form `h:min' (defalias 'battery-linux-proc-apm #[nil "\306\211\211\211\211\211\211\211\211\211\211\211>?@ABC\307\310!DrDq\210\311\216\306\312\313\217\210\314E!\203\315\316!C\315\317!B\320\315\321!\322\"\323\317\"\204T \324A\202\325A\323\322\"\203d \326A\202n \323\327\"\203n \330A\320\315\331!\322\"\211\332U\203\201 \333@\202\226 \316U\203\215 \334@\202\226 \317U\203\226 \335@\320\315\336!\322\"\211\337U\203\251 \340?\202\320\315\341!\322\"\211\332U\203\277 \342?\343>\202\351 \316U\203\316 \344?\345>\202\351 \317U\203\335 \346?\347>\202\351 \321U\203\351 \350?\351>\315\352!\320\315\353!!\315\354!\355\230\203\377 \f\356_\f\356\245\f\357\245\360\361\n\n\356_Z#+\362C\206\340B\363B\206!\340B\364A\206)\340B\365@\2061\340B\366?\2069\340B\367>\206A\343B\370 \206H\340B\371\f\203T\372\f!\206U\340B\373\203a\372!\206b\340B\374\n\203n\372\n!\206o\340B\375 \206v\340B\257.\f\207" [tem remaining-time hours minutes seconds load-percentage nil generate-new-buffer " *temp*" ((byte-code "\301!\203\n \302!\210\301\207" [#1=#:temp-buffer buffer-name kill-buffer] 2)) (insert-file-contents "/proc/apm") ((error)) re-search-forward match-string 1 2 string-to-number 3 16 logand "not supported" "enabled" "disabled" 32 "disengaged" 4 0 "off-line" "on-line" "on backup" 6 255 "N/A" 5 "high" "" "low" "-" "critical" "!" "charging" "+" 7 8 9 "min" 60 3600 format "%d:%02d" 118 86 73 76 66 98 112 115 number-to-string 109 104 116 battery-status-symbol battery-status line-status bios-interface bios-version driver-version #1# battery-linux-proc-apm-regexp] 13 (#$ . 8338)]) #@624 Get ACPI status information from Linux (the kernel). This function works only with the `/proc/acpi/' format introduced in Linux version 2.4.20 and 2.6.0. The following %-sequences are provided: %c Current capacity (mAh) %r Current rate %B Battery status (verbose) %b Battery status, empty means high, `-' means low, `!' means critical, and `+' means charging %d Temperature (in degrees Celsius) %L AC line status (verbose) %p Battery load percentage %m Remaining time (to charge or discharge) in minutes %h Remaining time (to charge or discharge) in hours %t Remaining time (to charge or discharge) in the form `h:min' (defalias 'battery-linux-proc-acpi #[nil "\306\211\307\306\211\307\211\211\211\211\211@ABCD\310\311!ErEq\210\312\216\307\313\314\217\307F\211G\203G@F\315 \210\307\316\317\217\210\320\321\307\322#\203\247 \320\323\307\322#\203[ \n\324\235\203[ \325\326!\320\327\307\322#\203\223 \f\206h \306\330\325\326!!\\\211\306V\203\223 \203\217 \325\331!\230\203\205 \202\214 \332\333\325\331!#\206\222 \325\331!\320\334\307\322#\203\247 \206\240 \306\330\325\326!!\\db\210\307\335\336\217\210\320\321\307\322#\203\377 \320\337\307\322#\203\311 D\330\325\326!!\\D\320\340\307\322#\203\333 C\330\325\326!!\\C\320\341\307\322#\203\355 A\330\325\326!!\\A\320\342\307\322#\203\377 @\330\325\326!!\\@GA\211G\2044 -C\306V\203C\202DB \203F\f\203F\343\f!\203+\306\202A\344\345\n\346\230\203:B Z\202; !\f\245\347_!\211\347\245\350 \203Q\351 !\206R\352B\353\354\355\356\307\357\360\217\"\361\326#\206c\352B\362\354\355\363\307\364\365\217\"\366\326#\206t\352B\367\f\203\203\351\f!\370Q\206\204\352B\371\n\206\213\352B\372\n\346\230\203\227\373\202\266 \203\246 @W\203\246\374\202\266 \203\265 AW\203\265\375\202\266\376B\377\203\302\351!\206\303\352B\201H \203\321\351 !\206\322\352B\201I \203\352\201J \201K \347_Z#\206\353\352B\201L B\203 \203B\306V\203\351\344 \345B!\362\245\245!!\206\352B\257\n.\207" [hours minutes charging-state rate-type rate capacity 0 nil generate-new-buffer " *temp*" ((byte-code "\301!\203\n \302!\210\301\207" [#1=#:temp-buffer buffer-name kill-buffer] 2)) (directory-files "/proc/acpi/battery/" t "\\`[^.]") ((error)) erase-buffer (byte-code "\301\302\303\"!\207" [dir insert-file-contents expand-file-name "state"] 4) ((error)) re-search-forward "present: +yes$" t "charging state: +\\(.*\\)$" ("unknown" "charged" nil) match-string 1 "present rate: +\\([0-9]+\\) \\(m[AW]\\)$" string-to-number 2 error "Inconsistent rate types (%s vs. %s)" "remaining capacity: +\\([0-9]+\\) m[AW]h$" (byte-code "\301\302\303\"!\207" [dir insert-file-contents expand-file-name "info"] 4) ((error)) "design capacity: +\\([0-9]+\\) m[AW]h$" "last full capacity: +\\([0-9]+\\) m[AW]h$" "design capacity warning: +\\([0-9]+\\) m[AW]h$" "design capacity low: +\\([0-9]+\\) m[AW]h$" zerop floor float "charging" 60 99 number-to-string "N/A" 76 battery-search-for-one-match-in-files mapcar #[(e) "\301P\207" [e "/state"] 2] (directory-files "/proc/acpi/ac_adapter/" t "\\`[^.]") ((error)) "state: +\\(.*\\)$" 100 #[(e) "\301P\207" [e "/temperature"] 2] (directory-files "/proc/acpi/thermal_zone/" t "\\`[^.]") ((error)) "temperature: +\\([0-9]+\\) C$" 114 " " 66 98 "+" "!" "-" "" 104 low warn full-capacity last-full-capacity design-capacity #1# dir --dolist-tail-- 109 116 format "%d:%02d" 112] 16 (#$ . 10640)]) #@534 Get ACPI status information from Linux kernel. This function works only with the new `/sys/class/power_supply/' format introduced in Linux version 2.4.25. The following %-sequences are provided: %c Current capacity (mAh or mWh) %r Current rate %B Battery status (verbose) %d Temperature (in degrees Celsius) %p Battery load percentage %L AC line status (verbose) %m Remaining time (to charge or discharge) in minutes %h Remaining time (to charge or discharge) in hours %t Remaining time (to charge or discharge) in the form `h:min' (defalias 'battery-linux-sysfs #[nil "\306\211\211\211\307\310\311\312@A\313\314!BrBq\210\315\216\306\316\317\217\306C\211D\203 D@C\320 \210\306\321\322\217\210\323\324\306\325#\203eb\210\323\326\306\325#\203W A\327\235\203W \330\331!A\323\332\306\325#\203h \333\334\330\335!!!@\323\336\306\325#\203t \330\331!\306\211EF\323\337\306\325#\203\255 \330\331!\211F\203\255 \323\340\306\325#\203\255 \330\331!\211E\203\255 \334F!\\\n\334E!\\\202\335 \323\341\306\325#\203\335 \330\331!\211F\203\335 \323\342\306\325#\203\335 \330\331!\211E\203\335 \334F!\\\334E!\\*eb\210\203@\203\343@!\204\323\344\306\325#\203A\345\230\203\202 Z\211G\334\330\331!!_@\245\346\245)DA\211D\204+ -\347\350V\204.\n\350V\2034\351\n!\202G \350V\204@\350V\203F\351!\202G\352B\353@\203X\354\355@\356\245\"\202Y\352B\357\f\203h\354\360\f\361_\"\202i\352B\362\f\203v\354\360\f\"\202w\352B\363\f\203\213\354\364\f\211\365\f!Z\361_#\202\214\352B\366 \206\223\352B\367A\206\233\352B\370\350V\203\264\n\350V\203\264\354\355\n\366_\245\"\202\306 \350V\203\305\354\355\366_ \245\"\202\306\352B\371\372\373!\203\342\374\373\375D\376\350#\203\334\377\202\343\201H \202\343\352B\257 .\207" [energy-now energy-full charge-now charge-full hours temperature nil 0.0 0.0 0.0 0.0 generate-new-buffer " *temp*" ((byte-code "\301!\203\n \302!\210\301\207" [#1=#:temp-buffer buffer-name kill-buffer] 2)) (directory-files "/sys/class/power_supply/" t battery--linux-sysfs-regexp) ((error)) erase-buffer (byte-code "\301\302\303\"!\207" [dir insert-file-contents expand-file-name "uevent"] 4) ((error)) re-search-forward "POWER_SUPPLY_PRESENT=1$" t "POWER_SUPPLY_STATUS=\\(.*\\)$" ("Unknown" "Full" nil) match-string 1 "POWER_SUPPLY_\\(CURRENT\\|POWER\\)_NOW=\\([0-9]*\\)$" float string-to-number 2 "POWER_SUPPLY_TEMP=\\([0-9]*\\)$" "POWER_SUPPLY_CHARGE_FULL=\\([0-9]*\\)$" "POWER_SUPPLY_CHARGE_NOW=\\([0-9]*\\)$" "POWER_SUPPLY_ENERGY_FULL=\\([0-9]*\\)$" "POWER_SUPPLY_ENERGY_NOW=\\([0-9]*\\)$" zerop "POWER_SUPPLY_VOLTAGE_NOW=\\([0-9]*\\)$" "Discharging" 10000000.0 99 0 number-to-string "N/A" 114 format "%.1f" 1000000.0 109 "%d" 60 104 116 "%d:%02d" floor 100 66 112 76 file-readable-p "/sys/class/power_supply/AC/online" battery-search-for-one-match-in-files "/sys/class/power_supply/ACAD/online" "1" "AC" rate charging-state #1# dir --dolist-tail-- now-string full-string remaining "BAT"] 14 (#$ . 14076)]) #@361 Get battery status information using `pmset'. The following %-sequences are provided: %L Power source (verbose) %B Battery status (verbose) %b Battery status, empty means high, `-' means low, `!' means critical, and `+' means charging %p Battery load percentage %h Remaining time in hours %m Remaining time in minutes %t Remaining time in the form `h:min' (defalias 'battery-pmset #[nil "\306\211\211\211\211\211\211-\307\310!.r.q\210\311\216\306\312\313\217\210eb\210\314\315\306\316#\203\256 \317\320!-\314\321\306\316#\203\256 \322\323!\203\256 \317\320!\324\225b\210\322\325!\203S \326\327\202w \330 !/W\203c \331\332\202w \330 !0W\203s \333\334\202w \335\336\314\337\306\316#\203\256 \317\320!\330\317\340!!\330\317\341!!12\34221\343W\203\237 \324\202\240 \320\\!\3422\344_1\\!*+\345-\206\266 \346B\347 \206\275 \346B\350\f\206\304 \346B\351\206\313 \336B\352 \206\322 \346B\353\206\331 \346B\354\n\206\340 \346B\257.\207" [minutes hours remaining-time battery-status-symbol battery-status load-percentage nil generate-new-buffer " *temp*" ((byte-code "\301!\203\n \302!\210\301\207" [#1=#:temp-buffer buffer-name kill-buffer] 2)) (byte-code "\300\301\302\303\302\304\305&\207" [call-process "pmset" nil t "-g" "ps"] 7) ((error)) re-search-forward "Currentl?y drawing from '\\(AC\\|Battery\\) Power'" t match-string 1 "^ -InternalBattery-0[ ]+" looking-at "\\([0-9]\\{1,3\\}\\)%" 0 "; charging" "charging" "+" string-to-number "low" "-" "critical" "!" "high" "" "\\(\\([0-9]+\\):\\([0-9]+\\)\\) remaining" 2 3 number-to-string 30 60 76 "N/A" 112 66 98 104 109 116 power-source #1# battery-load-low battery-load-critical m h] 8 (#$ . 17077)]) #@35 Substitute %-sequences in FORMAT. (defalias 'battery-format #[(format alist) "\301\302\303\304\211%\207" [format replace-regexp-in-string "%." #[(str) "\303H\211\304=\203 \305\202 \306 \n\"A\206 \307)\207" [str char alist 1 37 "%" assoc ""] 4] t] 6 (#$ . 18773)]) #@177 Search REGEXP in the content of the files listed in FILES. If a match occurred, return the parenthesized expression numbered by MATCH-NUM in the match. Otherwise, return nil. (defalias 'battery-search-for-one-match-in-files #[(files regexp match-num) "\301\302!rq\210\303\216\304\305\215+\207" [#1=#:temp-buffer generate-new-buffer " *temp*" ((byte-code "\301!\203\n \302!\210\301\207" [#1# buffer-name kill-buffer] 2)) found (byte-code "\305\211\205) \n@\305\306\307\217\203! \310\305\311#\203! \312\313\314\f!\"\210\nA\211\204 \305*\207" [files file --dolist-tail-- regexp match-num nil (byte-code "\301\302\211\211\303%\207" [file insert-file-contents nil replace] 6) ((error)) re-search-forward t throw found match-string] 5)] 2 (#$ . 19050)]) (provide 'battery)