;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\207" [require subr-x org] 2) #@35 Default prefix of sysctl buffers. (defvar sysctl-buffer-prefix "sysctl" (#$ . 151)) #@109 Run shell commands ARGS and return output as a string, only exists as a TRAMP issue work around. (fn ARGS) (defalias 'sysctl--run-command #[257 "\301\302!)\207" [shell-file-name "/bin/sh" shell-command-to-string] 3 (#$ . 242)]) #@87 Run `sysctl' with the ARGS arguments, run with root if AS-ROOT is non-nil. (fn ARGS) (defalias 'sysctl-run #[257 "\300\301P!\207" [sysctl--run-command "sysctl "] 4 (#$ . 479)]) #@36 System-dependant sysctl separator. (defalias 'sysctl-separator #[0 "\300\301!\211\302\267\202 \303\207\304\207\305\207" [sysctl--run-command "uname -s" #s(hash-table size 2 test equal rehash-size 1.5 rehash-threshold 0.8125 purecopy t data ("OpenBSD\n" 9 "Linux\n" 11)) "=" " = " ": "] 3 (#$ . 664)]) #@79 Split LINE into key and value, splitting with SEPARATOR. (fn LINE SEPARATOR) (defalias 'sysctl-split-line #[514 "\300\211\301\302\303Q\"\205(\304 \305\306\"\216\307\310\311\"\312\"\262)\210\310\313\"\262B\207" [nil string-match "\\(^\\w+\\..*?\\)" "\\(.*\\)$" match-data make-closure #[0 "\301\300\302\"\207" [V0 set-match-data evaporate] 3] split-string match-string 1 "\\." 2] 9 (#$ . 972)]) #@51 Split LINES into lines, keys, values. (fn LINES) (defalias 'sysctl-split-lines #[257 "\300\301 \302\303\"\211\211\203$\211@\304\"\211\203\211B\262\210A\266\202\202\210\237\207" [nil sysctl-separator split-string "\n" sysctl-split-line] 9 (#$ . 1384)]) #@36 Set the current line to read-only. (defalias 'sysctl--readonly-previous-line #[0 "\300y\210\301 \302 \303=\203\303\202S\262\304\305#\210\306y\207" [-1 line-beginning-position line-end-position 1 set-text-properties (read-only t) nil] 6 (#$ . 1656)]) #@57 Turn LINES-LIST into an org hierarchy. (fn LINES-LIST) (defalias 'sysctl-construct-tree #[257 "\300\211\205F\211@\211@A\301\2035\211S8@\230\204*\302\303\"\304@\305Rc\210\306 \210A\262\211T\262\202 @\262\305Pc\266A\266\202\202\207" [nil 1 make-string 42 " " "\n" sysctl--readonly-previous-line] 11 (#$ . 1921)]) #@63 Construct path from the current leaf node on the sysctl tree. (defalias 'sysctl-construct-path #[0 "\212\300\301 ?\2055\302 \210\303\304\305\211\211\211$!C\262\306 \203*\303\304\305\211\211\211$!B\262\202\211\307\310\311#\266\202\260\262)\207" [nil org-at-heading-p outline-previous-heading substring-no-properties org-get-heading t org-up-heading-safe "." mapconcat identity] 7 (#$ . 2261)]) #@67 Construct a sysctl command from the current position in the tree. (defalias 'sysctl-construct-command #[0 "\212\300 \211\205 \301\302\303\304\"!\211\205\305Q\266\202)\207" [sysctl-construct-path string-trim thing-at-point line t "="] 5 (#$ . 2671)]) #@41 Return the system's super user command. (defalias 'sysctl-superuser-cmd #[0 "\300\301!\211\302\232\203 \303\207\304\207" [sysctl--run-command "uname -s" "OpenBSD\n" "doas" "sudo"] 3 (#$ . 2932)]) #@61 Construct the TRAMP path required to run a command as root. (defalias 'sysctl-construct-tramp #[0 "\301\302!\303\230\203\n\207\304\305\"\2039\306\307 \310\311\"\216\312\313\"\2057\314\315\"\262\312\316\"\210\314\315\"\317\320 \321\321\260)\207\322\320 \323Q\207" [default-directory sysctl--run-command "whoami" "root\n" string-prefix-p "/ssh" nil match-data make-closure #[0 "\301\300\302\"\207" [V0 set-match-data evaporate] 3] string-match ".*:\\(.+\\):" match-string 1 "\\(.*\\):[^:]+$" "|" sysctl-superuser-cmd ":" "/" "::"] 8 (#$ . 3135)]) #@58 Set the value of the current leaf on the tree in sysctl. (defalias 'sysctl-set-value #[0 "\301 \211\203\"\302\303\304Q!\203\305 \306\307\310!!!\210\311 )\207\306\312!\207\306\313!\207" [default-directory sysctl-construct-command y-or-n-p "Set " "?" sysctl-construct-tramp message string-trim sysctl-run sysctl-refresh-value "Not set." "The point must be on a value."] 5 (#$ . 3699) nil]) #@67 Get the current value for a certain leaf node in the sysctl tree. (defalias 'sysctl-refresh-value #[0 "\300 \211\205 \301!\211\205\302\303 \"A\211\203 \304 \305 |\210\211c\207\306\307!\205)\310\311!\207" [sysctl-construct-path sysctl-run sysctl-split-line sysctl-separator line-beginning-position line-end-position called-interactively-p interactive message "The point must be on a value."] 5 (#$ . 4099) nil]) #@45 Format sysctl buffer name for current host. (defalias 'sysctl-buffer-name #[0 "\302\303\"\211\203\304\305 #\207\304\305 \306 #\207" [default-directory sysctl-buffer-prefix file-remote-p host format "*%s %s*" system-name] 5 (#$ . 4523)]) (defvar sysctl-mode-map (byte-code "\300 \301\302\303#\210\301\304\305#\210\207" [make-sparse-keymap define-key "" sysctl-set-value " " sysctl-refresh-value] 5)) (defvar sysctl-mode-hook nil) (byte-code "\300\301N\204\f\302\300\301\303#\210\304\305!\204\302\305\306\307#\210\300\207" [sysctl-mode-hook variable-documentation put "Hook run after entering Sysctl mode.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" boundp sysctl-mode-map definition-name sysctl-mode] 4) (defvar sysctl-mode-map (make-sparse-keymap)) (byte-code "\301\302N\204\303\301\302\304\305!#\210\306\307!\204\303\307\310\311#\210\312\313 !\210\307\302N\204-\303\307\302\304\314!#\210\306\300!\204B\303\300\310\311#\210\315\316\300\317\"\210!\210\300\302N\204P\303\300\302\304\320!#\210\303\311\321\322#\207" [sysctl-mode-abbrev-table sysctl-mode-map variable-documentation put purecopy "Keymap for `sysctl-mode'." boundp sysctl-mode-syntax-table definition-name sysctl-mode (lambda (def-tmp-var) (defvar sysctl-mode-syntax-table def-tmp-var)) make-syntax-table "Syntax table for `sysctl-mode'." (lambda (def-tmp-var) (defvar sysctl-mode-abbrev-table def-tmp-var)) define-abbrev-table nil "Abbrev table for `sysctl-mode'." derived-mode-parent org-mode] 5) #@224 Mode for managing sysctl configs. In addition to any hooks its parent mode `org-mode' might have run, this mode runs the hook `sysctl-mode-hook', as the final or penultimate step during initialization. \{sysctl-mode-map} (defalias 'sysctl-mode #[0 "\306\300!\210\307\310 \210\311\312\310\313N\203\314\311\313\310\313N#\210\315 !\204'\316 \317 \"\210\320\f!\211\2035\211\321 =\203;\322\f\323 \"\210\210\324 \325\"\204R =\204R\326 \325C#\210\327 !\210\330\f!\210 )\331\332!\207" [delay-mode-hooks major-mode mode-name sysctl-mode-map sysctl-mode-syntax-table sysctl-mode-abbrev-table make-local-variable t org-mode sysctl-mode "Sysctl" mode-class put keymap-parent set-keymap-parent current-local-map char-table-parent standard-syntax-table set-char-table-parent syntax-table abbrev-table-get :parents abbrev-table-put use-local-map set-syntax-table run-mode-hooks sysctl-mode-hook local-abbrev-table] 5 (#$ . 6094) nil]) #@47 Construct an Org buffer from the sysctl tree. (defalias 'sysctl #[0 "\302\303 !\210\304\305 \210)\306\307\310\311!!!\210\312 \210 \205\313 \207" [inhibit-read-only flyspell-mode switch-to-buffer sysctl-buffer-name t erase-buffer sysctl-construct-tree sysctl-split-lines sysctl-run "-a" sysctl-mode flyspell-mode-off] 4 (#$ . 7038) nil]) (provide 'sysctl)