mirror of https://github.com/Chizi123/.emacs.d.git

Chizi123
2018-11-18 76bbd07de7add0f9d13c6914f158d19630fe2f62
commit | author | age
5cb5f7 1 ;ELC
C 2 ;;; Compiled
3 ;;; in Emacs version 26.1
4 ;;; with all optimizations.
5
6 ;;; This file uses dynamic docstrings, first added in Emacs 19.29.
7
8 ;;; This file does not contain utf-8 non-ASCII characters,
9 ;;; and so can be loaded in Emacs versions earlier than 23.
10
11 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
12 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
13
14
15 (byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\210\305\306\307\310\311\302%\210\312\313\314\315\311\306%\210\316\317\320\321\322DD\323\311\306\324\325&\210\316\326\320\321\327DD\330\311\306\324\331&\210\316\332\320\321\333DD\334\311\306\324\335&\210\316\336\320\321\337DD\340\311\306\324\335&\210\316\341\320\321\342DD\343\311\306\324\344&\207" [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 :inherit helm-header)) "Face for helm help string in minibuffer." custom-declare-variable helm-top-command funcall function #[0 "\301\267\202\302\207\303\207" [system-type #s(hash-table size 1 test eql rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (darwin 6)) "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) is needed.\nOn Mac OSX 'top' command doesn't support this, so ps command\nis used instead by default.\nNormally 'top' command output have 12 columns, but in some versions you may\nhave less than this, so you can either customize top to use 12 columns with the\ninteractives 'f' and 'W' commands of top, or modify\n`helm-top-sort-columns-alist' to fit with the number of columns\nyour 'top' command is using.\n\nIf you modify 'ps' command be sure that 'pid' comes in first\nand \"env COLUMNS=%s\" is specified at beginning of command.\nEnsure also that no elements contain spaces (e.g use start_time and not start).\nSame as for 'top' you can customize `helm-top-sort-columns-alist' to make sort commands\nworking properly 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 additioned to `helm-top-poll-delay' after emacs stop\nbeing idle." helm-top-poll-preselection #[0 "\300\207" [linum] 1] "Stay on same line or follow candidate when `helm-top-poll' update display.\nPossible values are 'candidate or 'linum.\nThis affect 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)
16 (defvar helm-top-sort-fn nil)
17 (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\211\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))
18 #@26 Local hook for helm-top.
19 (defvar helm-top-after-init-hook nil (#$ . 3813))
20 (defvar helm-top--poll-timer nil)
21 #@34 
22
23 (fn &optional NO-UPDATE DELAY)
24 (defalias 'helm-top-poll #[512 "\203\302!\210\3031k\304 \203G\204G\305\306    \307\"\203*\310\311\211\312\313\314\315\"!#\202E\306    \316\"\203<\317\314\320\321\322 DF\202E\323\324    \325#\205E\314!\210\326\327 \211\203\\\330\331\206W\332 !\"\202b\206b\332 \262\314\333#\2110\207\210\302!\207" [helm-top--poll-timer helm-top-poll-preselection cancel-timer (quit) helm--alive-p helm-force-update eql candidate replace-regexp-in-string "[0-9]+" regexp-quote helm-get-selection nil t linum 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 (#$ . 3928)])
25 (defalias 'helm-top--poll-delay #[0 "\301]\207" [helm-top-poll-delay 1.5] 2])
26 (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])
27 (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])
28 (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 :group helm-top :type boolean] 12)
29 #@73 Refresh automatically helm top buffer once enabled.
30
31 (fn &optional ARG)
32 (defalias 'helm-top-poll-mode #[256 "\301 \302\300\303=\203\304\300!?\202\305!\306V\"\210\203)\307\310\311\"\210\307\310\312\"\210\2023\313\310\311\"\210\313\310\312\"\210\314\315\304\300!\203?\316\202@\317\"\210\320\321!\203j\322\300!\210\301 \203X\211\301 \232\203j\323\324\325\304\300!\203e\326\202f\327#\266\210\330 \210\304\300!\207" [helm-top-poll-mode current-message set-default toggle default-value prefix-numeric-value 0 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] 7 (#$ . 5630) (byte-code "\206\301C\207" [current-prefix-arg toggle] 1)])
33 (defvar helm-top-poll-mode-hook nil)
34 (byte-code "\301\302N\204\f\303\301\302\304#\210\305\306\307\310\300!\205\307\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.)" add-minor-mode helm-top-poll-mode nil boundp] 6)
35 (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))
36 (defvar helm-top--line nil)
37 #@100 Transformer for `helm-top'.
38 Return empty string for non--valid candidates.
39
40 (fn CANDIDATES SOURCE)
41 (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 (#$ . 7838)])
42 (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 \262\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])
43 #@100 Action transformer for `top'.
44 Show actions only on line starting by a PID.
45
46 (fn ACTIONS CANDIDATE)
47 (defalias 'helm-top-action-transformer #[514 "\300\301\302\"\303\304\"\203\305\306\307\310F\202\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 (#$ . 8548)])
48 (defalias 'helm-top--marked-pids #[0 "\300\301\302 \"\207" [helm-remove-if-not-match "\\`[0-9]+\\'" helm-marked-candidates] 3])
49 #@79 Run kill shell command with signal SIG on PIDS for `helm-top'.
50
51 (fn SIG PIDS)
52 (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 (#$ . 9593)])
53 #@12 
54
55 (fn PID)
56 (defalias 'helm-top-sh-persistent-action #[257 "\300\301C\"\210\302 \207" [helm-top-sh "TERM" helm-delete-current-selection] 4 (#$ . 9906)])
57 #@51 Insert output of top command in candidate buffer.
58 (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 (#$ . 10065)])
59 #@39 Return pid only from LINE.
60
61 (fn LINE)
62 (defalias 'helm-top-display-to-real #[257 "\300!@\207" [split-string] 3 (#$ . 10462)])
63 #@12 
64
65 (fn STR)
66 (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 (#$ . 10594)])
67 #@26 
68
69 (fn CANDIDATES SOURCE)
70 (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 (#$ . 10835)])
71 #@14 
72
73 (fn S1 S2)
74 (defalias 'helm-top-sort-by-com #[514 "\301!\301!\302\236A\21188\231\207" [helm-top-sort-columns-alist split-string com] 9 (#$ . 11151)])
75 #@14 
76
77 (fn S1 S2)
78 (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 (#$ . 11316)])
79 #@14 
80
81 (fn S1 S2)
82 (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 (#$ . 11502)])
83 #@14 
84
85 (fn S1 S2)
86 (defalias 'helm-top-sort-by-user #[514 "\301!\301!\302\236A\21188\231\207" [helm-top-sort-columns-alist split-string user] 9 (#$ . 11688)])
87 (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])
88 (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])
89 (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])
90 (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])
91 (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])
92 #@72 Return a pair with current X screen number and current X display name.
93 (defalias 'helm-xrandr-info #[0 "\300\301!r\211q\210\302\303\304\305\306!\307\"\310$\216\311\312\313p\313\314%\210\313\211eb\210\212\315\316\313\317#\203.\320\310!\262)\315\321\313\317#\203<\320\322!\262D\266\202*\207" [generate-new-buffer " *temp*" make-byte-code 0 "\301\300!\205    \302\300!\207" vconcat vector [buffer-name kill-buffer] 2 call-process "xrandr" nil "--current" re-search-forward "\\(^Screen \\)\\([0-9]\\):" t match-string "^\\(.*\\) connected" 1] 7 (#$ . 12924)])
94 #@33 Return current X screen number.
95 (defalias 'helm-xrandr-screen #[0 "\300 @\207" [helm-xrandr-info] 1 (#$ . 13491)])
96 #@32 Return current X display name.
97 (defalias 'helm-xrandr-output #[0 "\300 A@\207" [helm-xrandr-info] 1 (#$ . 13612)])
98 (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!r\211q\210\302\303\304\305\306!\307\"\310$\216\311\312\313p\313\314\315 \316&\210\317b\210\313\211\320\321\313\322#\203@\323\317!\262\235\204$\211C\244\262\202$\262*\207" [generate-new-buffer " *temp*" make-byte-code 0 "\301\300!\205    \302\300!\207" vconcat vector [buffer-name kill-buffer] 2 call-process "xrandr" nil "--screen" helm-xrandr-screen "-q" 1 re-search-forward "   \\([0-9]+x[0-9]+\\)" t 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))
99 (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))
100 #@39 Preconfigured `helm' for top command.
101 (defalias 'helm-top #[0 "\302\303\304\"\210\305 \306\307\310\311\312!\313\"\314$\216\204\315 \210\316\216\317\320\321\322\323\324\325\326\327\330\331\332    &\f*\207" [helm-alive-p helm-show-action-window-other-window add-hook helm-after-update-hook helm-top--skip-top-line current-window-configuration make-byte-code 0 "\301\300!\207" vconcat vector [set-window-configuration] 2 delete-other-windows #[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] 14 (#$ . 15227) nil])
102 #@41 Preconfigured `helm' for emacs process.
103 (defalias 'helm-list-emacs-process #[0 "\300\301\302\"\207" [helm-other-buffer helm-source-emacs-process "*helm process*"] 3 (#$ . 15921) nil])
104 #@32 Preconfigured helm for xrandr.
105 (defalias 'helm-xrandr-set #[0 "\300\301\302\303\304$\207" [helm :sources helm-source-xrandr-change-resolution :buffer "*helm xrandr*"] 5 (#$ . 16111) nil])
106 (provide 'helm-sys)