;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\207" [require comint shen-mode] 2) #@228 *What not to save on inferior Shen's input history. Input matching this regexp is not saved on the input history in Inferior Shen mode. Default is whitespace followed by 0 or 1 single-letter colon-keyword (as in :a, :c, etc.) (defvar inferior-shen-filter-regexp "\\`\\s *\\(:\\(\\w\\|\\s_\\)\\)?\\s *\\'" (#$ . -158)) (defvar inferior-shen-mode-map nil) (byte-code "\2042\303 !\304\305\306#\210\304\307\310#\210\304\311\312#\210\304\313\314#\210\304\315\316#\210\304\317\320#\210\304\321\322#\210\304\n\323\324#\210\304\n\305\306#\210\304\n\325\324#\210\304\n\326\327#\210\304\n\330\331#\210\304\n\332\333#\210\304\n\307\310#\210\304\n\311\312#\210\304\n\313\314#\210\304\n\315\316#\210\304\n\317\320#\210\304\n\321\322#\207" [inferior-shen-mode-map comint-mode-map shen-mode-map copy-keymap define-key "" shen-eval-last-sexp "\f" shen-load-file " " shen-compile-file "" shen-show-arglist "" shen-describe-sym "" shen-show-function-documentation "" shen-show-variable-documentation "\230" shen-eval-defun "" "" shen-eval-region "" shen-compile-defun "" switch-to-shen] 4) (defalias 'inferior-shen-install-letter-bindings #[nil "\302\303\304#\210\302\305\306#\210\302\307\310#\210\302\311\312#\210\302\313\314#\210\302\315\316#\210\302\317\320#\210\302\321\322#\210\302\323\324#\210\302\325\326#\210\302 \313\314#\210\302 \315\316#\210\302 \317\320#\210\302 \321\322#\210\302 \323\324#\210\302 \325\326#\207" [shen-mode-map inferior-shen-mode-map define-key "e" shen-eval-defun-and-go "r" shen-eval-region-and-go "c" shen-compile-defun-and-go "z" switch-to-shen "l" shen-load-file "k" shen-compile-file "a" shen-show-arglist "d" shen-describe-sym "f" shen-show-function-documentation "v" shen-show-variable-documentation] 4]) #@74 *Program name for invoking an inferior Shen with for Inferior Shen mode. (defvar inferior-shen-program "shen" (#$ . -1940)) #@425 *Format-string for building a Shen expression to load a file. This format string should use `%s' to substitute a file name and should result in a Shen expression that will command the inferior Shen to load that file. The default works acceptably on most Shens. The string "(progn (load \"%s\" :verbose nil :print t) (values))\n" produces cosmetically superior output for this application, but it works only in Common Shen. (defvar inferior-shen-load-command "(load \"%s\")\n" (#$ . -2071)) #@491 Regexp to recognise prompts in the Inferior Shen mode. Defaults to "^[^> \n]*>+:? *", which works pretty good for Lucid, kcl, and franz. This variable is used to initialize `comint-prompt-regexp' in the Inferior Shen buffer. This variable is only used if the variable `comint-use-prompt-regexp-instead-of-fields' is non-nil. More precise choices: Lucid Common Shen: "^\\(>\\|\\(->\\)+\\) *" franz: "^\\(->\\|<[0-9]*>:\\) *" kcl: "^>+ *" This is a fine thing to set in your .emacs file. (defvar inferior-shen-prompt "^[^> \n]*>+:? *" (#$ . 2569)) #@1666 *The current inferior-shen process buffer. MULTIPLE PROCESS SUPPORT =========================================================================== To run multiple Shen processes, you start the first up with \[inferior-shen]. It will be in a buffer named `*inferior-shen*'. Rename this buffer with \[rename-buffer]. You may now start up a new process with another \[inferior-shen]. It will be in a new buffer, named `*inferior-shen*'. You can switch between the different process buffers with \[switch-to-buffer]. Commands that send text from source buffers to Shen processes -- like `shen-eval-defun' or `shen-show-arglist' -- have to choose a process to send to, when you have more than one Shen process around. This is determined by the global variable `inferior-shen-buffer'. Suppose you have three inferior Shens running: Buffer Process foo inferior-shen bar inferior-shen<2> *inferior-shen* inferior-shen<3> If you do a \[shen-eval-defun] command on some Shen source code, what process do you send it to? - If you're in a process buffer (foo, bar, or *inferior-shen*), you send it to that process. - If you're in some other buffer (e.g., a source file), you send it to the process attached to buffer `inferior-shen-buffer'. This process selection is performed by function `inferior-shen-proc'. Whenever \[inferior-shen] fires up a new process, it resets `inferior-shen-buffer' to be the new process's buffer. If you only run one process, this does the right thing. If you run multiple processes, you can change `inferior-shen-buffer' to another process buffer with \[set-variable]. (defvar inferior-shen-buffer nil (#$ . -3127)) #@43 *Hook for customising Inferior Shen mode. (defvar inferior-shen-mode-hook nil (#$ . -4845)) (put 'inferior-shen-mode 'mode-class 'special) #@1824 Major mode for interacting with an inferior Shen process. Runs a Shen interpreter as a subprocess of Emacs, with Shen I/O through an Emacs buffer. Variable `inferior-shen-program' controls which Shen interpreter is run. Variables `inferior-shen-prompt', `inferior-shen-filter-regexp' and `inferior-shen-load-command' can customize this mode for different Shen interpreters. For information on running multiple processes in multiple buffers, see documentation for variable `inferior-shen-buffer'. \{inferior-shen-mode-map} Customisation: Entry to this mode runs the hooks on `comint-mode-hook' and `inferior-shen-mode-hook' (in that order). You can send text to the inferior Shen process from other buffers containing Shen source. switch-to-shen switches the current buffer to the Shen process buffer. shen-eval-defun sends the current defun to the Shen process. shen-compile-defun compiles the current defun. shen-eval-region sends the current region to the Shen process. shen-compile-region compiles the current region. Prefixing the shen-eval/compile-defun/region commands with a \[universal-argument] causes a switch to the Shen process buffer after sending the text. Commands: Return after the end of the process' output sends the text from the end of process to point. Return before the end of the process' output copies the sexp ending at point to the end of the process' output, and sends it. Delete converts tabs to spaces as it moves back. Tab indents for Shen; with argument, shifts rest of expression rigidly with the current line. C-M-q does Tab on each line starting within following expression. Paragraphs are separated only by blank lines. Semicolons start comments. If you accidentally suspend your process, use \[comint-continue-subjob] to continue it. (defalias 'inferior-shen-mode #[nil "\306 \210\307\300!\210\310 \311\312\313\314!\210\315\316\317\320!\207" [font-lock-defaults inferior-shen-prompt comint-prompt-regexp major-mode mode-name mode-line-process comint-mode make-local-variable (shen-font-lock-keywords) inferior-shen-mode "Inferior Shen" (":%s") use-local-map shen-get-old-input shen-input-filter run-hooks inferior-shen-mode-hook inferior-shen-mode-map comint-get-old-input comint-input-filter] 2 (#$ . 4992) nil]) #@54 Return a string containing the sexp ending at point. (defalias 'shen-get-old-input #[nil "\212`\301 \210`{*\207" [end backward-sexp] 2 (#$ . 7312)]) #@56 t if STR does not match `inferior-shen-filter-regexp'. (defalias 'shen-input-filter #[(str) "\302 \"?\207" [inferior-shen-filter-regexp str string-match] 3 (#$ . 7469)]) #@420 Run an inferior Shen process, input and output via buffer `*inferior-shen*'. If there is a process already running in `*inferior-shen*', just switch to that buffer. With argument, allows you to edit the command line (default is value of `inferior-shen-program'). Runs the hooks from `inferior-shen-mode-hook' (after the `comint-mode-hook' is run). (Type \[describe-mode] in the process buffer for a list of commands.) (defalias 'inferior-shen #[(cmd) "\303\304!\204\305!\306\307\310 @\311 A%q\210\312 \210)\304\313\304!\207" [cmd cmdlist inferior-shen-buffer comint-check-proc "*inferior-shen*" split-string apply make-comint "inferior-shen" nil inferior-shen-mode pop-to-buffer] 6 (#$ . 7647) (list (if current-prefix-arg (read-string "Run shen: " inferior-shen-program) inferior-shen-program))]) (byte-code "\300\301\302\"\210\303\304\305\306#\207" [defalias run-shen inferior-shen custom-declare-variable shen-pre-eval-hook 'nil "Hook to run on code before sending it to the inferior-shen-process.\nFunctions on this hook will be called with an active region\ncontaining the shen source code about to be evaluated."] 4) #@66 Add functions defined between START and END to `shen-functions'. (defalias 'shen-remember-functions #[(start end) "\306\307 \212b\210\310\311 \n\312#\205/\313\314\315!!\316\314\317!!\316\314\320!!\321\322 \fE\"\210+\202 *\"\207" [start re end type doc name flet (clean (text) (when text (set-text-properties 0 (length text) nil text) text)) "^(define[ ]+\\(.+\\)[\n ]\\([ ]*\\\\\\*[ ]*\\([^]+?\\)[ ]*\\*\\\\\\)?[\n ]?[ ]*\\({\\(.+\\)}\\)?" re-search-forward t intern match-string 1 clean 3 5 add-to-list shen-functions] 7 (#$ . 8782) "r"]) (add-hook 'shen-pre-eval-hook 'shen-remember-functions) #@50 Check if parentheses in the region are balanced. (defalias 'check-balanced-parens #[(start end) "\214\212\304\3051 \n}\210eb\210`\306 Z\307U\203\3100\202#\311\312\313\")+\207" [deactivate-mark start end c nil (scan-error) forward-list 0 t signal scan-error ("Parentheses not balanced.")] 3 (#$ . 9398)]) (add-hook 'shen-pre-eval-hook #[(start end) "\3031\n\304 \"0\207\305\306\307\310\n!\"!?\205\311\312\n\")\207" [start end err (error) check-balanced-parens y-or-n-p format "%s Eval anyway ?" error-message-string signal scan-error] 5]) #@115 Send the current region to the inferior Shen process. Prefix argument means switch to the Shen buffer afterwards. (defalias 'shen-eval-region #[(start end &optional and-go) "\306\307\310 !!\311\312\313\n #\210\314\310 \n #\210\315\310 \316\"\210\317\310 !\210\320\321!\210\212\fq\210 b\210`\322 {\323\324\"\210\307\310 !b\210) \203E\325\326!\210*\207" [result before-input start end inferior-shen-buffer and-go marker-position process-mark inferior-shen-proc nil run-hook-with-args shen-pre-eval-hook comint-send-region comint-send-string "\n" accept-process-output sit-for 0 point-at-eol message "%s" switch-to-shen t] 4 (#$ . 9955) "r\nP"]) #@114 Send the current defun to the inferior Shen process. Prefix argument means switch to the Shen buffer afterwards. (defalias 'shen-eval-defun #[(&optional and-go) "\303\212\304 \210\305\303x\210`\306 \210\307` \"*\n\203\310\311!\210)\207" [result end and-go nil end-of-defun " \n \f" beginning-of-defun shen-eval-region switch-to-shen t] 3 (#$ . 10611) "P"]) #@114 Send the previous sexp to the inferior Shen process. Prefix argument means switch to the Shen buffer afterwards. (defalias 'shen-eval-last-sexp #[(&optional and-go) "\301\212\302 \210`)`#\207" [and-go shen-eval-region backward-sexp] 4 (#$ . 10982) "P"]) #@118 Compile the current region in the inferior Shen process. Prefix argument means switch to the Shen buffer afterwards. (defalias 'shen-compile-region #[(start end &optional and-go) "\303\304 \305\306 {\"\"\210\n\205\307\310!\207" [start end and-go comint-send-string inferior-shen-proc format "(funcall (compile nil `(lambda () (progn 'compile %s))))\n" switch-to-shen t] 6 (#$ . 11244) "r\nP"]) #@117 Compile the current defun in the inferior Shen process. Prefix argument means switch to the Shen buffer afterwards. (defalias 'shen-compile-defun #[(&optional and-go) "\212\302 \210\303\304x\210`\305 \210\306`\"\210* \205\307\310!\207" [e and-go end-of-defun " \n \f" nil beginning-of-defun shen-compile-region switch-to-shen t] 3 (#$ . 11648) "P"]) #@95 Switch to the inferior Shen process buffer. With argument, positions cursor at end of buffer. (defalias 'switch-to-shen #[(eob-p) "\304!\203 \206\305\306\"\307!\210)\202\310\n!\210 \205$\311 \210db\207" [inferior-shen-buffer pop-up-frames inferior-shen-program eob-p get-buffer-process get-buffer-window t pop-to-buffer run-shen push-mark] 3 (#$ . 12009) "P"]) #@73 Send the current region to the inferior Shen, and switch to its buffer. (defalias 'shen-eval-region-and-go #[(start end) "\302 \303#\207" [start end shen-eval-region t] 4 (#$ . 12387) "r"]) #@72 Send the current defun to the inferior Shen, and switch to its buffer. (defalias 'shen-eval-defun-and-go #[nil "\300\301!\207" [shen-eval-defun t] 2 (#$ . 12584) nil]) #@76 Compile the current region in the inferior Shen, and switch to its buffer. (defalias 'shen-compile-region-and-go #[(start end) "\302 \303#\207" [start end shen-compile-region t] 4 (#$ . 12758) "r"]) #@75 Compile the current defun in the inferior Shen, and switch to its buffer. (defalias 'shen-compile-defun-and-go #[nil "\300\301!\207" [shen-compile-defun t] 2 (#$ . 12964) nil]) #@187 Record last directory and file used in loading or compiling. This holds a cons cell of the form `(DIRECTORY . FILE)' describing the last `shen-load-file' or `shen-compile-file' command. (defvar shen-prev-l/c-dir/file nil (#$ . 13148)) #@251 *Used to determine if a buffer contains Shen source code. If it's loaded into a buffer that is in one of these major modes, it's considered a Shen source file by `shen-load-file' and `shen-compile-file'. Used by these commands to determine defaults. (defvar shen-source-modes '(shen-mode) (#$ . -13390)) #@50 Load a Shen file into the inferior Shen process. (defalias 'shen-load-file #[(file-name) "\303!\210\304!\305!B\306\307 \310\n\"\"\210\311\312!\207" [file-name shen-prev-l/c-dir/file inferior-shen-load-command comint-check-source file-name-directory file-name-nondirectory comint-send-string inferior-shen-proc format switch-to-shen t] 5 (#$ . 13700) (comint-get-source "Load Shen file: " shen-prev-l/c-dir/file shen-source-modes nil)]) #@51 Compile a Shen file in the inferior Shen process. (defalias 'shen-compile-file #[(file-name) "\302!\210\303!\304!B\305\306 \307\310Q\"\210\311\312!\207" [file-name shen-prev-l/c-dir/file comint-check-source file-name-directory file-name-nondirectory comint-send-string inferior-shen-proc "(compile-file \"" "\")\n" switch-to-shen t] 5 (#$ . 14147) (comint-get-source "Compile Shen file: " shen-prev-l/c-dir/file shen-source-modes nil)]) #@64 Command to query inferior Shen for a function's documentation. (defvar shen-function-doc-command "(let ((fn '%s))\n (format t \"Documentation for ~a:~&~a\"\n fn (documentation fn 'function))\n (values))\n" (#$ . 14595)) #@64 Command to query inferior Shen for a variable's documentation. (defvar shen-var-doc-command "(let ((v '%s))\n (format t \"Documentation for ~a:~&~a\"\n v (documentation v 'variable))\n (values))\n" (#$ . 14834)) #@58 Command to query inferior Shen for a function's arglist. (defvar shen-arglist-command "(let ((fn '%s))\n (format t \"Arglist for ~a: ~a\" fn (arglist fn))\n (values))\n" (#$ . 15065)) #@64 Command to query inferior Shen for a variable's documentation. (defvar shen-describe-sym-command "(describe '%s)\n" (#$ . 15263)) (defalias 'shen-symprompt #[(prompt default) "\203\f\303\304 #\202 \305P\306 !\211G\307U\203\202 \n*C\207" [default prompt ans format "%s (default %s): " ": " read-string 0] 5]) #@101 Returns the name of the function called in the current call. The value is nil if it can't find one. (defalias 'shen-fn-called-at-pt #[nil "\3011\"\212\214e`\302Z]d}\210\303\304!\210\304u\210\305p!\2119\205+0\207\210\306\207" [obj (error) 1000 backward-up-list 1 read nil] 4 (#$ . 15589)]) (defalias 'shen-var-at-pt #[nil "\3011\212\302\303!\210\304\305w\210\306p!\2119\205*0\207\210\305\207" [obj (error) forward-sexp -1 "'" nil read] 3]) #@118 Send a command to the inferior Shen to give documentation for function FN. See variable `shen-function-doc-command'. (defalias 'shen-show-function-documentation #[(fn) "\302\303 \304 \"\"\207" [shen-function-doc-command fn comint-proc-query inferior-shen-proc format] 5 (#$ . 16046) (byte-code "\300\301\302 \"\207" [shen-symprompt "Function doc" shen-fn-called-at-pt] 3)]) #@113 Send a command to the inferior Shen to give documentation for function FN. See variable `shen-var-doc-command'. (defalias 'shen-show-variable-documentation #[(var) "\302\303 \304 \"\"\207" [shen-var-doc-command var comint-proc-query inferior-shen-proc format] 5 (#$ . 16428) (byte-code "\300\301\302 \"\207" [shen-symprompt "Variable doc" shen-var-at-pt] 3)]) #@105 Send a query to the inferior Shen for the arglist for function FN. See variable `shen-arglist-command'. (defalias 'shen-show-arglist #[(fn) "\302\303 \304 \"\"\207" [shen-arglist-command fn comint-proc-query inferior-shen-proc format] 5 (#$ . 16796) (byte-code "\300\301\302 \"\207" [shen-symprompt "Arglist" shen-fn-called-at-pt] 3)]) #@103 Send a command to the inferior Shen to describe symbol SYM. See variable `shen-describe-sym-command'. (defalias 'shen-describe-sym #[(sym) "\302\303 \304 \"\"\207" [shen-describe-sym-command sym comint-proc-query inferior-shen-proc format] 5 (#$ . 17140) (byte-code "\300\301\302 \"\207" [shen-symprompt "Describe" shen-var-at-pt] 3)]) (defalias 'inferior-shen-proc #[nil "\303\304=\203 p\202\f !\211\206\305\306!)\207" [major-mode inferior-shen-buffer proc get-buffer-process inferior-shen-mode error "No Shen subprocess; see variable `inferior-shen-buffer'"] 4]) #@98 This hook is run when the library `inf-shen' is loaded. This is a good place to put keybindings. (defvar inferior-shen-load-hook nil (#$ . 17718)) (byte-code "\300\301!\210\302\303!\207" [run-hooks inferior-shen-load-hook provide inf-shen] 2)