;ELC ;;; Compiled ;;; in Emacs version 26.3 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. ;;; This file does not contain utf-8 non-ASCII characters, ;;; and so can be loaded in Emacs versions earlier than 23. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301!\210\300\302!\207" [require cl-lib pp] 2) #@93 Non-nil if ShElisp mode is enabled. Use the command `shelisp-mode' to change this variable. (defvar shelisp-mode nil (#$ . 471)) (make-variable-buffer-local 'shelisp-mode) #@171 Enable elisp expressions embedded in ANSI APC (Application Program Control) escape sequences to be located and executed while in a shell mode buffer. (fn &optional ARG) (defalias 'shelisp-mode #[256 "\301 \302=\203 ?\202\303!\304V\211\204\305\306\307\"\210\202(\310\306\307\311#\210\312 \210\313\314\2032\315\2023\316\"\210\317\320!\203W\301 \203G\211\301 \232\203W\321\322\323\203R\324\202S\325#\266\210\326 \210\207" [shelisp-mode current-message toggle prefix-numeric-value 0 remove-hook comint-preoutput-filter-functions shelisp-exec-lisp add-hook append shelisp-add-commands run-hooks shelisp-mode-hook shelisp-mode-on-hook shelisp-mode-off-hook called-interactively-p any " in current buffer" message "ShElisp mode %sabled%s" "en" "dis" force-mode-line-update] 8 (#$ . 650) (byte-code "\206\301C\207" [current-prefix-arg toggle] 1)]) (defvar shelisp-mode-hook nil) (byte-code "\301\302N\204\f\303\301\302\304#\210\305\306\307\310\300!\205\311\211%\207" [shelisp-mode-map shelisp-mode-hook variable-documentation put "Hook run after entering or leaving `shelisp-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 shelisp-mode " ShElisp" boundp nil] 6) #@62 When non-nil, display messages showing the elisp expression. (defvar shelisp-debug nil (#$ . 1942)) #@62 Apply remote host in `default-directory' to FILE. (fn FILE) (defalias 'shelisp--file-name #[257 "\301!\203\302!\204\302!P\207\207" [default-directory file-name-absolute-p file-remote-p] 3 (#$ . 2048)]) #@125 Return RESULT as a string. If it already is a string, then just return it. Otherwise, convert it to a string. (fn RESULT) (defalias 'shelisp--result-as-string #[257 "\211\204\300\207\211;\203\f\207\301!\207" ["" pp-to-string] 3 (#$ . 2266)]) #@74 Detect escape sequence in STR to execute Emacs Lisp. (fn &optional STR) (defalias 'shelisp-exec-lisp #[256 "\203{\211\203{\303\304\305\306\307\310\260\311\211\311\312 \"\203x\313\314 \"\262\315\262\n\2034\316\317\"\210\320 \321\322\323\324\325!\326\"\327$\216\212\3301W\331\332\333\334\335!E\336\"!0\202^\337\340#\262*\262\262\341\211\315\230?\205m\342P\336\211 $\262\202)\266\207" [shelisp-mode case-fold-search shelisp-debug "\\(?:_\\|\237\\)" "#EMACS#" "\\(?:[\234]\\|[][\\\\]\\)" "\\(?:[^\234]\\|[^\\\\]\\)" "\\(" "*\\)" nil string-match match-string 1 "" message "shelisp> `%s'" match-data make-byte-code 0 "\301\300\302\"\207" vconcat vector [set-match-data evaporate] 3 (error) shelisp--result-as-string eval cl-flet ((f (file) (shelisp--file-name file))) read t format "shelisp: `%s': %S" replace-match "\n"] 16 (#$ . 2520) nil]) #@743 Alist of shell commands and corresponding Lisp expressions. Each entry in the alist consists of the shell alias to be set as the command, and the `printf' style string to generate the elisp expression to be executed. If a parameter to the elisp expression is a filename, then we need to be sure that proper filename parsing in context occurs. We do this by passing filename parameters through the elisp function `f'[1]. This function makes sure that filename has proper Tramp prefixes if the shell session is remote. So, rather than just embedding the filename in the elisp expression, using printf, with "\"%s\"", you use \=`(f \"%s\")\='. [1] The `f' function is `cl-flet' bound for the shelisp expression and cannot be used elsewhere. (defvar shelisp-commands (byte-code "\302\303\304!\203\f\305B\262\306\300!\203\204 \306\301!\203* \203*\307B\262\310B\262\211\207" [viper-mode evil-mode (("e" . "(find-file-other-window (f \"%s\"))") ("v" . "(view-file-other-window (f \"%s\"))") ("dired" . "(dired \"%s\")") ("ediff" . "(ediff (f \"%s\") (f \"%s\"))")) locate-library "magit" ("magit" . "(magit-status)") boundp ("vim" . "(find-file-other-window (f \"%s\"))") ("vi" . "(find-file-other-window (f \"%s\"))")] 3) (#$ . 3407)) #@60 Add Emacs Lisp to shell aliases (assumes GNU bash syntax). (defalias 'shelisp-add-commands #[0 "\205? \205?\302p! \211\2038\211@\211@A\303\304\305\306\307\310\311#\211\312\313\314\n# \211\257#\"\266A\266\202\202\f\210\303\315\"\262\207" [shelisp-mode shelisp-commands get-buffer-process process-send-string apply format mapconcat identity ("unset -f shelisp_%s" "function shelisp_%s { printf '\\e_#EMACS# %s \\a' \"$@\"; }" "alias %s=shelisp_%s" "") " ; " replace-regexp-in-string "\"" "\\\\\"" "\n"] 16 (#$ . 4659)]) (provide 'shelisp)