;ELC ;;; Compiled by b.s.logan@cs.bham.ac.uk on Wed Sep 8 18:39:32 1999 ;;; from file /home/staff/bsl/tmp/pop-mode/inferior-pop-mode.el ;;; in Emacs version 20.4.1 ;;; with bytecomp version 2.56 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. (if (and (boundp 'emacs-version) (< (aref emacs-version (1- (length emacs-version))) ?A) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19.29"))) (error "`inferior-pop-mode.el' was compiled for Emacs 19.29 or later")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\207" [require comint easymenu pop-mode pop-help-mode] 2) #@34 Read the help file for this word (autoload 'pop-get-help "pop-help-mode" '(#$ . 747) t) #@35 *Shell command for running Pop-11 (defvar pop-program-name (byte-code "\300\301!\203\f\300\301!\302P\207\303\207" [getenv "usepop" "/pop/pop/pop11" "pop11"] 2) (#$ . -841)) #@34 *Arguments to the Pop-11 command (defvar pop-program-args nil (#$ . -1021)) #@97 *Non nil means print messages describing what is being compiled in the Inferior Pop-11 buffer. (defvar pop-compilation-messages t (#$ . -1103)) #@34 *Regexp matching Pop-11 prompts. (defvar pop-prompt-regexp "^\\(: \\|\\*\\* *\\)*" (#$ . -1254)) #@65 *Non nil means inferior Pop-11 buffer should track cd commands. (defvar pop-dirtrackp t (#$ . -1357)) #@43 *Regexp to match Poplog `shell' commands. (defvar pop-command-regexp "\\((.*)\\|[^;&|]\\)+" (#$ . -1465)) #@35 *Regexp to match Pop-11 cd macro. (defvar pop-cd-regexp "cd" (#$ . -1577)) #@128 *Input matching this regexp are not saved on the history list. Defaults to a regexp ignoring all inputs of 0, 1, or 2 letters. (defvar inferior-pop-filter-regexp "\\`\\s *\\S ?\\S ?\\s *\\'" (#$ . -1659)) #@148 *Maximum number of seconds to wait for inferior Pop-11 process to produce output. Nil means don't wait, run asynchronously, t means wait forever. (defvar inferior-pop-timeout 5 (#$ . -1871)) #@155 *Non nil means that emacs should attempt to initialise inferior Pop-11 itself. Set this to nil if Poplog does the initialisation itself, e.g. in init.p (defvar inferior-pop-initialisation t (#$ . -2070)) #@35 Keymap used in inferior pop mode. (defvar inferior-pop-mode-map nil (#$ . 2282)) (byte-code "\204B\304 !\305!\210\306\307\310#\210\306\311\312#\210\306\313\314#\210\306\315\316#\210\306\317\320#\210\306\321\322#\210\306\323\324#\210\306\325\326#\210\306\327\330#\210\306\n\311\312#\210\306\n\313\314#\210\306\n\315\316#\210\306\n\331\314#\210\306\n\317\320#\210\306\n\332\333#\210\306\n\321\322#\210\306 \313\314#\210\306 \315\316#\210\306 \331\314#\210\306 \317\320#\210\306 \332\333#\210\306 \321\322#\207" [inferior-pop-mode-map comint-mode-map pop-mode-map pop-help-mode-map copy-keymap pop-mode-commands define-key "" pop-send-eof "\211" pop-complete-word "\230" pop-send-define "" pop-send-line "" pop-send-region "\f" pop-load-file "\216" comint-next-input "\220" comint-previous-input ";" self-insert-command "" "" pop-send-buffer] 4) #@42 *Hook for customising inferior-pop-mode. (defvar inferior-pop-mode-hook nil (#$ . -3155)) #@27 Nil unless using XEmacs). (defconst inferior-pop-using-xemacs (string-match "XEmacs" emacs-version) (#$ . 3251)) #@29 Inferior Poplog mode buffer (defvar inferior-pop-buffer nil (#$ . 3370)) #@87 Point in the inferior-pop-buffer at which the current inferior Pop-11 process starts. (defvar inferior-pop-buffer-start nil (#$ . 3449)) #@228 *Used to determine if a buffer contains Pop-11 source code. If it's loaded into a buffer that is in one of these major modes, it's considered a Pop-11 source file by pop-load-file. Used by these commands to determine defaults. (defvar pop-source-modes '(pop-mode) (#$ . -3593)) #@154 Caches the last (directory . file) pair. Caches the last pair used in the last pop-load-file command. Used for determining the default in the next one. (defvar pop-prev-l/c-dir/file nil (#$ . 3878)) #@29 Menu for Inferior Pop mode. (defvar inferior-pop-menu nil (#$ . 4084)) (easy-menu-do-define 'inferior-pop-menu inferior-pop-mode-map "Menu for Inferior Pop mode." '("Pop-11" ["Run Pop" run-pop (not (inferior-pop-process-p))] ["Previous prompt" (comint-previous-prompt 1) :active (inferior-pop-process-p) :keys "C-c C-p"] ["Next prompt" (comint-next-prompt 1) :active (inferior-pop-process-p) :keys "C-c C-n"] ["Copy input" comint-copy-old-input (inferior-pop-process-p)] "----" ["Compile region" pop-send-region :active (inferior-pop-process-p) :keys "C-c c-r"] ["Load file" pop-load-file :active (inferior-pop-process-p) :keys "C-c C-l"] "----" ["Exit Pop" comint-send-eof :active (inferior-pop-process-p) :keys "C-c C-d"])) #@1086 Major mode for interacting with an inferior Pop process. The following commands are available: \{inferior-pop-mode-map} Customisation: Entry to this mode runs the hooks on comint-mode-hook, pop-mode-hook and inferior-pop-mode-hook (in that order). You can send text to the inferior Pop-11 process from buffers containing Pop-11 code: pop-send-define sends the current definition to the Poplog process. pop-send-region sends the current region to the Poplog process. pop-send-buffer sends the current buffer to the Poplog process. 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 Pop; with argument, shifts rest of expression rigidly with the current line. C-M-q does Tab on each line starting within following expression. If you accidentally suspend your process, use \[comint-continue-subjob] to continue it. (defalias 'inferior-pop-mode #[nil "\306 \210\307\n!\210\310\311\312\313\314\235\204#\314B\315\235\2040\315B`\316 \210\317 \210\203C\320!\210\203K\321 \210\322\323\324\325#\207" [pop-prompt-regexp comint-prompt-regexp inferior-pop-mode-map major-mode mode-name mode-line-process comint-mode use-local-map inferior-pop-mode "Inferior Pop-11" (":%s") pop-input-filter pop-directory-tracker pop-nuke-prompt-chars pop-syntax-table pop-mode-variables easy-menu-add pop-define-emacs-procedures run-hooks comint-mode-hook pop-mode-hook inferior-pop-mode-hook pop-mode-abbrev-table local-abbrev-table comint-input-filter comint-input-filter-functions comint-output-filter-functions inferior-pop-buffer-start inferior-pop-using-xemacs inferior-pop-menu inferior-pop-initialisation] 4 (#$ . 4818) nil]) #@427 Run an inferior Poplog process, input and output via buffer *Pop-11*. If there is a process already running in *Pop-11*, just switch to that buffer. With argument, allows you to edit the command line (default is value of pop-program-name concatenated with pop-program-args). Runs the hooks from comint-mode-hook and inferior-pop-mode-hook in that order. (Type \[describe-mode] in the process buffer for a list of commands.) (defalias 'run-pop #[(cmd) "\303\304!\204\305!\306\307\310 @\311 A%\211q\210\312 \210)\313\304!\207" [cmd cmdlist inferior-pop-buffer comint-check-proc "*Pop-11*" pop-args-to-list apply make-comint "Pop-11" nil inferior-pop-mode switch-to-buffer] 7 (#$ . 6738) (let ((default-cmd (concat pop-program-name (if pop-program-args (concat " " pop-program-args))))) (list (if current-prefix-arg (read-string "Run Poplog: " default-cmd) default-cmd)))]) #@450 Run an inferior Poplog process in another frame. Input and output via buffer *Pop-11*. If there is a process already running in *Pop-11*, just switch to that buffer. With argument, allows you to edit the command line (default is value of pop-program-name concatenated with pop-program-args). Runs the hooks from comint-mode-hook and inferior-pop-mode-hook in that order. (Type \[describe-mode] in the process buffer for a list of commands.) (defalias 'run-pop-other-frame #[(cmd) "\305\306!\204!\307!\310\311\312 @\313 A%\211q\210\314 \210\315\314\316\317#\210) \203=\320\n!\321\f!\2035\322\f!\202;\323\n\324\n!\")\207\325\n!\207" [cmd cmdlist inferior-pop-buffer inferior-pop-using-xemacs inferior-pop-frame comint-check-proc "*Pop-11*" pop-args-to-list apply make-comint "Pop-11" nil inferior-pop-mode put frame-name Poplog buffer-dedicated-frame frame-live-p raise-frame set-buffer-dedicated-frame get-frame-for-buffer switch-to-buffer-other-frame] 7 (#$ . 7623) (let ((default-cmd (concat pop-program-name (if pop-program-args (concat " " pop-program-args))))) (list (if current-prefix-arg (read-string "Run Poplog: " default-cmd) default-cmd)))]) #@38 Return the args to poplog as a list. (defalias 'pop-args-to-list #[(string) "\303\304\"\211\204C\2025 \305U\204$\305 O\306 TGO!B\2025\303\307\"\211\2054\306\nGO!))\207" [string where pos string-match "[ ]" 0 pop-args-to-list "[^ ]"] 6 (#$ . 8797)]) #@57 Don't save anything matching inferior-pop-filter-regexp (defalias 'pop-input-filter #[(str) "\302 \"?\207" [inferior-pop-filter-regexp str string-match] 3 (#$ . 9070)]) #@203 Tracks cd commands issued to inferior Pop-11 process. This function is called on each input passed to pop11. It watches for cd commands and sets the buffer's default directory to track these commands. (defalias 'pop-directory-tracker #[(str) "\306\307\"\210\310\225\311\211\211\306 \f#\205G\310\225\312\f O\310\211#\312\f O\313\211#\306\n\"\310=\203;\314\315 !!\210\306\316 #\210\310\225\202,\207" [str arg1 cmd end start pop-command-regexp string-match "^[ ;\\s ]*" 0 nil comint-arguments 1 pop-process-cd substitute-in-file-name "[ ;\\s ]*" pop-cd-regexp] 4 (#$ . 9247)]) (defalias 'pop-process-cd #[(arg) "G\302U\203 \303\304!\202\305\306\307\217)\207" [arg dir 0 getenv "HOME" nil (byte-code "\302!\203\f\303 P!\207\304!\207" [dir comint-file-name-prefix file-name-absolute-p cd-absolute cd] 3) ((file-error (message "Couldn't cd.")))] 3]) #@66 Turn directory tracking on and off in an inferior Pop-11 buffer. (defalias 'pop-dirtrack-toggle #[nil "?\301\302\203 \303\202\304\"\207" [pop-dirtrackp message "Directory tracking %s" "ON" "OFF"] 3 (#$ . 10127) nil]) #@76 Hack to get rid of the prompt characters Pop-11 echoes during compilation. (defalias 'pop-nuke-prompt-chars #[(str) "\304\305\"\205*\306 !\212\307\310x)\n\311W\205)\312\n\313\\!\210\314 d\"\210\315\316 !d\310\223*\207" [str inferior-pop-buffer len inferior-pop-window string-match "^\\(: \\)+$" get-buffer-window ": " nil 0 delete-char 2 set-window-point process-mark pop-proc] 3 (#$ . 10356)]) #@41 Complete Pop-11 word at or before point (defalias 'pop-complete-word #[nil "\305\306!\210`\307\211\211\211\310\306!\210`\f {\311\312\313\"\210\314\n!\315\n \"\211\316=\2030\316\202X\n\232\203D\317\220\320 !\221\210\311\321\313\"\202X\203Q\f |\210c\202X\311\322\n\"\210\323 -\207" [comp words wd end start pop-backward-word 1 nil pop-forward-word message "Fetching words ... %s" "done" pop-get-words-starting pop-try-completion t "*Help*" display-completion-list "Making completion list ... %s" "No completions for \"%s\"" beep] 6 (#$ . 10762) nil]) #@55 Get the searchlists from the inferior Poplog process. (defalias 'pop-get-words-starting #[(string) "\305 \204 \306\307!\207\310 \204\306\311!\207\312\313!\314\315!\316\317\n #\320\321 !\203I\212p=\2042q\210ed|\210\322 !\210eb\210\323\320w\210\324!)\202M\306\325!\210\326 !\210\f,\207" [wordlist-buffer file string command wordlist inferior-pop-process-p error "Pop-11 process not running" pop-top-level-p "Pop-11 not at top level" get-buffer-create " *Pop-11 completions*" make-temp-name "/tmp/emacs" format "emacs_match_wordswith('@a%s', '%s');\n" nil pop-send-string insert-file ": " read "Can't build wordlists" delete-file] 4 (#$ . 11335)]) #@411 Return the common substring of all completions of string which are elements of WORDS. Each element of WORDS is tested to see if it begins with STRING. All that match are compared together; the longest initial sequence common to all matches is returned as a string. If there is no match at all, nil is returned. For an exact match, t is returned. Like try-completion but takes a list instead of an alist. (defalias 'pop-try-completion #[(string words) "\205 \302 \303\304\"\"\207" [words string try-completion mapcar #[(w) "C\207" [w] 1]] 5 (#$ . 12001)]) #@55 Send the current line to the inferior Poplog process. (defalias 'pop-send-line #[nil "\302\211\212\303y\210\304\302w\210`\302\210`\305 \306#+\207" [end start nil 0 "; " pop-send-file "expression from"] 4 (#$ . 12572) nil]) #@59 Send the current procedure to the inferior Poplog process (defalias 'pop-send-define #[nil "\301 \302@A\303\304 \305Q#)\207" [proc pop-define-ends pop-send-file "procedure" pop-define-name " from"] 6 (#$ . 12808) nil]) #@55 Send the entire buffer to the inferior Poplog process (defalias 'pop-send-buffer #[nil "\300ed\301#\207" [pop-send-file "buffer"] 4 (#$ . 13036) nil]) #@57 Send the current region to the inferior Poplog process. (defalias 'pop-send-region #[(start end) "\302 \303#\207" [start end pop-send-file "region from"] 4 (#$ . 13193) "r"]) #@74 Delete ARG characters forward, or (if at eob) send an EOF to subprocess. (defalias 'pop-delchar-or-maybe-eof #[(arg) "m\204\302!\207\303\301!\203$ \203$\304 \305\306#\210\304 \307\306#\210\304 \310\311#\210\312 \207" [arg comint-input-extent delete-char boundp set-extent-property start-closed nil end-closed detachable t process-send-eof] 4 (#$ . 13375) "p"]) #@46 Send an EOF to the current buffer's process. (defalias 'pop-send-eof #[nil "\301\300!\203\203\302\303\304#\210\302\305\304#\210\302\306\307#\210\310 \207" [comint-input-extent boundp set-extent-property start-closed nil end-closed detachable t process-send-eof] 4 (#$ . 13747) nil]) #@29 Compile the current region. (defalias 'pop-send-file #[(start end &optional what) "\306 \204 \307\310!\207\311\312!\313\314\"\313\315\n\316 #\317\f \320\321%\210\322 \"\210\205.\323!+\207" [file command what comment start end pop-top-level-p error "Pop-11 not at top level" make-temp-name "/tmp/emacs" format "compile('%s');\n" "Compiling %s %s" buffer-name write-region nil silent pop-send-command delete-file inferior-pop-timeout] 6 (#$ . 14044) "r"]) #@254 Send COMMAND to the inferior Pop-11 process for execution. If pop-compilation-messages is non-nil, COMMENT is written into the inferior-pop-buffer after the mark as a reminder that the command is in progress, otherwise it is echoed in the minibuffer. (defalias 'pop-send-command #[(command comment) "\306 \204 \307\310!\207\203\242p\311\312 \n#\313\216\314\211\211p=\204*q\210`\315\316 !U\317\315\316 !!\212b\210\320 !\210\315\316 !`\314\223\210\321\322!\210)\323\324\325\326#\210\203a\315\316 !b\210\317\315\316 !!\327\316  \"\210!\205\237\330 \211\"A@)\331 \\#\315\316 ! U\205\236\330 \211\"A@)#X\205\236\332 \210\202\201).\207\333\n!\210\334 !\207" [pop-compilation-messages comment-start comment compile-comment old-buffer after-comment-pos pop-top-level-p error "Pop-11 not at top level" format "%s %s\n" ((set-buffer old-buffer)) nil process-mark pop-proc marker-position insert-string sit-for 0 walk-windows #[(window) "\303! \232\205\304!\n\232\205\305\306\307 !\"\207" [window inferior-pop-buffer old-marker-pos window-buffer window-point set-window-point process-mark pop-proc] 4] not-minibuffer t comint-send-string current-time pop-timeout-secs accept-process-output message pop-send-string old-marker-pos moving inferior-pop-buffer command inferior-pop-timeout x timeout] 6 (#$ . 14516)]) #@136 Send STRING to the inferior Pop-11 process, redirecting output to BUFFER if this is non-nil, otherwise output is returned as a string. (defalias 'pop-send-string #[(string &optional buffer) "\306 \205  =\203U\307\310\311 !!\312\311 \"\210\f\203E\313 \211A@)\314 \\\310\311 !\nU\203D\313 \211A@)X\203D\315 \210\202()\f\203R\310\311 !\nY\202S\316)\207\317 \320!\307\310!!\206m\321\322!\323\323\324\216\212p=\204\202q\210\323\204\215ed|\210\325\232\204\236\326\232\204\236\326 \210\327\"\210d\310!\n\223\210\312 \"\210\f\203\343\313 \211A@)\314 \\\310!\nU\203\342\313 \211A@)X\203\342\315 \210\202\306)\203\370\f\203\364\310!\nY\202\373\316\202\373ed{*\204\330!\210.\207" [buffer inferior-pop-buffer pmark string inferior-pop-timeout x pop-top-level-p marker-position process-mark pop-proc process-send-string current-time pop-timeout-secs accept-process-output t inferior-pop-process-p process-buffer get-buffer-create " *Poplog interaction*" nil ((byte-code "\303 \"\210\304!\n \223\207" [inferior-pop-process inferior-pop-buffer inferior-pop-markpos set-process-buffer process-mark] 3)) inferior-pop-mode comint-mode set-process-buffer kill-buffer timeout inferior-pop-process inferior-pop-markpos interaction-buffer pop-output buffer-read-only major-mode] 4 (#$ . 15871)]) #@54 Load a Pop-11 file into the inferior Poplog process. (defalias 'pop-load-file #[(file-name) "\302!\210\303!\304!B\305\306 \307\310Q\"\207" [file-name pop-prev-l/c-dir/file comint-check-source file-name-directory file-name-nondirectory comint-send-string pop-proc "load '" "'\n"] 5 (#$ . 17241) (comint-get-source "Load Pop-11 file: " pop-prev-l/c-dir/file pop-source-modes t)]) #@32 Snarf the sexp ending at point (defalias 'pop-get-old-input #[nil "\212`\301 \210`{*\207" [end backward-sexp] 2 (#$ . 17630)]) #@144 Waits until Pop-11 process is at top level and returns t. If this does not happen within inferior-pop-timeout secs, gives up and returns nil. (defalias 'pop-wait-for-top-level #[nil "\203*\303 \211A@)\304 \\\305 \204&\303 \211A@)\nX\203&\306 \210\202\305 )\207\307\207" [inferior-pop-timeout x timeout current-time pop-timeout-secs pop-top-level-p accept-process-output t] 3 (#$ . 17766)]) #@128 Returns t if the process mark appears to be after a Pop-11 top-level prompt. If inferior-pop-timeout is nil, always returns t. (defalias 'pop-top-level-p #[nil "\305 \205@\203?\306\305 !\307\232\205@p\310\211 =\204 q\210\212\311\305 !b\210\312\313\f\314#\2057\214`d}\210\315\316!))\nq\210 *\207\314\207" [inferior-pop-timeout top-level old-buffer inferior-pop-buffer inferior-pop-buffer-start inferior-pop-process-p process-status run nil process-mark re-search-backward ": " t looking-at ": +$"] 5 (#$ . 18173)]) #@122 Returns the Maximum number of seconds to wait for inferior Pop-11 process to produce output, or nil meaning don't wait. (defalias 'pop-timeout-secs #[nil "\205 \301\232\203\f\302\207\207" [inferior-pop-timeout t 10000] 2 (#$ . 18704)]) #@37 Returns the current Poplog process. (defalias 'pop-proc #[nil "\300 \206\301\302!\207" [inferior-pop-process-p error "No current process."] 2 (#$ . 18952)]) #@52 Returns the current Poplog process or nil if none. (defalias 'inferior-pop-process-p #[nil "\301!\207" [inferior-pop-buffer get-buffer-process] 2 (#$ . 19117)]) #@37 Return the `car' of the `cdr' of X. (defalias 'cadr #[(x) "A@\207" [x] 1 (#$ . 19285)]) #@98 *A string containing a Pop-11 command to print a list of all words starting with STRING to FILE. (defvar pop-wordswith-procedure "define emacs_match_wordswith(pattern, file); dlocal cucharout=discout(file), poplinewidth = false; '( '.pr; applist(match_wordswith(pattern), printf(% '\"%P\" ' %)); ')'.pr; 1.nl; termin.cucharout; enddefine;\n" (#$ . -19380)) #@126 *A string containing a Pop-11 command to print an alist containing the Pop-11 HELP, TEACH, REF, DOC and SHOWLIB searchlists. (defvar pop-searchlists-procedure "define emacs_flatten_searchlists(file); dlocal cucharout=discout(file), poplinewidth = false; lvars t, l; '( '.pr; for t l in [help teach ref doc lib], [^vedhelplist ^vedteachlist ^vedreflist ^veddoclist ^popuseslist] do\nprintf(t, '( \"%P\" '); applist(flatten_searchlist(l), printf(%'\"%P\" '%)); ')'.pr; endfor; ' )'.pr; 1.nl; termin.cucharout; enddefine;\n" (#$ . -19744)) #@79 Define the procedures which return information from the inferior Pop process. (defalias 'pop-define-emacs-procedures-old #[nil "\302 \203 \303\302  P\"\207\304 \210\305\306!\207" [pop-wordswith-procedure pop-searchlists-procedure pop-proc comint-send-string beep message "ERROR: Emacs initialisation failed."] 4 (#$ . 20287)]) #@79 Define the procedures which return information from the inferior Pop process. (defalias 'pop-define-emacs-procedures #[nil "\304 \203\305 \203\306\307!\210\310 P\n\"\210 \205#\306\311!\207\312 \210\306\313!\207" [pop-wordswith-procedure pop-searchlists-procedure inferior-pop-buffer inferior-pop-timeout pop-proc pop-wait-for-top-level message "Initialising Pop-11 for Emacs ..." pop-send-string "Initialising Pop-11 for Emacs ... done" beep "ERROR: Emacs initialisation failed."] 3 (#$ . 20622)]) #@39 Compile the Pop-11 COMMAND, a string. (defalias 'pop-send-command-file #[(command &optional buffer) "\305\306!\307\310\"\311\312 \311\311\313%\210\314 \f\"\211+\207" [file compile-command pop-output command buffer make-temp-name "/tmp/emacs" format "compile('%s');\n" nil write-region silent pop-send-string] 7 (#$ . 21132) "r"]) (provide 'inferior-pop-mode)