;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\301\302!\210\301\303!\210\301\304!\210\301\305!\210\306\307\310\311\312\303%\210\313\314\315\316\317Y\205#\320\321\"BC\322\312\307%\210\323\324\325\326\327DD\330\312\307\331\332&\210\323\333\325\326\334DD\335\312\307\331\336&\210\323\337\325\326\340DD\341\312\307\331\342&\210\323\343\325\326\344DD\345\312\307\331\342&\210\323\346\325\326\347DD\350\312\307\331\351&\207" [emacs-major-version require cl-lib helm helm-help helm-utils custom-declare-group helm-sys nil "System related helm library." :group custom-declare-face helm-top-columns t append 27 (:extend t) (:inherit helm-header) "Face for helm help string in minibuffer." custom-declare-variable helm-top-command funcall function #[0 "\301=\203\302\207\303\207" [system-type darwin "env COLUMNS=%s ps -axo pid,user,pri,nice,ucomm,tty,start_time,vsz,%%cpu,%%mem,etime,command" "env COLUMNS=%s top -b -n 1"] 2] "Top command used to display output of top.\nA format string where %s will be replaced with `frame-width'.\n\nTo use 'top' command, a version supporting batch mode (-b option)\nis needed. On Mac OSX 'top' command doesn't support this, so the\n'ps' command is used instead by default.\n\nNormally 'top' command output have 12 columns, but in some\nversions you may have less than this, so you can either customize\ntop to use 12 columns with the interactives 'f' and 'W' commands\nof top, or modify `helm-top-sort-columns-alist' to fit with the\nnumber of columns your 'top' command is using.\n\nIf you modify 'ps' command be sure that 'pid' comes in first and\n\"env COLUMNS=%s\" is specified at beginning of command. Ensure\nalso that no elements contain spaces (e.g., use start_time and\nnot start). Same as for 'top': you can customize\n`helm-top-sort-columns-alist' to make sort commands working\nproperly according to your settings." :type string helm-top-sort-columns-alist #[0 "\300\207" [((com . 11) (mem . 9) (cpu . 8) (user . 1))] 1] "Allow defining which column to use when sorting output of top/ps command.\nOnly com, mem, cpu and user are sorted, so no need to put something else there,\nit will have no effect.\nNote that column numbers are counted from zero, i.e. column 1 is the nth 0 column." (alist :key-type symbol :value-type (integer :tag "Column number")) helm-top-poll-delay #[0 "\300\207" [1.5] 1] "Helm top poll after this delay when `helm-top-poll-mode' is enabled.\nThe minimal delay allowed is 1.5, if less than this helm-top will use 1.5." float helm-top-poll-delay-post-command #[0 "\300\207" [1.0] 1] "Helm top stop polling during this delay.\nThis delay is added to `helm-top-poll-delay' after Emacs stops\nbeing idle." helm-top-poll-preselection #[0 "\300\207" [linum] 1] "Stay on same line or follow candidate when `helm-top-poll' updates display.\nPossible values are 'candidate or 'linum.\nThis affects also sorting functions in the same way." (radio :tag "Preferred preselection action for helm-top" (const :tag "Follow candidate" candidate) (const :tag "Stay on same line" linum))] 8) (defvar helm-top-sort-fn nil) (defvar helm-top-map (byte-code "\301 \302\"\210\303\304\305#\210\303\306\307#\210\303\310\311#\210\303\312\313#\210\207" [helm-map make-sparse-keymap set-keymap-parent define-key [134217808] helm-top-run-sort-by-cpu [134217795] helm-top-run-sort-by-com [134217805] helm-top-run-sort-by-mem [134217813] helm-top-run-sort-by-user] 5)) #@26 Local hook for helm-top. (defvar helm-top-after-init-hook nil (#$ . 3473)) (defvar helm-top--poll-timer nil) #@34 (fn &optional NO-UPDATE DELAY) (defalias 'helm-top-poll #[512 "\203\302!\210\3031c\304 \203?\204?\305 \306\267\2024\307\310\211\311\312\313\314\"!#\202=\315\313\316\317\320 DF\202=\321\322 \323#\205=\313!\210\324\325 \211\203T\326\327\206O\330 !\"\202Z\206Z\330 \262\313\331#\2110\207\210\302!\207" [helm-top--poll-timer helm-top-poll-preselection cancel-timer (quit) helm--alive-p helm-force-update #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (candidate 28 linum 41)) replace-regexp-in-string "[0-9]+" regexp-quote helm-get-selection nil t lambda (goto-char (point-min)) forward-line helm-candidate-number-at-point error "cl-ecase failed: %s, %s" (candidate linum) run-with-idle-timer current-idle-time time-add seconds-to-time helm-top--poll-delay helm-top-poll] 10 (#$ . 3588)]) (defalias 'helm-top--poll-delay #[0 "\301]\207" [helm-top-poll-delay 1.5] 2]) (defalias 'helm-top-poll-no-update #[0 "\301\302\303 \\\"\207" [helm-top-poll-delay-post-command helm-top-poll t helm-top--poll-delay] 4]) (defalias 'helm-top-initialize-poll-hooks #[0 "\300\301\302\"\210\300\303\302\"\207" [add-hook post-command-hook helm-top-poll-no-update focus-in-hook] 3]) (byte-code "\300\301\302\303\304DD\305\306\307\310\311\312\313\314\315& \207" [custom-declare-variable helm-top-poll-mode funcall function #[0 "\300\207" [nil] 1] "Non-nil if Helm-Top-Poll mode is enabled.\nSee the `helm-top-poll-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 `helm-top-poll-mode'." :set custom-set-minor-mode :initialize custom-initialize-default :type boolean :group helm-top] 12) #@630 Refresh automatically helm top buffer once enabled. This is a minor mode. If called interactively, toggle the `Helm-Top-Poll 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 `(default-value 'helm-top-poll-mode)'. The mode's hook is called both when the mode is enabled and when it is disabled. (fn &optional ARG) (defalias 'helm-top-poll-mode #[256 "\302 \303\301\304=\203\305\301!?\202!\247\203 \306W\203 \307\202!\310\"\210\311\300!\2038\312\301\"\305\301!\2038\301B \203I\313\314\315\"\210\313\314\316\"\210\202S\317\314\315\"\210\317\314\316\"\210\320\321\305\301!\203_\322\202`\323\"\210\324\325!\203\210\326\301!\210\302 \203x\211\302 \232\203\210\327\330\305\301!\203\204\331\202\205\332\333#\210\210\334 \210\305\301!\207" [global-minor-modes helm-top-poll-mode current-message set-default toggle default-value 1 nil t boundp delq add-hook helm-top-after-init-hook helm-top-poll-no-update helm-top-initialize-poll-hooks remove-hook run-hooks helm-top-poll-mode-hook helm-top-poll-mode-on-hook helm-top-poll-mode-off-hook called-interactively-p any customize-mark-as-set message "Helm-Top-Poll mode %sabled%s" "en" "dis" "" force-mode-line-update] 6 (#$ . 5361) (byte-code "\203\n\301!\202 \302C\207" [current-prefix-arg prefix-numeric-value toggle] 2)]) (defvar helm-top-poll-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\310\313\300!\205#\310\211%\207" [helm-top-poll-mode-map helm-top-poll-mode-hook variable-documentation put "Hook run after entering or leaving `helm-top-poll-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 helm-top-poll-mode boundp] 6) (defvar helm-source-top (helm-make-source "Top" 'helm-source-in-buffer :header-name #[257 "\211\203 \301\202\n\302P\207" [helm-top-poll-mode " (auto updating)" " (Press C-c C-u to refresh)"] 3 "\n\n(fn NAME)"] :init 'helm-top-init :after-init-hook 'helm-top-after-init-hook :cleanup #[0 "\203\301!\210\302\303\304\"\210\302\305\304\"\207" [helm-top--poll-timer cancel-timer remove-hook post-command-hook helm-top-poll-no-update focus-in-hook] 3] :display-to-real 'helm-top-display-to-real :persistent-action '(helm-top-sh-persistent-action . never-split) :persistent-help "SIGTERM" :help-message 'helm-top-help-message :mode-line 'helm-top-mode-line :follow 'never :keymap helm-top-map :filtered-candidate-transformer 'helm-top-sort-transformer :action-transformer 'helm-top-action-transformer :group 'helm-sys)) (defvar helm-top--line nil) #@100 Transformer for `helm-top'. Return empty string for non--valid candidates. (fn CANDIDATES SOURCE) (defalias 'helm-top-transformer #[514 "\301\211:\2039@\262\211\302\303\"\203\202.\302\304\"\203+\305\306\307#\310B\211\202.\310BC\244\262A\262\202\235\206BB\207" [helm-top--line nil string-match "^ *[0-9]+" "^ *PID" propertize face helm-top-columns ""] 10 (#$ . 8336)]) (defalias 'helm-top--skip-top-line #[0 "\301 \302\303\"\211;\205\211\304\230\205\305\306\307#\211\205,\310\306\307\311#)\266\203\205,\312 \207" [inhibit-changing-match-data helm-get-current-source assoc-default name "Top" helm-get-selection nil t "^ *PID" string-match helm-next-line] 10]) #@100 Action transformer for `top'. Show actions only on line starting by a PID. (fn ACTIONS CANDIDATE) (defalias 'helm-top-action-transformer #[514 "\300\301\302\"\303\304\"\203\305\306\307\310F\207\207" [helm-get-selection nil t string-match "\\` *[0-9]+" ("kill (SIGTERM)" lambda (_pid) (helm-top-sh "TERM" (helm-top--marked-pids))) ("kill (SIGKILL)" lambda (_pid) (helm-top-sh "KILL" (helm-top--marked-pids))) ("kill (SIGINT)" lambda (_pid) (helm-top-sh "INT" (helm-top--marked-pids))) ("kill (Choose signal)" lambda (_pid) (let ((pids (helm-top--marked-pids))) (helm-top-sh (helm-comp-read (format "Kill %d pids with signal: " (length pids)) '("ALRM" "HUP" "INT" "KILL" "PIPE" "POLL" "PROF" "TERM" "USR1" "USR2" "VTALRM" "STKFLT" "PWR" "WINCH" "CHLD" "URG" "TSTP" "TTIN" "TTOU" "STOP" "CONT" "ABRT" "FPE" "ILL" "QUIT" "SEGV" "TRAP" "SYS" "EMT" "BUS" "XCPU" "XFSZ") :must-match t) pids)))] 7 (#$ . 9041)]) (defalias 'helm-top--marked-pids #[0 "\300\301\302 \"\207" [helm-remove-if-not-match "\\`[0-9]+\\'" helm-marked-candidates] 3]) #@79 Run kill shell command with signal SIG on PIDS for `helm-top'. (fn SIG PIDS) (defalias 'helm-top-sh #[514 "\300\301\302\303\304#\305\306\307\310\211\211\311\312 \" &$\207" [message "kill -%s %s exited with status %s" mapconcat identity " " apply call-process "kill" nil format "-%s"] 15 (#$ . 10084)]) #@12 (fn PID) (defalias 'helm-top-sh-persistent-action #[257 "\300\301C\"\210\302 \207" [helm-top-sh "TERM" helm-delete-current-selection] 4 (#$ . 10398)]) #@51 Insert output of top command in candidate buffer. (defalias 'helm-top-init #[0 "\3041 \305 \204\306\307!\210r\310\311!q\210\312\313\n\314 \"\305p#*0\207\210\315\316\317!\207" [inhibit-quit helm-top-sort-fn helm-top-command quit-flag (quit) nil helm-top-set-mode-line "CPU" helm-candidate-buffer global call-process-shell-command format frame-width t eval (ignore nil)] 4 (#$ . 10558)]) #@39 Return pid only from LINE. (fn LINE) (defalias 'helm-top-display-to-real #[257 "\300!@\207" [split-string] 3 (#$ . 10955)]) #@12 (fn STR) (defalias 'helm-top-set-mode-line #[257 "\301\302\"\203\303\304\211\305%\211\207\306\307\"P\211\207" [helm-top-mode-line string-match "Sort:\\[\\(.*\\)\\] " replace-match nil 1 format "Sort:[%s] "] 7 (#$ . 11087)]) #@26 (fn CANDIDATES SOURCE) (defalias 'helm-top-sort-transformer #[514 "\301\203;\302\211\211:\203/@\262\303\304\"\203\"C\244\262\202(\211C\244\262A\262\202 \305\306\"\"\266\204\202<\"\207" [helm-top-sort-fn helm-top-transformer nil string-match "^ *[0-9]+" append sort] 12 (#$ . 11328)]) #@14 (fn S1 S2) (defalias 'helm-top-sort-by-com #[514 "\301!\301!\302\236A\21188\231\207" [helm-top-sort-columns-alist split-string com] 9 (#$ . 11644)]) #@14 (fn S1 S2) (defalias 'helm-top-sort-by-mem #[514 "\301!\301!\302\236A\3038!\3038!V\207" [helm-top-sort-columns-alist split-string mem string-to-number] 9 (#$ . 11809)]) #@14 (fn S1 S2) (defalias 'helm-top-sort-by-cpu #[514 "\301!\301!\302\236A\3038!\3038!V\207" [helm-top-sort-columns-alist split-string cpu string-to-number] 9 (#$ . 11995)]) #@14 (fn S1 S2) (defalias 'helm-top-sort-by-user #[514 "\301!\301!\302\236A\21188\231\207" [helm-top-sort-columns-alist split-string user] 9 (#$ . 12181)]) (defalias 'helm-top--preselect-fn #[0 "\301=\203\302\303\304\305\306 DF\207\307\310\211\311\312\303\313\"!#\207" [helm-top-poll-preselection linum lambda nil (goto-char (point-min)) forward-line helm-candidate-number-at-point replace-regexp-in-string "[0-9]+" regexp-quote helm-get-selection t] 7]) (defalias 'helm-top-run-sort-by-com #[0 "\301\302!\210\303\304\305 !\207" [helm-top-sort-fn helm-top-set-mode-line "COM" helm-top-sort-by-com helm-update helm-top--preselect-fn] 2 nil nil]) (defalias 'helm-top-run-sort-by-cpu #[0 "\301\302!\210\303\304\305 !\207" [helm-top-sort-fn helm-top-set-mode-line "CPU" helm-top-sort-by-cpu helm-update helm-top--preselect-fn] 2 nil nil]) (defalias 'helm-top-run-sort-by-mem #[0 "\301\302!\210\303\304\305 !\207" [helm-top-sort-fn helm-top-set-mode-line "MEM" helm-top-sort-by-mem helm-update helm-top--preselect-fn] 2 nil nil]) (defalias 'helm-top-run-sort-by-user #[0 "\301\302!\210\303\304\305 !\207" [helm-top-sort-fn helm-top-set-mode-line "USER" helm-top-sort-by-user helm-update helm-top--preselect-fn] 2 nil nil]) #@72 Return a pair with current X screen number and current X display name. (defalias 'helm-xrandr-info #[0 "\300\301\302\"r\211q\210\303\304\"\216\305\306\307p\307\310%\210\307\211eb\210\212\311\312\307\302#\203(\313\314!\262)\311\315\307\302#\2036\313\316!\262D\266\202*\207" [generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] call-process "xrandr" nil "--current" re-search-forward "\\(^Screen \\)\\([0-9]\\):" match-string 2 "^\\(.*\\) connected" 1] 7 (#$ . 13417)]) #@33 Return current X screen number. (defalias 'helm-xrandr-screen #[0 "\300 @\207" [helm-xrandr-info] 1 (#$ . 13958)]) #@32 Return current X display name. (defalias 'helm-xrandr-output #[0 "\300 A@\207" [helm-xrandr-info] 1 (#$ . 14079)]) (defvar helm-source-xrandr-change-resolution (byte-code "\300\301\302\303\304\305\306\301\307\"&\207" [helm-make-source "Change Resolution" helm-source-sync :candidates #[0 "\300\301\302\"r\211q\210\303\304\"\216\305\306\307p\307\310\311 \312&\210\313b\210\307\211\211\314\315\307\302#\203>\316\313!\262\235\2048C\244\262\307\262\202\266\203*\207" [generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] call-process "xrandr" nil "--screen" helm-xrandr-screen "-q" 1 re-search-forward " \\([0-9]+x[0-9]+\\)" match-string] 9] :action helm-make-actions #[257 "\300\301\302\211\211\303\304 \305\306 \307\n&\n\207" [call-process "xrandr" nil "--screen" helm-xrandr-screen "--output" helm-xrandr-output "--mode"] 12 "\n\n(fn MODE)"]] 9)) (defvar helm-source-emacs-process (byte-code "\300\301\302\303\304\305\306\307\310\311\312\313\314\312\315\"&\f\207" [helm-make-source "Emacs Process" helm-source-sync :init #[0 "\301\302 )\207" [tabulated-list-use-header-line nil list-processes--refresh] 1] :candidates #[0 "\300\301\302 \"\207" [mapcar process-name process-list] 3] :persistent-action #[257 "\300\301!!\210\302 \207" [delete-process get-process helm-delete-current-selection] 4 "\n\n(fn ELM)"] :persistent-help "Kill Process" :action helm-make-actions #[257 "\300 \301:\203@\262\302\303!!\210A\262\202\301\207" [helm-marked-candidates nil delete-process get-process] 6 "\n\n(fn ELM)"]] 15)) #@39 Preconfigured `helm' for top command. (defalias 'helm-top #[0 "\301\302\303\"\210\304\216\305\306\307\310\311\312\313\314\315\316\317\320&\f)\207" [helm-show-action-window-other-window add-hook helm-after-update-hook helm-top--skip-top-line #[0 "\300\301\302\"\207" [remove-hook helm-after-update-hook helm-top--skip-top-line] 3] helm :sources helm-source-top :buffer "*helm top*" :full-frame t :candidate-number-limit 9999 :preselect "^\\s-*[0-9]+" :truncate-lines] 13 (#$ . 15680) nil]) #@41 Preconfigured `helm' for Emacs process. (defalias 'helm-list-emacs-process #[0 "\300\301\302\"\207" [helm-other-buffer helm-source-emacs-process "*helm process*"] 3 (#$ . 16176) nil]) #@32 Preconfigured helm for xrandr. (defalias 'helm-xrandr-set #[0 "\300\301\302\303\304$\207" [helm :sources helm-source-xrandr-change-resolution :buffer "*helm xrandr*"] 5 (#$ . 16366) nil]) (provide 'helm-sys)