;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\300\303!\207" [require cl-lib files-x shell] 2) #@446 Implementation of connection-local vars to use. Possible values: - 'custom: with-shell-interpreter's implementation - 'native: native Emacs (>= 26.1) implementation When 'custom, configure var `with-shell-interpreter-connection-local-vars'. When 'native, configure vars `connection-local-profile-alist' and `connection-local-criteria-alist' with helper functions `connection-local-set-profile-variables' and `connection-local-set-profiles'. (defvar with-shell-interpreter-connection-local-vars-implem 'custom (#$ . 175)) #@570 Alist mapping connection path regexp to variable lists. It aims at providing a more flexible implementation of connection-local variables. Order of entries matter, only first matched variables are used. Use `add-to-list' to add entries. It only get interpreted for remote connections. For local connections, customize defautl values of vars: - `explicit-shell-file-name' / `shell-file-name' - `explicit-INTEPRETER-args' - `shell-command-switch' To read more about the standard connection-local variables see `with-shell-interpreter-connection-local-vars-implem'. (defvar with-shell-interpreter-connection-local-vars '((".*" (explicit-shell-file-name . "/bin/bash") (explicit-bash-args "-c" "export EMACS=; export TERM=dumb; stty echo; bash") (shell-command-switch . "-c"))) (#$ . 707)) (byte-code "\300\301!\203\302\303\301\"\210\202\302\303\304\"\210\305\306!\210\300\207" [fboundp hack-connection-local-variables defalias with-shell-interpreter--hack-connection-local-variables #[257 "\300\207" [nil] 2 "\n\n(fn C)"] boundp w32-quote-process-args] 3) #@2191 Eval :form at location described by :path with :interpreter binary. ARGS are in fact keywords, `with-shell-interpreter' being a macro wrapper around `with-shell-interpreter-eval'. Usage: (with-shell-interpreter [:keyword [option]]... :form ;; actual code ) :form Code to execute. :path Location from which form is executed. Can be local or remote (TRAMP format). Let-binds `default-directory'. :interpreter Name or absolute path of shell interpreter executable. If only providing a name, ensure that the executable is present in the PATH. Let-binds `explicit-shell-file-name' and `shell-file-name'. :interpreter-args Login args to call interpreter with for login. Let-binds `explicit-INTEPRETER-args'. Useful only for interactive shells. :command-switch Command switch arg for asking interpreter to run a shell command (e.g. "-c" in Bourne shell and most derivatives). Let-binds `shell-command-switch'. Useful only for single shell commands. :w32-arg-quote Only affecting Microsoft Windows build of Emacs. Character to use for quoting arguments. Let-binds `w32-quote-process-args'. :allow-local-vars Allow local values to have precedence over global ones for: - `explicit-shell-file-name' - `explicit-INTEPRETER-args' - `shell-command-switch' - `w32-quote-process-args' Value can be: - 'buffer: allow buffer-local vars values - 'connection: allow connection-local values - 'both: allow both types of local values - 'none: ignore all local values Default is 'connection. For more detailed instructions, have a look at https://github.com/p3r7/with-shell-interpreter/blob/master/README.md (fn &rest ARGS) (defalias 'with-shell-interpreter '(macro . #[128 "\300\301\302\303\304\305\301\"BE\306\307\306\"\310\307\310\"\311\307 \311\"\312\307 \312\"\313\307 \313\"\314\307\314\"\257\207" [with-shell-interpreter-eval :form lambda nil progn with-shell-interpreter--plist-get :path plist-get :interpreter :interpreter-args :command-switch :w32-arg-quote :allow-local-vars] 18 (#$ . 1778)])) (byte-code "\300\301\302\303#\304\301\305\306#\210\304\301\302\307#\207" [function-put with-shell-interpreter lisp-indent-function 1 put edebug-form-spec t defun] 5) #@168 Same as `with-shell-interpreter' except :form has to be a quoted sexp. (fn &key FORM PATH INTERPRETER INTERPRETER-ARGS COMMAND-SWITCH W32-ARG-QUOTE ALLOW-LOCAL-VARS) (defalias 'with-shell-interpreter-eval #[128 "\306\307\"A@\306\310\"A@\306\311\"A@\306\312\"A@\306\313\"A@\306\314\"A@\306\315\"A@\211\203Y\211@\316>\203A\211AA\262\202.\317 >A@\203P\320\262\202.\321\322@\"\210\202.\210\323#\211G\324U\203q\211A\262\242\202x\325\326\327GD\"\211A\262\242\211A\262\242\211A\262\242\211A\262\242\211A\262\242\320\211A\262 \210\242\330!\203\255\202\265\331\332\320E\"\333\n\n\n&\334 \n\n\n&\n\211\320\335\n   &#CC\336\337\"\320\203\211A\262\242\340\211A\262\242DDB\262\202\372\331\341\237\342\340DDE!\266\204.\207" [lexical-binding default-directory shell-file-name explicit-shell-file-name shell-command-switch enable-connection-local-variables plist-member :form :path :interpreter :interpreter-args :command-switch :w32-arg-quote :allow-local-vars (:form :path :interpreter :interpreter-args :command-switch :w32-arg-quote :allow-local-vars :allow-other-keys) :allow-other-keys nil error "Keyword argument %s not one of (:form :path :interpreter :interpreter-args :command-switch :w32-arg-quote :allow-local-vars)" with-shell-interpreter--generate-props 8 signal wrong-number-of-arguments (path is-remote allow-buffer-local-vars allow-cnnx-local-vars cnnx-local-vars interpreter interpreter-name explicit-interpreter-args-var) functionp eval lambda with-shell-interpreter--interpreter-args-value with-shell-interpreter--command-switch with-shell-interpreter--w32-quote-process-args make-closure #[0 "\300 \207" [V0] 1] quote let funcall w32-quote-process-args] 30 (#$ . 4533)]) #@49 Normalize PATH, converting \ into /. (fn PATH) (defalias 'with-shell-interpreter--normalize-path #[257 "\300\301\302#\207" [subst-char-in-string 92 47] 5 (#$ . 6326)]) #@65 Extracts INTERPRETER name, keeping extension. (fn INTERPRETER) (defalias 'with-shell-interpreter--interpreter-name #[257 "\300!\207" [file-name-nondirectory] 3 (#$ . 6502)]) #@137 Extract value of property PROP from property list PLIST. Like `plist-get' except allows value to be multiple elements. (fn PLIST PROP) (defalias 'with-shell-interpreter--plist-get #[514 "\205Q\300\300\211:\203M@\262\203!\301!\203!=\203M\2033\301!\2043B\262\202F\204F\301!\203F=\203F\302\262A\262\202\211\237\266\204\207" [nil keywordp t] 8 (#$ . 6685)]) #@78 Return (FN x) for the first LIST item where (FN x) is non-nil. (fn FN LIST) (defalias 'with-shell-interpreter--some #[514 "\300\211\204@!\262A\262\202\207" [nil] 5 (#$ . 7080)]) #@166 Return the value of SYM in current buffer. If ALLOW-BUFFER-LOCAL is nil, always return global value (never buffer-local one). (fn SYM &optional ALLOW-BUFFER-LOCAL) (defalias 'with-shell-interpreter--symbol-value #[513 "\211\204\3001 \301!0\207\210\302\207J\207" [(error) default-value nil] 4 (#$ . 7275)]) #@92 Return t if SYMBOL has a buffer-local value. Even works if it's value is nil. (fn SYMBOL) (defalias 'with-shell-interpreter--boundp-buffer-local #[257 "\300\301 \"\207" [assoc buffer-local-variables] 4 (#$ . 7593)]) #@48 Get connection-local vars for PATH. (fn PATH) (defalias 'with-shell-interpreter--cnnx-local-vars #[257 "\301=\203\n\302!\207\303!\207" [with-shell-interpreter-connection-local-vars-implem custom with-shell-interpreter--cnnx-local-vars-custom with-shell-interpreter--cnnx-local-vars-native] 3 (#$ . 7817)]) #@57 Get connection-local vars for PATH (custom). (fn PATH) (defalias 'with-shell-interpreter--cnnx-local-vars-custom #[257 "\301!\205 \302\303\304\"\"\207" [with-shell-interpreter-connection-local-vars file-remote-p with-shell-interpreter--some make-closure #[257 "\211@A\301\300\"\205\f\211\207" [V0 string-match] 6 "\n\n(fn E)"]] 5 (#$ . 8134)]) #@57 Get connection-local vars for PATH (native). (fn PATH) (defalias 'with-shell-interpreter--cnnx-local-vars-native #[257 "\301!\2055\302\303\304\305\"r\211q\210\306\307\"\216\310\311\312\313\301\314\"\315\301 \316\"\317\301 \320\"\257!\210\262*\210\211\262\207" [connection-local-variables-alist file-remote-p nil generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] with-shell-interpreter--hack-connection-local-variables :application tramp :protocol method :user user :machine host] 14 (#$ . 8492)]) #@536 Determine value of shell interpreter. Use INPUT-VALUE if not empty, else fallback to default values, depending on CNNX-LOCAL-VARS and whether: - IS-REMOTE or not - ALLOW-BUFFER-LOCAL-VARS or not - ALLOW-CNNX-LOCAL-VARS or not The order of precedence is like so: - input value - buffer-local value (if ALLOW-BUFFER-LOCAL-VARS is t) - connection-local value (if ALLOW-CNNX-LOCAL-VARS is t) - default remote value - global value (fn IS-REMOTE &optional ALLOW-BUFFER-LOCAL-VARS ALLOW-CNNX-LOCAL-VARS CNNX-LOCAL-VARS INPUT-VALUE) (defalias 'with-shell-interpreter--interpreter-value #[1281 "\300\206d\203\301\302!\203\303\302\304\"\206d\203'\301\305!\203'\303\305\304\"\206d\203=\203=\306\302\"\206d\306\305\"\206d\3071I\303\302\310\"0\202M\210\202P\206d\3111\\\303\305\310\"0\202`\210\202c\206d\312!\207" [with-shell-interpreter--normalize-path with-shell-interpreter--boundp-buffer-local explicit-shell-file-name with-shell-interpreter--symbol-value t shell-file-name alist-get (error) nil (error) "/usr/bin/sh"] 9 (#$ . 9070)]) #@666 Determine value of shell interpreter. Use INPUT-VALUE if not empty, else fallback to default values, depending on ARGS-VAR-NAME, INTERPRETER, CNNX-LOCAL-VARS and whether: - IS-REMOTE or not - ALLOW-BUFFER-LOCAL-VARS or not - ALLOW-CNNX-LOCAL-VARS or not The order of precedence is like so: - input value - buffer-local value (if ALLOW-BUFFER-LOCAL-VARS is t) - connection-local value (if ALLOW-CNNX-LOCAL-VARS is t) - default remote value (if INTERPRETER is default remote interpreter) - global value - universal fallback value (fn IS-REMOTE ARGS-VAR-NAME INTERPRETER &optional ALLOW-BUFFER-LOCAL-VARS ALLOW-CNNX-LOCAL-VARS CNNX-LOCAL-VARS INPUT-VALUE) (defalias 'with-shell-interpreter--interpreter-args-value #[1795 "\211\206O\203\300!\203\301\302\"\206O\203:\203:\303\304\"\230\2042\303\305\"\230\203:\303\"\206O\3061G\301\307\"0\202K\210\202N\206O\310\207" [with-shell-interpreter--boundp-buffer-local with-shell-interpreter--symbol-value t alist-get explicit-shell-file-name shell-file-name (error) nil ("-i")] 11 (#$ . 10141)]) #@640 Determine value of shell command switch. Use INPUT-VALUE if not empty, else fallback to default values, depending on INTERPRETER, CNNX-LOCAL-VARS and whether: - IS-REMOTE or not - ALLOW-BUFFER-LOCAL-VARS or not - ALLOW-CNNX-LOCAL-VARS or not The order of precedence is like so: - input value - buffer-local value (if ALLOW-BUFFER-LOCAL-VARS is t) - connection-local value (if ALLOW-CNNX-LOCAL-VARS is t) - default remote value (if INTERPRETER is default remote interpreter) - global value - universal fallback value (fn IS-REMOTE INTERPRETER &optional ALLOW-BUFFER-LOCAL-VARS ALLOW-CNNX-LOCAL-VARS CNNX-LOCAL-VARS INPUT-VALUE) (defalias 'with-shell-interpreter--command-switch #[1538 "\211\206J\203\300\301!\203\302\301\303\"\206J\2036\2036\304\305\"\230\204/\304\306\"\230\2036\304\301\"\206J\3071B\302\301\310\"0\202F\210\202I\206J\311\207" [with-shell-interpreter--boundp-buffer-local shell-command-switch with-shell-interpreter--symbol-value t alist-get explicit-shell-file-name shell-file-name (error) nil "-c"] 10 (#$ . 11226)]) #@541 Determine value of shell command switch. Use INPUT-VALUE if not empty, else fallback to default values, depending on INTERPRETER, CNNX-LOCAL-VARS and whether: - IS-REMOTE or not - ALLOW-BUFFER-LOCAL-VARS or not - ALLOW-CNNX-LOCAL-VARS or not The order of precedence is like so: - input value - buffer-local value (if ALLOW-BUFFER-LOCAL-VARS is t) - connection-local value (if ALLOW-CNNX-LOCAL-VARS is t) - global value (fn IS-REMOTE INTERPRETER &optional ALLOW-BUFFER-LOCAL-VARS ALLOW-CNNX-LOCAL-VARS CNNX-LOCAL-VARS INPUT-VALUE) (defalias 'with-shell-interpreter--w32-quote-process-args #[1538 "\211\206B\203\300\301!\203\302\301\303\"\206B\2036\2036\304\305\"\230\204/\304\306\"\230\2036\304\307\"\206B\3101@\302\301\311\"0\207\210\311\207" [with-shell-interpreter--boundp-buffer-local w32-quote-process-args with-shell-interpreter--symbol-value t alist-get explicit-shell-file-name shell-file-name shell-command-switch (error) nil] 10 (#$ . 12303)]) #@190 Generate several usefull variable values from PATH, INTERPRETER and ALLOW-LOCAL-VARS. This function exists to be reused by package `friendly-shell'. (fn PATH INTERPRETER ALLOW-LOCAL-VARS) (defalias 'with-shell-interpreter--generate-props #[771 "\204\262\301!\204\302\303\"\210\304!\206\305\211\306>\307>\310!\311 %\312!\313\314\315Q!\n\257\207" [default-directory file-exists-p error "Path %s doesn't seem to exist" file-remote-p connection (buffer both) (connection both) with-shell-interpreter--cnnx-local-vars with-shell-interpreter--interpreter-value with-shell-interpreter--interpreter-name intern "explicit-" "-args"] 19 (#$ . 13293)]) (provide 'with-shell-interpreter)