;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\210\300\305!\210\300\306!\210\307\310\311\312\313\314\315\301&\210\316\317\311\320\315\310\321\322&\210\316\323\324\325\315\310\321\326&\210\316\327\330\331\315\310\321\332&\210\333\334\335\336\311\337\340\341\335\257DC\342\315\310%\210\316\343\311\344\315\310\321\326&\210\316\345\335\346\315\310\321\347&\210\316\350\351\352\315\310\321\353&\210\316\354\355\356\315\310\321\353&\210\316\357\311\360\315\310\321\347&\210\316\361\362\363\315\310\321\364&\210\316\365\366\367\315\310\321\370&\210\316\371\372\373\315\310\321\326&\210\316\374\375\376\315\310\321\364&\210\316\377\335\201@\315\310\321\347&\210\316\201A\335\201B\315\310\321\347&\207" [require matlab matlab-compat comint server gud shell custom-declare-group matlab-shell nil "MATLAB shell mode." :prefix "matlab-shell-" :group custom-declare-variable matlab-shell-mode-hook "*List of functions to call on entry to MATLAB shell mode." :type hook matlab-shell-command "matlab" "*The name of the command to be run which will start the MATLAB process." string matlab-shell-command-switches '("-nodesktop") "*Command line parameters run with `matlab-shell-command'.\nCommand switches are a list of strings. Each entry is one switch." (list :tag "Switch: ") custom-declare-face matlab-shell-error-face t :background :foreground "red1" :bold "*Face to use when errors occur in MATLAB shell." matlab-custom-startup-command "Custom MATLAB command to be run at startup." matlab-shell-echoes "*If `matlab-shell-command' echoes input." boolean matlab-shell-history-file "~/.matlab/%s/history.m" "*Location of the history file.\nA %s is replaced with the MATLAB version release number, such as R12.\nThis file is read to initialize the comint input ring." filename matlab-shell-history-ignore "^%\\|%%$\\|emacs.set" "Regular expression matching items from history to ignore.\nThis expression should ignore comments (between sessions) and any command\nthat ends in 2 or more %%, added to automatic commands." matlab-shell-autostart-netshell "Use the netshell side-channel for communicating with MATLAB." matlab-shell-emacsclient-command (matlab-find-emacsclient) "*The command to use as an external editor for MATLAB.\nUsing emacsclient allows the currently running Emacs to also be the\nexternal editor for MATLAB. Setting this to the empty string\nwill disable use emacsclient as the external editor." integer matlab-shell-run-region-function 'auto "Technique to use for running a line, region, or cell.\nThere are different benefits to different kinds of commands.\nUse 'auto to guess which to use by looking at the environment.\nauto - guess which to use\nmatlab-shell-region->commandline\n - Extract region, and generate 1 line of ML code.\nmatlab-shell-region->script\n - Extract region and any local fcns, and write to\n tmp script. Call that from MATLAB.\nmatlab-shell-region->internal\n - Send region location to MATLAB, and have ML\n extract and run that region. Customize\n `matlab-shell-emacsrunregion' to specify what ML\n function to use for this." (choice (const :tag "Auto" auto) (const :tag "Extract Line" matlab-shell-region->commandline) (const :tag "Extract Script" matlab-shell-region->script) (const :tag "Matlab Extract" matlab-shell-region->internal)) matlab-shell-internal-emacsrunregion "emacsrunregion" "The MATLAB command to use for running a region.\nThis command is used when `matlab-shell-run-region-function' is set\nto auto, or `matlab-shell-region->internal'" matlab-shell-input-ring-size 32 "*Number of history elements to keep." matlab-shell-ask-MATLAB-for-completions "When Non-nil, ask MATLAB for a completion list.\nWhen nil, complete against file names." matlab-shell-tab-use-company "*Use `company' (complete anything) for TAB completions in `matlab-shell'.\nOnly effective when when `company' is installed. Note, when you type to\nnarrow completions, you may find the responses slow and if so,\nyou can try turning this off."] 9) #@77 Non-nil if we have `company' installed. Use this to override initial check. (defvar matlab-shell-tab-company-available (byte-code "\300\301!\205\302\207" [locate-library "company" t] 2) (#$ . 4212)) #@126 Syntax table used when scanning MATLAB output. In this case, comment and are not special, as word wrap can get in the way. (defvar matlab-shell-errorscanning-syntax-table (byte-code "\302!\303\304\305 #\210 )\207" [matlab-mode-syntax-table st copy-syntax-table modify-syntax-entry 10 " "] 4) (#$ . 4420)) #@119 Hooks run each time a prompt is seen and sent to display. If multiple prompts are seen together, only call this once. (defvar matlab-shell-prompt-appears-hook nil (#$ . 4736)) #@81 Cookie used to transfer info about detected prompts from inner filter to outer. (defvar matlab-shell-prompt-hook-cookie nil (#$ . 4918)) (make-variable-buffer-local 'matlab-shell-prompt-hook-cookie) #@43 Non-nil to suppress running prompt hooks. (defvar matlab-shell-suppress-prompt-hooks nil (#$ . 5123)) #@38 Non nil when testing `matlab-shell'. (defvar matlab-shell-cco-testing nil (#$ . 5231)) #@50 Non-nil to display process output and input log. (defvar matlab-shell-io-testing nil (#$ . 5324)) #@78 Additional keywords used by MATLAB when reporting errors in interactivemode. (defconst matlab-shell-font-lock-keywords (list '("^\\(Error in\\|Syntax error in\\)\\s-+==>\\s-+\\(.+\\)$" (1 font-lock-comment-face) (2 font-lock-string-face)) '("^\\(\\(On \\)?line [0-9]+\\)" 1 font-lock-comment-face) '("\\(\\?\\?\\?[^\n]+\\)" 1 font-lock-comment-face)) (#$ . 5428)) #@59 Keyword symbol used for basic font-lock for MATLAB shell. (defconst matlab-shell-font-lock-keywords-1 (append matlab-basic-font-lock-keywords matlab-shell-font-lock-keywords) (#$ . 5798)) #@62 Highlight various extra outputs that are typical for MATLAB. (defconst matlab-shell-object-output-font-lock-keywords (list '(" M A T L A B " 0 'underline) '("All Rights Reserved" 0 'italic) '("\\(\\(?:(c)\\)?\\s-+Copyright[^\n]+\\)" 1 font-lock-comment-face) '("\\(Version\\)\\s-+\\([^\n]+\\)" (1 font-lock-function-name-face) (2 font-lock-variable-name-face)) '("\\(R[0-9]+[ab]\\(?: Update [0-9]+\\)\\) \\([^\n]+\\)" (1 font-lock-function-name-face) (2 font-lock-variable-name-face)) '("^To get started, type doc.$" 0 font-lock-comment-face prepend) '("For product information, [^\n]+" 0 font-lock-comment-face) '("\\<\\(demo\\|whatsnew\\|info\\|subscribe\\|help\\|doc\\|lookfor\\|what\\|whos?\\|cd\\|clear\\|load\\|save\\|helpdesk\\|helpwin\\)\\>" 1 font-lock-keyword-face) '("^\\s-*\\(\\w+\\) with properties:" (1 font-lock-type-face)) '("^\\s-*\\(\\w+ with properties:\\)\n\\s-*\n" ("^\\s-*\\(\\w+\\):[^\n]+$" (save-excursion (re-search-forward "\n\\s-*\n" nil t) (beginning-of-line) (point)) nil (1 font-lock-variable-name-face))) '("[[{]\\([0-9]+\\(?:x[0-9]+\\)+ \\w+\\)[]}]" (1 font-lock-comment-face))) (#$ . 5992)) #@59 Keyword symbol used for gaudy font-lock for MATLAB shell. (defconst matlab-shell-font-lock-keywords-2 (append matlab-shell-font-lock-keywords-1 matlab-function-font-lock-keywords matlab-shell-object-output-font-lock-keywords) (#$ . 7122)) #@66 Keyword symbol used for really gaudy font-lock for MATLAB shell. (defconst matlab-shell-font-lock-keywords-3 (append matlab-shell-font-lock-keywords-2 matlab-really-gaudy-font-lock-keywords) (#$ . 7367)) #@55 Return the MATLABROOT for the 'matlab-shell-command'. (defalias 'matlab-mode-determine-matlabroot #[nil "\302!\211\204\f\303! \203\304\305 \"\203 \306\211\224O )\207" [matlab-shell-command path file-name-directory matlab-find-executable-directory string-match "/bin/?$" 0] 4 (#$ . 7577)]) #@37 Keymap used in `matlab-shell-mode'. (defvar matlab-shell-mode-map (byte-code "\304\305!\306 \"\210\307\310\311\n$\210\312\313\314#\210\312\315 #\210\312\316\317#\210\312\316\317#\210\312\320\321#\210\312\322\323#\210\312\324\325#\210\312\326\327#\210\312\330\331#\210\312\332\333#\210\312\334\335#\210\312\336\337#\210\312\340\341#\210)\207" [km comint-mode-map global-map matlab-help-map make-sparse-keymap matlab-shell-mode-map matlab-set-keymap-parent substitute-key-definition next-error matlab-shell-last-error define-key [(control c) (control c)] matlab-shell-interrupt-subjob [(control h) (control m)] " " matlab-shell-tab [C-tab] matlab-shell-c-tab [(control up)] comint-previous-matching-input-from-input [(control down)] comint-next-matching-input-from-input [up] matlab-shell-previous-matching-input-from-input [down] matlab-shell-next-matching-input-from-input [(control return)] comint-kill-input [(backspace)] matlab-shell-delete-backwards-no-prompt "." matlab-shell-locate-fcn "/" matlab-shell-sync-buffer-directory] 5) (#$ . 7882)) #@19 MATLAB shell menu (defvar matlab-shell-menu nil (#$ . 8955)) (byte-code "\302\301\303\304$\210\305 \"\207" [matlab-shell-mode-map matlab-shell-menu easy-menu-do-define "MATLAB shell menu" ("MATLAB" ["Goto last error" matlab-shell-last-error t] "----" ["Stop On Errors" matlab-shell-dbstop-error t] ["Don't Stop On Errors" matlab-shell-dbclear-error t] "----" ["Locate MATLAB function" matlab-shell-locate-fcn :help "Run 'which FCN' in matlab-shell, then open the file in Emacs"] ["Run Command" matlab-shell-run-command t] ["Describe Variable" matlab-shell-describe-variable t] ["Describe Command" matlab-shell-describe-command t] ["Lookfor Command" matlab-shell-apropos t] "----" ["Complete command" matlab-shell-tab t] "----" ["Demos" matlab-shell-demos t] ["Close Current Figure" matlab-shell-close-current-figure t] ["Close Figures" matlab-shell-close-figures t] "----" ["Sync buffer directory (emacscd)" matlab-shell-sync-buffer-directory :help "Sync the matlab-shell buffer `default-directory' with MATLAB's pwd.\nThese will differ when MATLAB code changes directory without notifying Emacs."] ["Customize" (customize-group 'matlab-shell) (and (featurep 'custom) (fboundp 'custom-declare-variable))] ["Exit" matlab-shell-exit t]) easy-menu-add] 5) #@949 Run MATLAB as a subprocess in an Emacs buffer. This mode will allow standard Emacs shell commands/completion to occur with MATLAB running as an inferior process. Additionally, this shell mode is integrated with `matlab-mode', a major mode for editing M code. > From an M file buffer: \ \[matlab-shell-save-and-go] - Save the current M file, and run it in a MATLAB shell. > From Shell mode: \ \[matlab-shell-last-error] - find location of last MATLAB runtime error in the offending M file. > From an M file, or from Shell mode: \ \[matlab-shell-run-command] - Run COMMAND and show result in a popup buffer. \[matlab-shell-describe-variable] - Show variable contents in a popup buffer. \[matlab-shell-describe-command] - Show online documentation for a command in a popup buffer. \[matlab-shell-apropos] - Show output from LOOKFOR command in a popup buffer. > Keymap: \{matlab-mode-map} (defalias 'matlab-shell-mode #[nil "\306\307\310\311C\312 #\313$\314\315!\210\316\317!\210%\316\320!\210\321&\322\"\323\324!\2032\324\325!\210\316\326!\210\327\330'!\210\331(!\210\316\332!\210\333\334 \210)\203a*\203a\316\335!\210\336\337 \210\340\341!\210\342 \207" [major-mode mode-name comint-prompt-regexp comint-delimiter-argument-list comint-dynamic-complete-functions matlab-shell-echoes matlab-shell-mode "M-Shell" "^\\(K\\|EDU\\)?>> *" [59] (comint-replace-by-expanded-history) matlab-comint-get-old-input require shell make-local-variable comint-input-ring-size comint-input-ring-file-name format "R12" fboundp comint-read-input-ring t comment-start "%" use-local-map set-syntax-table font-lock-defaults ((matlab-shell-font-lock-keywords-1 matlab-shell-font-lock-keywords-2 matlab-shell-font-lock-keywords-3) t nil ((95 . "w"))) matlab-shell-mode-gud-enable-bindings company-idle-delay nil company-mode run-hooks matlab-shell-mode-hook matlab-show-version comint-process-echoes comint-get-old-input matlab-shell-input-ring-size matlab-shell-history-file matlab-shell-mode-map matlab-mode-syntax-table matlab-shell-tab-use-company matlab-shell-tab-company-available] 3 (#$ . 10217)]) #@44 Return t if the MATLAB netshell is active. (defalias 'matlab-netshell-active-p #[nil "\300\301!\205\302 \207" [featurep matlab-netshell matlab-netshell-client] 2 (#$ . 12390)]) #@61 Return non-nil of any of the matlab connections are active. (defalias 'matlab-any-shell-active-p #[nil "\300 \206\301 \207" [matlab-netshell-active-p matlab-shell-active-p] 1 (#$ . 12575)]) #@90 Name used to create `matlab-shell' mode buffers. This name will have *'s surrounding it. (defvar matlab-shell-buffer-name "MATLAB" (#$ . 12773)) #@52 Track visibility of MATLAB prompt in MATLAB Shell. (defvar matlab-prompt-seen nil (#$ . 12924)) #@41 Return t if the MATLAB shell is active. (defalias 'matlab-shell-active-p #[nil "\302\303\303Q!\211\205r q\210\304p!\205p))\207" [matlab-shell-buffer-name msbn get-buffer "*" comint-check-proc] 5 (#$ . 13026)]) #@152 Create a buffer with MATLAB running as a subprocess. MATLAB shell cannot work on the MS Windows platform because MATLAB is not a console application. (defalias 'matlab-shell #[nil "\306=\204\f\307=\203 \310\230\203\311\312!\210\313\314!\210\313\315!\210\n\203*\316 \204*\317 \210\320\321 \321Q!\210\322 ?\205\252\323 \210\324\325 \326\"\327\fP\2111B1\330\331 \3322%\210+\333 \210\334\335p!\336\"\210\337\335p!\340\"\2103d\332\223\210\341\342!\210\332\"\343\344\345\"\210\343\346\347\332\350$\210\343\351\352\332\350$\210\343\351\353\332\350$\210\343\351\354\332\350$\210\341\355!\210\332-\343\344\356\332\350$\210\343\344\357\332\350$\210\360 \207" [window-system matlab-shell-command matlab-shell-autostart-netshell matlab-shell-buffer-name windowid newvar pc w32 "matlab" error "MATLAB cannot be run as a inferior process. Try C-h f matlab-shell RET" require shell matlab-shell-gud matlab-netshell-server-active-p matlab-netshell-server-start switch-to-buffer "*" matlab-shell-active-p kill-all-local-variables frame-parameter selected-frame outer-window-id "WINDOWID=" apply make-comint nil matlab-shell-gud-startup set-process-filter get-buffer-process matlab-shell-wrapper-filter set-process-sentinel matlab-shell-wrapper-sentinel make-local-variable matlab-prompt-seen add-hook matlab-shell-prompt-appears-hook matlab-shell-first-prompt-fcn comint-input-filter-functions shell-directory-tracker t comint-output-filter-functions matlab-shell-version-scrape matlab-shell-render-html-anchor comint-postoutput-scroll-to-bottom matlab-shell-last-error-anchor matlab-shell-render-errors-as-anchor matlab-shell-colorize-errors matlab-shell-mode process-environment matlab-shell-command-switches comint-last-output-start] 7 (#$ . 13249) nil]) #@62 Text used as simple signal for text that should be captured. (defvar matlab-shell-capturetext-start-text "" (#$ . 15017)) #@62 Text used as simple signal for text that should be captured. (defvar matlab-shell-capturetext-end-text "" (#$ . 15155)) #@41 Accumulate text that is being captured. (defvar matlab-shell-accumulator "" (#$ . 15292)) (make-variable-buffer-local 'matlab-shell-accumulator) #@46 When non-nil, flush the accumulation buffer. (defvar matlab-shell-flush-accumulation-buffer nil (#$ . 15443)) #@52 Non-nil when inside `matlab-shell-wrapper-filter'. (defvar matlab-shell-in-process-filter nil (#$ . 15559)) #@173 MATLAB Shell's process filter. This wraps the GUD and COMINT filters. PROC is the process with input to this filter. STRING is the recent output from PROC to be filtered. (defalias 'matlab-shell-wrapper-filter #[(proc string) "\306!\307\310\311\312\f \"\203\313\314\310\211 $\202\n) P\314\204f\312\315!\"\203f\316\211\224O\316\224\307O\312\315!\317P\"\203q \316\225\307OP\316\211\225O\314\202q P\314\307r q\210\320 \"\210)r q\210\203\213\307\321\322!\210)\n\205\223\323\n!+\207" [proc matlab-shell-in-process-filter captext buff garbage string process-buffer nil t "\\(\\|\\[H0\\|\\[H\\[2J\\|H\\[2J\\)" string-match replace-match "" regexp-quote 0 "\\(:?\n\\)?" gud-filter run-hooks matlab-shell-prompt-appears-hook matlab-shell-process-capture-text matlab-shell-accumulator matlab-shell-flush-accumulation-buffer matlab-shell-capturetext-start-text matlab-shell-capturetext-end-text matlab-shell-prompt-hook-cookie] 5 (#$ . 15674)]) #@174 MATLAB Shell's process sentinel. This wraps the GUD and COMINT filters. PROC is the function which experienced a change in state. STRING is a description of what happened. (defalias 'matlab-shell-wrapper-sentinel #[(proc string) "\303!r q\210\304\n\"*\207" [proc buff string process-buffer gud-sentinel] 3 (#$ . 16679)]) #@153 Compute text from the current line to evaluate with MATLAB. This function checks to make sure the line is on a prompt. If not, it returns empty string (defalias 'matlab-comint-get-old-input #[nil "\303\212\304 \210\305 \306\216\307\n!\203\310\311\225\312 \"\202\313,\207" [inhibit-field-text-motion save-match-data-internal comint-prompt-regexp t beginning-of-line match-data #[nil "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3] looking-at buffer-substring-no-properties 0 point-at-eol ""] 3 (#$ . 17011)]) #@69 The version of MATLAB running in the current `matlab-shell' buffer. (defvar matlab-shell-running-matlab-version nil (#$ . 17557)) #@69 The release of MATLAB running in the current `matlab-shell' buffer. (defvar matlab-shell-running-matlab-release nil (#$ . 17693)) #@120 Scrape the MATLAB Version from the MATLAB startup text. Argument STR is the string to examine for version information. (defalias 'matlab-shell-version-scrape #[(str) "\306\307\"\203\310\311\"\310\312\"\202%\306\313\"\203%\310\311\"\310\314\" \205F\315\316\317\320#\210\321\322\n #\210\323 \n\" \324\325!\205F\325\320!\207" [str matlab-shell-running-matlab-version matlab-shell-running-matlab-release matlab-shell-history-file comint-input-ring-file-name matlab-shell-history-ignore string-match "\\(Version\\)\\s-+\\([.0-9]+\\)\\s-+(\\(R[.0-9]+[ab]?\\))" match-string 2 3 "\\(R[0-9]+[ab]\\)\\s-+\\(?:Update\\s-+[0-9]+\\s-+\\|Prerelease\\s-+\\)?(\\([0-9]+\\.[0-9]+\\)\\." 1 remove-hook comint-output-filter-functions matlab-shell-version-scrape t message "Detected MATLAB %s (%s) -- Loading history file" format fboundp comint-read-input-ring comint-input-history-ignore] 4 (#$ . 17830)]) #@64 A prefix to scan for to know if output might be scarfed later. (defvar gud-matlab-marker-regexp-prefix "error:\\|opentoline\\|dbhot" (#$ . 18744)) #@48 Keymap used on overlays that represent errors. (defvar matlab-shell-html-map (byte-code "\302 \303\304 \"\203\305\306\307#\210\202\305\310\307#\210\305\311\307#\210\305\312\313#\210)\207" [km emacs-version make-sparse-keymap string-match "XEmacs" define-key [button2] matlab-shell-html-click [mouse-2] [mouse-1] [return] matlab-shell-html-go] 4) (#$ . 18897)) #@27 Beginning of html anchor. (defvar matlab-anchor-beg "" (#$ . 19273)) #@21 End of html anchor. (defvar matlab-anchor-end "" (#$ . 19389)) #@101 Render html anchors inserted into the MATLAB shell buffer. Argument STR is the text for the anchor. (defalias 'matlab-shell-render-html-anchor #[(str) "\306 \"\205u\212\307 p\310\216\311\f!\210\312 ed\313Z]\314#\205t\315\224\315\225\316\317!\320!\315\224\321\"\322\323\324#\210\322\325\326#\210\322\327#\210\322\330 #\210\322\331#\210|\210|\210.\202,\207" [matlab-anchor-end str #1=#:buffer #2=#:table matlab-shell-errorscanning-syntax-table matlab-anchor-beg string-match syntax-table #[nil "rq\210\302 !)\207" [#1# #2# set-syntax-table] 2] set-syntax-table re-search-backward 8192 t 0 match-string 1 search-forward matlab-make-overlay matlab-overlay-put mouse-face highlight face underline matlab-url keymap help-echo anchor-beg-start anchor-beg-finish anchor-text anchor-end-finish anchor-end-start o matlab-shell-html-map] 5 (#$ . 19463)]) #@261 Expressions used to find errors in MATLAB process output. This variable contains the anchor, or starting text before a typical error. See `matlab-shell-error-location-expression' for a list of expressions for identifying where the error is after this anchor. (defvar matlab-shell-error-anchor-expression "^\\s-*\\(\\(Error \\(in\\|using\\)\\s-+\\|Syntax error in \\)\\(?:==> \\)?\\|In\\s-+\\(?:workspace belonging to\\s-+\\)?\\|Error:\\s-+File:\\s-+\\|Warning:\\s-+[^\n]+\n\\)" (#$ . 20363)) #@298 List of Expressions to search for after an error anchor is found. These expressions are listed as matching from newer MATLAB versions to older MATLAB's. Each expression should have the following match strings: 1 - The matlab function 2 - The line number 3 - The column number (if available) (defvar matlab-shell-error-location-expression (list "\\(?:^> In\\s-+\\)?\\([-+>@.a-zA-Z_0-9/ \\\\:]+\\)\\s-+(line \\([0-9]+\\))" "\\([-+>@.a-zA-Z_0-9/ \\\\:]+\\)\\s-+Line:\\s-+\\([0-9]+\\)\\s-+Column:\\s-+\\([0-9]+\\)" "\\([-+>@.a-zA-Z_0-9/ \\\\:]+\\)\\(?:>[^ ]+\\)?.*[\n ]\\(?:On\\|at\\)\\(?: line\\)? \\([0-9]+\\) ?") (#$ . 20863)) #@51 Interactively try out the error scanning feature. (defalias 'matlab-shell-scan-for-error-test #[nil "\301e!\211\203\302@A@\"\210\303\304\")\207" [ans matlab-shell-scan-for-error pulse-momentary-highlight-region message "Found: %S"] 4 (#$ . 21501) nil]) #@271 Scan backward for a MATLAB error in the current buffer until LIMIT. Uses `matlab-shell-error-anchor-expression' to find the error. Uses `matlab-shell-error-location-expression' to find where the error is. Returns a list of the form: ( STARTPT ENDPT FILE LINE COLUMN ) (defalias 'matlab-shell-scan-for-error #[(limit) "\306 p\307\216\310\n!\210\311\211\312 \313#\203X\212\212\314\224b\210\315 \210`)\314\225b\210\311\211\203W@\316!\203N \314\225\317\320!\317\321!\317\322!\257A\211\2043+\f-\207" [#1=#:buffer #2=#:table matlab-shell-errorscanning-syntax-table beginning ans matlab-shell-error-anchor-expression syntax-table #[nil "rq\210\302 !)\207" [#1# #2# set-syntax-table] 2] set-syntax-table nil re-search-backward t 0 back-to-indentation looking-at match-string-no-properties 1 2 3 limit matlab-shell-error-location-expression EXP --dolist-tail--] 7 (#$ . 21767)]) #@43 Last point where an error anchor was set. (defvar matlab-shell-last-error-anchor nil (#$ . 22675)) #@63 The last error anchor saved, represented as a debugger frame. (defvar matlab-shell-last-anchor-as-frame nil (#$ . 22780)) #@168 Hook function run when process filter sees a prompt. Detect non-url errors, and treat them as if they were url anchors. Input STR is provided by comint but is unused. (defalias 'matlab-shell-render-errors-as-anchor #[(&optional str) "\212db\210\306\211\211\211\307\n\206e!\211\203\270\f@ \fA@!\310\f8\306\211\311\312\"\"\266\203\"\313\f8#\314\f8$\315 !\"%\316\"!\211&\205S\317&!'\320'\206]\"\321#\322\260(\323%\324\325#\210\323%\326\327#\210\323%\330(#\210\323%\331'#\210\323%\332)#\210\323%\333\334'\206\227\"\335Q#\210(% B\"#B* \206\257e!]. \202 \306+\211,\203\327,@+\323+\336 #\210,A\211,\204\302* \205\345\212 b\210\337 )\211.\207" [matlab-shell-last-error-anchor newest-anchor starting-anchor overlaystack ans first nil matlab-shell-scan-for-error 2 string-trim-left string-trim-right 3 4 matlab-make-overlay matlab-shell-mref-to-filename expand-file-name "opentoline('" "'," ",0)" matlab-overlay-put mouse-face highlight face underline matlab-url matlab-fullfile keymap help-echo "Jump to error at " "." first-in-error-stack point-marker err-start err-end err-file err-line err-col o err-mref-deref err-full-file url matlab-shell-html-map matlab-shell-last-anchor-as-frame O --dolist-tail--] 8 (#$ . 22909)]) #@35 Text used as a signal for errors. (defvar matlab-shell-errortext-start-text "\n" (#$ . 24198)) #@35 Text used as a signal for errors. (defvar matlab-shell-errortext-end-text "" (#$ . 24309)) #@209 Hook function run to colorize MATLAB errors. The filter replaces indicators with text . This strips out that text, and colorizes the region red. STR is provided by COMINT but is unused. (defalias 'matlab-shell-colorize-errors #[(&optional str) "\212\305\211db\210\306\307\n!\305\310#\205_\306\307 !\305\310#\204#\311\312!\210\202Y\313\224\211\313\225|\210\314\307\n!\305\310#\204<\311\315!\210\202Y\313\224\211\313\225|\210\316 p\305\211%\317\f\320\310#\210\317\f\321\322#\210)db\210\202+\207" [end start matlab-shell-errortext-end-text matlab-shell-errortext-start-text o nil re-search-backward regexp-quote t error "Missmatched error text tokens from MATLAB" 0 re-search-forward "Internal error scanning for error text tokens" matlab-make-overlay matlab-overlay-put shellerror face matlab-shell-error-face] 7 (#$ . 24418)]) #@153 Compute how to call emacsclient so MATLAB will connect to this Emacs. Handles case of multiple Emacsen from different users running on the same system. (defalias 'matlab-shell--get-emacsclient-command #[nil "\306 \204\307\310\311 \"\312\313\"\210\314 \210\306 \204\315\316\"\210 \317=\203'\320\202(\321 \n\322\f\203:\323\n\324 \"Q\202B\325\n\324\"QR)\207" [server-name system-type iq matlab-shell-emacsclient-command server-use-tcp server-auth-dir server-running-p format "server-%d" emacs-pid message "matlab-shell: starting server with name %s" server-start user-error "Unable to start server with name %s" windows-nt "\"" "" " -n" " -f " expand-file-name " -s " server-socket-dir] 8 (#$ . 25286)]) #@70 Add the `matlab-shell' MATLAB toolbox to the MATLAB path on startup. (defvar matlab-shell-use-emacs-toolbox (byte-code "\302\303!\304\305\306\206\f\307!\"\205\310 !*\207" [mlfile dir locate-library "matlab" expand-file-name "toolbox/emacsinit.m" file-name-directory "" file-exists-p] 4) (#$ . 26009)) #@110 Hook run when the first prompt is seen. Sends commands to the MATLAB shell to initialize the MATLAB process. (defalias 'matlab-shell-first-prompt-fcn #[nil "\306\307\310\"\210\203M\311\312\313\314\315!!\"\311\316 \" \203\317\202 \320\321 \211\203/\322\323 \"\2020\320\fD\322\324\n\325\326\"#\327!\210.\202Q\330\331!\210 \203[\332\307\333\"\207\332\307\334\"\207" [matlab-shell-use-emacs-toolbox path initcmd matlab-shell-autostart-netshell nsa ecc remove-hook matlab-shell-prompt-appears-hook matlab-shell-first-prompt-fcn expand-file-name "toolbox" file-name-directory locate-library "matlab" "emacsinit" "emacs.set('netshell', true);" "" matlab-shell--get-emacsclient-command format "emacs.set('clientcmd', '%s');" "run('%s');%s" apply concat matlab-shell-send-command error "Unable to initialize matlab, emacsinit.m and other files missing" add-hook matlab-shell-user-startup-fcn matlab-shell-second-prompt-fcn ecca args cmd matlab-custom-startup-command] 7 (#$ . 26324)]) #@68 Hook run on second prompt to run user specified startup functions. (defalias 'matlab-shell-user-startup-fcn #[nil "\301\302\303\"\210\304\260!\210\305\302\306\"\207" [matlab-custom-startup-command remove-hook matlab-shell-prompt-appears-hook matlab-shell-user-startup-fcn matlab-shell-send-command add-hook matlab-shell-second-prompt-fcn] 3 (#$ . 27333)]) #@64 Hook to run when the first prompt AFTER the call to emacsinit. (defalias 'matlab-shell-second-prompt-fcn #[nil "\301\302\303\"\210\304\211\207" [matlab-prompt-seen remove-hook matlab-shell-prompt-appears-hook matlab-shell-second-prompt-fcn t] 3 (#$ . 27697)]) #@278 Process text found between and . Text is found in `matlab-shell-wrapper-filter', and then this function is called before removing text from the output stream. This function detects the type of ouptut (an eval, or output to buffer) and then processes it. (defalias 'matlab-shell-process-capture-text #[(str) "\306\211\307\306\211\310 \311\216\312\313 !!\"\204 \314\315!\"\210!\316\225\306O\312\317 \"\203@\316\224\316U\203@\320\321 \" \316\225\306O\312\313\"! \"\203S \316\211\224O\202X\314\322 \"\210\n\323\230\203y\324 !#\3251o\326#!0\202u\210\327\330#\")\202\254r\331\n!q\210\306$\332 \210 c\210eb\210p)\312\333\n\"\203\240rq\210\334 \210)\202\250rq\210\335 \210)\336\337\".\207" [showbuff text buffname end start save-match-data-internal nil "*MATLAB Output*" match-data #[nil "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3] string-match regexp-quote error "Capture text failed to provide start token. [%s]" 0 "[ ]*(\\([^)\n]+\\))" match-string 1 "Capture text failed to provide needed end token. [%s]" "eval" read (error) eval message "Failed to evaluate forms from MATLAB: \"%S\"" get-buffer-create erase-buffer "^\\*MATLAB Help" matlab-shell-help-mode view-mode display-buffer ((display-buffer-use-some-window display-buffer-below-selected display-buffer-at-bottom) (inhibit-same-window . t) (window-height . shrink-window-if-larger-than-buffer)) matlab-shell-capturetext-start-text str matlab-shell-capturetext-end-text evalforms buffer-read-only] 5 (#$ . 27965)]) #@63 Call `comint-interrupt-subjob' and flush accumulation buffer. (defalias 'matlab-shell-interrupt-subjob #[nil "\301\302 \207" [matlab-shell-flush-accumulation-buffer t comint-interrupt-subjob] 1 (#$ . 29526) nil]) #@60 Get the Nth next matching input from for the command line. (defalias 'matlab-shell-next-matching-input-from-input #[(n) "\301[!\207" [n matlab-shell-previous-matching-input-from-input] 2 (#$ . 29746) "p"]) #@64 Get the Nth previous matching input from for the command line. (defalias 'matlab-shell-previous-matching-input-from-input #[(n) "\302\210\303 \203\304>\203\305\306 [!)\207\306 [!\207 [y\207" [last-command n nil comint-after-pmark-p (matlab-shell-previous-matching-input-from-input matlab-shell-next-matching-input-from-input) comint-previous-matching-input-from-input comint-next-matching-input-from-input] 2 (#$ . 29959) "p"]) #@128 Delete one char backwards without destroying the matlab prompt. Optional argument ARG describes the number of chars to delete. (defalias 'matlab-shell-delete-backwards-no-prompt #[(&optional arg) "\212\303 \210\304\305!\203\306\225\202`)\250\203[\202\307\211` \\X\203,\310 !\202/\311\312!*\207" [arg numchars promptend beginning-of-line looking-at "K?>> " 0 -1 delete-char error "Beginning of line"] 4 (#$ . 30401) "P"]) #@80 Get a list of completions from MATLAB. STR is a command substring to complete. (defalias 'matlab-shell-completion-list #[(str) "\306 \307 \310Q\311\211\312\211\311rq\210\313 \204!\314\315!\210\316\n!\317\320\f\"\2042\314\321\n\f#\210\f\322\225\311O\317\323\f\"\203P\324\325\f\"\324\326\f\"\f\322\225\311O\317\327\f\"\203v\f\322\225\311O\317\327\f\"\210\f\322\211\224OCB\f\322\225\311O\202P\330B\305 B\331\237BE.\207" [msbn str cmd comint-scroll-show-maximum-output output replacement-text matlab-shell-buffer-barf-not-running "emacsdocomplete('" "')" nil "" matlab-on-prompt-p error "MATLAB shell must be non-busy to do that" matlab-shell-collect-command-output string-match "emacs_completions_output =" "Internal error, '%s' returned unexpected output, %s" 0 "^'\\([^']+\\)' --> '\\([^']*\\)'" match-string 1 2 "'" cmd-text-to-replace completions] 5 (#$ . 30842)]) #@253 Return the starting location of the common substring for completion. Used by `matlab-shell-tab' to in matching the COMPLETIONS, i.e. (substring LAST-CMD limit-pos (length last-cmd)) is the common starting substring of each completion in completions. (defalias 'matlab-shell-get-completion-limit-pos #[(last-cmd completions) "G\n\203<\n@@\211G\306\f\307V\2032 \307\fO \310 \"\203+\f\307\202.\fS)\202 \203;G Z+ )\207" [last-cmd limit-pos completions completion i chomp-num-chars nil 0 string-suffix-p part] 4 (#$ . 31747)]) #@209 Compute completions needed for `matlab-shell-tab' and `company-matlab-shell'. Completions are computed based on the prefix on the last command prompt. No completions are provided anywhere else in the buffer. (defalias 'matlab-shell-get-completion-info #[nil "`dU?\206\n\306 ??\205\353\307\310\211\211\211\211\211\211\211\212db\210\311 \210\312!\210``\313 {)\314\315\"\203R\316\317\307\211\320%\202=\321!\322\236A\303\236A\203\234\323\236AGGZ\\b\210`\313 |\210c\210\324OP \204\233\307*+\325 \"\f\310O\212db\210\311 \210\312!\210`\f\\\313  G\320=\203\320\326\n \" @@\230\203\320\310)\327B\305 B\304\fB\303 B\302\nB\301 B\300B\257. \207" [did-completion common-substr-end-pt common-substr-start-pt completions limit-pos common-substr matlab-on-prompt-p t nil beginning-of-line re-search-forward matlab-point-at-eol string-match "[^']\\('\\)\\($\\|[^']\\)" replace-match "''" 1 matlab-shell-completion-list cmd-text-to-replace replacement-text 0 matlab-shell-get-completion-limit-pos buffer-substring-no-properties last-cmd last-cmd-start-point inhibit-field-text-motion comint-prompt-regexp last-cmd-quoted completion-list last-cmd-start-len] 9 (#$ . 32298)]) #@78 Send [TAB] to the currently running matlab process and retrieve completions. (defalias 'matlab-shell-c-tab #[nil "\301\302 )\207" [matlab-shell-tab-company-available nil matlab-shell-tab] 1 (#$ . 33550) nil]) #@394 Perform completions at the `matlab-shell' command prompt. By default, uses `matlab-shell' toolbox command emacsdocomplete.m to get completions. If `matlab-shell-ask-MATLAB-for-completions' is nil, then use `comint-dynamic-complete-filename' instead. If `matlab-shell-tab-use-company' is non-nil, and if `company-mode' is installed, then use company to display completions in a popup window. (defalias 'matlab-shell-tab #[nil "\204\304\305!\207 \203\n\203 \203\304\306!\207\307\310!\203!\311 \207\312 \207" [matlab-shell-ask-MATLAB-for-completions matlab-shell-tab-company-available matlab-shell-tab-use-company company-mode call-interactively comint-dynamic-complete-filename company-matlab-shell fboundp completion-in-region matlab-shell-do-completion-light matlab-shell-do-completion] 2 (#$ . 33767) nil]) #@50 Perform completion using `completion-in-region'. (defalias 'matlab-shell-do-completion-light #[nil "\305\306 \302 \236A\303 \236A\304 \236A\307 \f\n#-\207" [inhibit-field-text-motion completion-info completions common-substr-start-pt common-substr-end-pt t matlab-shell-get-completion-info completion-in-region] 4 (#$ . 34593)]) #@114 Perform completion using Emacs buffers. This should work in version before `completion-in-region' was available. (defalias 'matlab-shell-do-completion #[nil "\306\307 \302 \236A\303 \236A\304 \236A\305 \236A\310 \236A\311 \236A\211 ?\205\306 |\210db\210\fG\312=\203C\f@@c\210\313 \202\306\314\315\n\f\"\211\314=\204f\306=\204f;\203\264\n\230\203\264\nc\210\316\317!r\316!q\210p\320 \210\314\211\306\211 \306!\"\321 \210\322\323!\210+\211#$\324\325\326\f\"\n\"\210\327#!\210+\330\331\")\202\305;\203\303c\210\313 \202\305\nc).\207" [inhibit-field-text-motion completion-info common-substr limit-pos completions common-substr-start-pt t matlab-shell-get-completion-info common-substr-end-pt did-completion 1 matlab-shell-tab-hide-completions nil try-completion get-buffer-create "*Completions*" kill-all-local-variables erase-buffer run-hooks temp-buffer-setup-hook matlab-display-completion-list mapcar car internal-temp-output-buffer-show display-buffer ((display-buffer-below-selected display-buffer-at-bottom) (inhibit-same-window . t) (window-height . fit-window-to-buffer)) try cbuff default-directory #1=#:old-dir buffer-read-only buffer-file-name buffer-undo-list inhibit-modification-hooks inhibit-read-only #2=#:buf standard-output] 5 (#$ . 34934)]) #@53 Hide any completion windows for `matlab-shell-tab'. (defalias 'matlab-shell-tab-hide-completions #[nil "\301\302!\211\205\303\304\301\302!\")\207" [bw get-buffer-window "*Completions*" quit-window nil] 5 (#$ . 36258)]) #@173 Get the location of FCN's M file. Returns an alist: ( LOCATION . BUILTINFLAG ) LOCATION is a string indicating where it is, and BUILTINFLAG is non-nil if FCN is a builtin. (defalias 'matlab-shell-which-fcn #[(fcn) "\212\306 \307\310 \"\311\211\311q\210db\210\312 \204\313\314!\210\315\n!\316\317\f\"\2036\f\320\224\320\225O\321P\322B\202L\316\323\f\"\203A\311\202L\316\324\f\"\210\f\325\211\224OC.\207" [msbn fcn cmd comint-scroll-show-maximum-output output builtin matlab-shell-buffer-barf-not-running format "disp(which('%s'))" nil matlab-on-prompt-p error "MATLAB shell must be non-busy to do that" matlab-shell-collect-command-output string-match "built-in (\\([^)]+\\))" 1 ".m" t "not found" "$" 0] 4 (#$ . 36487)]) #@60 Run "which FCN" in the `matlab-shell', then open the file. (defalias 'matlab-shell-locate-fcn #[(fcn) "\302!\211\203\303 @!\202\304\305\")\207" [fcn file matlab-shell-which-fcn find-file error "Command which('%s') returned empty"] 4 (#$ . 37228) (list (let ((default (matlab-read-word-at-point))) (if (and default (not (equal default #1=""))) (let ((s (read-string (concat "MATLAB locate fcn (default " default "): ")))) (if (string= s #1#) default s)) (read-string "MATLAB locate fcn: "))))]) #@36 Cache of MATLABROOT in this shell. (defvar matlab-shell-matlabroot-run nil (#$ . 37735)) (make-variable-buffer-local 'matlab-shell-matlabroot-run) #@99 Get the location of this shell's root. Returns a string path to the root of the executing MATLAB. (defalias 'matlab-shell-matlabroot #[nil "\212\306 \307\310\211\310q\210db\210 \203 \2023\311 \204#\312\313!\210\314 !\315\316 \"\210 \317\211\224O\211.\207" [msbn cmd comint-scroll-show-maximum-output output builtin matlab-shell-matlabroot-run matlab-shell-buffer-barf-not-running "disp(matlabroot)" nil matlab-on-prompt-p error "MATLAB shell must be non-busy to do that" matlab-shell-collect-command-output string-match "$" 0] 4 (#$ . 37888)]) #@165 Get the word closest to point, but do not change position. Has a preference for looking backward when not directly on a symbol. Snatched and hacked from dired-x.el (defalias 'matlab-read-word-at-point #[nil "\304\305 \306 \307\212\310\311 \312Q!\204\"\313 \314Q\nx\210o\204\"\315u\210\316\311 \312Q\317g!\"\247\203< \nx\210` w\210\202>``{-\207" [start eol bol word-chars "a-zA-Z0-9_" matlab-point-at-bol matlab-point-at-eol nil looking-at "[" "]" "^" "{}()[]" -1 string-match char-to-string] 4 (#$ . 38452)]) #@44 Get the line under point, if command line. (defalias 'matlab-read-line-at-point #[nil "\303=\203\"\212\304\305 \210\306\n\260!\204\307\202 \310\n!\210`\311 {*\207\212\312\313 \314 \")\207" [major-mode inhibit-field-text-motion comint-prompt-regexp matlab-shell-mode t beginning-of-line looking-at "" search-forward-regexp matlab-point-at-eol buffer-substring-no-properties matlab-scan-beginning-of-command matlab-scan-end-of-command] 3 (#$ . 38979)]) #@42 Return number of non-empty lines in STR. (defalias 'matlab-non-empty-lines-in-string #[(str) "\303\211\304\305\n#\203 T\303\225\202 *\207" [start count str 0 string-match "^.+$"] 4 (#$ . 39443)]) #@129 Print output to temp buffer, or a message if empty string. BUFFER is the buffer to output to, and OUTPUT is the text to insert. (defalias 'matlab-output-to-temp-buffer #[(buffer output) "\306!\211\307U\203\310\311!\202` \312U\203&\313\314\"\210\310\307\224\307\225O!\202`\nr\315\f!q\210p\316 \210 \317\211\320\211\320\321 \210\322\323!\210+\211\324!\210\325!\210+r\fq\210\326 ))\207" [output lines-found default-directory #1=#:old-dir buffer buffer-read-only matlab-non-empty-lines-in-string 0 message "(MATLAB command completed with no output)" 1 string-match "^.+$" get-buffer-create kill-all-local-variables nil t erase-buffer run-hooks temp-buffer-setup-hook princ internal-temp-output-buffer-show matlab-shell-help-mode buffer-file-name buffer-undo-list inhibit-modification-hooks inhibit-read-only #2=#:buf standard-output] 5 (#$ . 39655)]) #@91 Run COMMAND and display result in a buffer. This command requires an active MATLAB shell. (defalias 'matlab-shell-run-command #[(command) "\302!\303\304 \")\207" [command doc matlab-shell-collect-command-output matlab-output-to-temp-buffer "*MATLAB Help*"] 3 (#$ . 40535) (list (read-from-minibuffer "MATLAB command line: " (cons (matlab-read-line-at-point) 0)))]) #@169 Get the contents of VARIABLE and display them in a buffer. This uses the WHOS (MATLAB 5) command to find viable commands. This command requires an active MATLAB shell. (defalias 'matlab-shell-describe-variable #[(variable) "\302\303P!\304\305 \")\207" [variable doc matlab-shell-collect-command-output "whos " matlab-output-to-temp-buffer "*MATLAB Help*"] 3 (#$ . 40909) (list (read-from-minibuffer "MATLAB variable: " (cons (matlab-read-word-at-point) 0)))]) #@173 Describe COMMAND textually by fetching it's doc from the MATLAB shell. This uses the lookfor command to find viable commands. This command requires an active MATLAB shell. (defalias 'matlab-shell-describe-command #[(command) "\302\303P!\304\305 \")\207" [command doc matlab-shell-collect-command-output "help -emacs " matlab-output-to-temp-buffer "*MATLAB Help*"] 3 (#$ . 41378) (byte-code "\302 \303\304 \203\305\306 \"\202\307!\211\310\230\203 C\202!C*\207" [val fn matlab-function-called-at-point nil read-string format "Describe function (default %s): " "Describe function: " ""] 5)]) #@117 Look for any active commands in MATLAB matching MATLABREGEX. This uses the lookfor command to find viable commands. (defalias 'matlab-shell-apropos #[(matlabregex) "\302\303P!\304\305 \")\207" [matlabregex ap matlab-shell-collect-command-output "lookfor " matlab-output-to-temp-buffer "*MATLAB Apropos*"] 3 (#$ . 41987) (list (read-from-minibuffer "MATLAB command subexpression: " (cons (matlab-read-word-at-point) 0)))]) #@41 Return t if we MATLAB can accept input. (defalias 'matlab-on-prompt-p #[nil "\212\302db\210\303 \210\304 !*\207" [inhibit-field-text-motion comint-prompt-regexp t beginning-of-line looking-at] 2 (#$ . 42417)]) #@46 Return t if we MATLAB is on an empty prompt. (defalias 'matlab-on-empty-prompt-p #[nil "r\302 q\210\303db\210\304 \210\305 \306P!*\207" [inhibit-field-text-motion comint-prompt-regexp matlab-shell-active-p t beginning-of-line looking-at "\\s-*$"] 3 (#$ . 42634)]) #@46 Return t if we MATLAB is on an debug prompt. (defalias 'matlab-on-debug-prompt-p #[nil "r\301 q\210\302db\210\303 \210\304\305!*\207" [inhibit-field-text-motion matlab-shell-active-p t beginning-of-line looking-at "K>>\\s-*"] 2 (#$ . 42905)]) #@60 Return a running MATLAB buffer iff it is currently active. (defalias 'matlab-shell-buffer-barf-not-running #[nil "\300 \206\301\302!\207" [matlab-shell-active-p error "You need to run the command `matlab-shell' to do that!"] 2 (#$ . 43155)]) #@247 If there is a MATLAB shell, run the MATLAB COMMAND and return it's output. It's output is returned as a string with no face properties. The text output of the command is removed from the MATLAB buffer so there will be no indication that it ran. (defalias 'matlab-shell-collect-command-output #[(command) "\306 \307r q\210\310 \311\216\312\211\211\307`\313 \204#\314\315!\210db\210\316 \210\317 !\210\320\321!\210\322u\210`\323 {`\323 |\210`!\203RT\324\"!\\\202T\307#$\325\326p!\"\"\210db\210\3271\220\312%$`Y\204|\330 \203|#\205\212\331\326p!\332\"#db\210\202k)0\210\202\230\210\307&\333\334!\210b\210\335\212$b\210`)\212db\210\316 \210`)\"*d|\210 c\210 b\210.\n\207" [matlab-shell-suppress-prompt-hooks msbn #1=#:wconfig start-point inhibit-field-text-motion lastcmd matlab-shell-buffer-barf-not-running t current-window-configuration #[nil "\301!\207" [#1# set-window-configuration] 2] nil matlab-on-prompt-p error "MATLAB shell must be non-busy to do that" beginning-of-line re-search-forward re-search-backward ">" 2 matlab-point-at-eol string-width comint-simple-send get-buffer-process (quit) matlab-on-empty-prompt-p accept-process-output 0.1 eval (ignore nil) buffer-substring-no-properties str pos comint-prompt-regexp matlab-shell-echoes command notimeout output-start-char inhibit-quit quit-flag] 5 (#$ . 43406)]) #@159 Send COMMAND to a MATLAB process. If there is a `matlab-shell', send it to the command prompt. If there is only a `matlab-netshell', send it to the netshell. (defalias 'matlab-shell-send-command #[(command) "\301 \203r\301 q\210\302\303P!)\207\304!\207" [command matlab-shell-active-p matlab-shell-send-string "\n" matlab-netshell-eval] 3 (#$ . 44786)]) #@54 Send STRING to the currently running matlab process. (defalias 'matlab-shell-send-string #[(string) "\204\304p!db\210\nc\210\305 !`\306\223\210) \203\307\310\n\"\210\311\304p!\n\"\207" [matlab-shell-echoes proc string matlab-shell-io-testing get-buffer-process process-mark nil message "<--[%s]" comint-send-string] 3 (#$ . 45150)]) #@45 Return the matlab-url overlay at P, or nil. (defalias 'matlab-url-at #[(p) "\303\304! \203\n\204\305 @\306\" A\211\204\n\n*\207" [p o url nil matlab-overlays-at matlab-overlay-get matlab-url] 4 (#$ . 45495)]) #@45 Return the matlab-url overlay at P, or nil. (defalias 'matlab-url-stack-top-at #[(p) "\303\304! \203#\n\204#\305 @\306\"\206\305 @\307\" A\211\204\n\n*\207" [p o url nil matlab-overlays-at matlab-overlay-get first-in-error-stack matlab-url] 4 (#$ . 45720)]) #@161 Find a previous occurrence of an overlay with a MATLAB URL. If STACKTOP is non-nil, then also get the top of some stack, which didn't show up in reverse order. (defalias 'matlab-shell-previous-matlab-url #[(&optional stacktop) "\212\304\211`\211\204+\305!\211\203+e=\204+ \203#\306!\202&\307!\211\203 \n,\207" [p o url stacktop nil matlab-previous-overlay-change matlab-url-stack-top-at matlab-url-at] 4 (#$ . 45995)]) #@121 Convert a class like reference MREF to a file name. Optional FCN-P indicates specifies to force treating as a function. (defalias 'matlab-shell-class-mref-to-file #[(mref &optional fcn-p) "\306\307\"\306 @\310\"\311\n!\312 \313\235\204a\n\203a\nG\314U\2032 \2042\306\n@\315\"\211@C)\f\nG\314V\203>\316\202H ?\205H\317\n@\315Q\n@Q\nA\211\203Z\f\315P\202\f\320P\202\f,\207" [mref LF S L ans fcn-p split-string ">" "\\." last nil ("mlx" "m") 1 "/" "+" "@" ".m" meth] 5 (#$ . 46436)]) #@134 Try to run 'which' on REF to find actual file location. If the MATLAB shell isn't ready to run a which command, skip and return nil. (defalias 'matlab-shell-mref-which-fcn #[(ref) "?\205\212\304 \211q\210db\210\305 \205\n?\205\306 !*\207" [matlab-shell-in-process-filter msbn matlab-shell-cco-testing ref matlab-shell-buffer-barf-not-running matlab-on-prompt-p matlab-shell-which-fcn] 3 (#$ . 46948)]) #@178 List of converters to convert MATLAB file references into a filename. Each element is a function that accepts a file ref, and returns a file name, or nil if no conversion done. (defvar matlab-shell-mref-converters '((lambda (mref) mref) (lambda (mref) (when (string-match "\\.\\(p\\)$" mref) (replace-match "m" nil t mref 1))) (lambda (mref) (when (not (string-match "\\.m$" mref)) (concat mref ".m"))) (lambda (mref) (when (string-match "\\." mref) (matlab-shell-class-mref-to-file mref))) (lambda (mref) (when (string-match "\\." mref) (matlab-shell-class-mref-to-file mref t))) (lambda (mref) (when (string-match ">" mref) (concat (substring fileref 0 (match-beginning 0)) ".m"))) (lambda (mref) (car (matlab-shell-mref-which-fcn mref)))) (#$ . 47365)) #@235 Convert the MATLAB file reference FILEREF into an actual file name. MATLAB can refer to functions on the path by a short name, or by a .p extension, and a host of different ways. Convert this reference into something Emacs can load. (defalias 'matlab-shell-mref-to-filename #[(fileref) "r\305 q\210\306\211\203* \204*\n@ !\211\203\"\307\f!\203\"\f)\nA\211\204 \310\311!\2035\312\313 \"\210 +\207" [matlab-shell-mref-converters ans C fileref tmp matlab-shell-active-p nil file-exists-p called-interactively-p any message "Found: %S"] 4 (#$ . 48128) "sFileref: "]) #@127 Find file EF in other window and to go line EL and 1-basec column EC. If DEBUG is non-nil, then setup GUD debugging features. (defalias 'matlab-find-other-window-file-line-column #[(ef el ec &optional debug) "\306!\211\204 \307\310\"\210\311 !\210eb\210\312\n!Sy\210 \203(\313 \312\n!B\314 \210\312 !\211\315V\2055 Su)\207" [ef ef-converted el debug gud-last-frame ec matlab-shell-mref-to-filename error "Failed to translate %s into a filename" find-file-other-window string-to-number buffer-file-name gud-display-frame 0] 4 (#$ . 48711)]) #@69 Find other window using matlab URL and optionally set DEBUG cursor. (defalias 'matlab-find-other-window-via-url #[(url &optional debug) "\306\307\"\203$\310\224\310\225O\311\224\311\225O\312\224\312\225O\313 \n \f$+\207\306\314\"\203H\310\224\310\225O\311\224\311\225O\312\224\312\225O\313 \n \f$+\207\306\315\"\205\\\316\317 !\310\224\310\225O\320P\"\207" [url ec el ef debug gud-comint-buffer string-match "^error:\\(.*\\),\\([0-9]+\\),\\([0-9]+\\)$" 1 2 3 matlab-find-other-window-file-line-column "opentoline('\\([^']+\\)',\\([0-9]+\\),\\([0-9]+\\))" "^matlab:*\\(.*\\)$" process-send-string get-buffer-process "\n"] 5 (#$ . 49265)]) #@144 In the MATLAB interactive buffer, find the last MATLAB error, and go there. To reference old errors, put the cursor just after the error text. (defalias 'matlab-shell-last-error #[nil "\3052?\306\307!\211\203\310!\210\311\305\312\"\202=\212\312\210\313e!\211\204'\314\315!\210\316 8\317 8\320 8\2064\321\322\f \n#-)0\207" [url err ec el ef done matlab-shell-previous-matlab-url t matlab-find-other-window-via-url throw nil matlab-shell-scan-for-error error "No errors found!" 2 3 4 "0" matlab-find-other-window-file-line-column] 5 (#$ . 49929) nil]) #@45 Go to the error at the location of event E. (defalias 'matlab-shell-html-click #[(e) "\301!\210\302 \207" [e mouse-set-point matlab-shell-html-go] 2 (#$ . 50498) "e"]) #@42 Go to the error at the location `point'. (defalias 'matlab-shell-html-go #[nil "\301`!\211\205 \302!)\207" [url matlab-url-at matlab-find-other-window-via-url] 3 (#$ . 50673) nil]) #@17 Stop on errors. (defalias 'matlab-shell-dbstop-error #[nil "\300\301p!\302\"\207" [comint-send-string get-buffer-process "dbstop if error\n"] 3 (#$ . 50863) nil]) #@23 Don't stop on errors. (defalias 'matlab-shell-dbclear-error #[nil "\300\301p!\302\"\207" [comint-send-string get-buffer-process "dbclear if error\n"] 3 (#$ . 51032) nil]) #@15 MATLAB demos. (defalias 'matlab-shell-demos #[nil "\300\301p!\302\"\207" [comint-send-string get-buffer-process "demo\n"] 3 (#$ . 51209) nil]) #@25 Close any open figures. (defalias 'matlab-shell-close-figures #[nil "\300\301p!\302\"\207" [comint-send-string get-buffer-process "close all\n"] 3 (#$ . 51358) nil]) #@23 Close current figure. (defalias 'matlab-shell-close-current-figure #[nil "\300\301p!\302\"\207" [comint-send-string get-buffer-process "delete(gcf)\n"] 3 (#$ . 51530) nil]) #@128 Sync matlab-shell `default-directory' with MATLAB's pwd. These will differ when MATLAB code directory without notifying Emacs. (defalias 'matlab-shell-sync-buffer-directory #[nil "\300\301p!\302\"\207" [comint-send-string get-buffer-process "emacscd%%\n"] 3 (#$ . 51710) nil]) #@20 Exit MATLAB shell. (defalias 'matlab-shell-exit #[nil "\300\301p!\302\"\210\303\304!\207" [comint-send-string get-buffer-process "exit\n" kill-buffer nil] 3 (#$ . 51993) nil]) #@53 Switch to the buffer containing the matlab process. (defalias 'matlab-show-matlab-shell-buffer #[nil "\302\302Q\303 !\203\304 !\202\305\306!)\207" [matlab-shell-buffer-name msbn "*" get-buffer switch-to-buffer-other-window message "There is not an active MATLAB process."] 3 (#$ . 52175) nil]) #@54 Keep track of parameters passed to the MATLAB shell. (defvar matlab-shell-save-and-go-history '("()") (#$ . 52481)) #@363 Command to use for `matlab-shell-save-and-go' instead of current buffer. This command will override the default computed command if non-nil. The command will be run in the shell's current directory without checks, so you will need to make sure MATLAB's pwd is correct. It is recommended you use directory-local or buffer-local variable settings to control this. (defvar matlab-shell-save-and-go-command nil (#$ . 52604)) (byte-code "\300\301!\210\302\301\303\304#\207" [make-variable-buffer-local matlab-shell-save-and-go-command put safe-local-variable stringp] 4) #@82 Remember if it is safe to use `matlab-shell-save-and-go-command' in this buffer. (defvar matlab-shell-save-and-go-command-enabled nil (#$ . 53176)) (byte-code "\300\301!\210\302\303\304\305#\207" [make-variable-buffer-local matlab-shell-save-and-go-command-enabled put matlab-shell-save-and-go-command risky-local-variable t] 4) #@104 Set `matlab-shell-save-and-go-command' for any file in the current directory. Value is set to COMMAND. (defalias 'matlab-shell-set-save-and-go-command #[(command) "\302=\204 \303\304\"\210\305\302\306 #\207" [major-mode command matlab-mode error "Cannot set save-and-go command for buffer in %s" add-dir-local-variable matlab-shell-save-and-go-command] 4 (#$ . 53512) (list (read-string "sCommand: " (file-name-sans-extension (file-name-nondirectory (buffer-file-name)))))]) #@110 Add STRING to the input-ring and run `comint-input-filter-functions' on it. Similar to `comint-send-input'. (defalias 'matlab-shell-add-to-input-history #[(string) " !\203$\n\203\306 !\203\307 !\204\310 \311\" \230\204$\312 \"\210\313\314 \315P\"\210\316\305!\2033\f\317\211\207" [comint-input-filter string comint-input-ignoredups comint-input-ring comint-input-ring-index comint-save-input-ring-index ring-p ring-empty-p ring-ref 0 ring-insert run-hook-with-args comint-input-filter-functions "\n" boundp nil] 4 (#$ . 53997)]) #@54 Save this M file, and evaluate it in a MATLAB shell. (defalias 'matlab-shell-save-and-go #[nil "\306=\204\n\307\310!\210\311p!\204\312\313!\210\314\315\311 !!\316\n\316Q\317 \203 89\206=8 \230\206=\320\321\3228 #!\211:\203~\323\3179\324 !\204V\325 \204V\326 \210\324 !\203w\327 \317\"\203m\330\327 \317\"!\210\202t\331\316\n\316Q!\210db\210\3328\333P!\210*\f\205\\\334\335 !!\211;<=>\336?\337 \210\212eb\210\323\210\340\341!\210\342\343!)\203\263\344\345&@\346#?\324 !\204\301\325 \204\301\326 \210\324 !\203\342\327 \317\"\203\330\330\327 \317\"!\210\202\337\331\316\n\316Q!\210db\210\347\350\351\"\210>\203\324 !\203;@\230\204\332\352;\353Q!\210 \354?Q8\3558!\210\3568\333P!)\202[\357A\360\361?A#\211A\205:\362\363\317\211?$?\364A\\A\202B\365; \361?\336\230\203L\336\202Q\366?\361Q\367\2608\3328!+,+\207" [major-mode fn-name matlab-shell-buffer-name msbn do-local matlab-shell-save-and-go-command matlab-mode error "Save and go is only useful in a MATLAB buffer!" buffer-file-name call-interactively write-file file-name-sans-extension file-name-nondirectory "*" t y-or-n-p format "Run \"%s\" instead of %s? " nil get-buffer matlab-netshell-active-p matlab-shell get-buffer-window select-window switch-to-buffer-other-window matlab-shell-send-command "\n" expand-file-name file-name-directory "" save-buffer forward-sexp -1 looking-at "([a-zA-Z]" read-string "Parameters: " matlab-shell-save-and-go-history mapc #[(e) "\302@ \"\205\303\304\305A\"\306\211 $\202\207" [e dir string-match replace-match format "', char(%s), '" t] 5] (("ô" . "244") ("é" . "233") ("è" . "232") ("à" . "224")) "emacscd(['" "'])" " " matlab-shell-add-to-input-history matlab-shell-send-string 0 string-match "'" replace-match "''" 2 "emacsrun('" ", '" ")" cmd matlab-shell-save-and-go-command-enabled use dir edir matlab-change-current-directory change-cd param default-directory match tmp] 8 (#$ . 54546) nil]) #@32 Run the cell the cursor is in. (defalias 'matlab-shell-run-cell #[nil "\212\303\304!\210\305\306!\203\307\310!\210\311\312!\211@)\313=\203$\314 \210\315\210\312u\210`)\212\303\312!\210\311\312!\211@)\313=\203=\316 \210\304u\210`)\317\n \320#*\207" [lvl1 end start forward-page -1 looking-at "function" error "You are not in a cell. Try `matlab-shell-save-and-go' instead" matlab-compute-line-context 1 comment matlab-end-of-command nil beginning-of-line matlab-shell-run-region t] 5 (#$ . 56530) nil]) #@157 Run region from BEG to END and display result in MATLAB shell. pIf region is not active run the current line. This command requires an active MATLAB shell. (defalias 'matlab-shell-run-region-or-line #[nil "\203 \203\302\303 `\"\207\302\304 \305 \"\207" [transient-mark-mode mark-active matlab-shell-run-region mark matlab-point-at-bol matlab-point-at-eol] 3 (#$ . 57049) nil]) #@181 Run region from BEG to END and display result in MATLAB shell. If NOSHOW is non-nil, replace newlines with commas to suppress output. This command requires an active MATLAB shell. (defalias 'matlab-shell-run-region #[(beg end &optional noshow) " V\203\306 \n)\307 #\306\211\310\311 \203*\312!\210\202V\212\313 \211q\210\314 \204;\315\316!\210\317 \210\320!\210`\321 {`\321 |\210\322!\210 c\210)\323 \211\205jq\210db\210\324\325\",\207" [beg end mid noshow inhibit-field-text-motion lastcmd nil matlab-shell-region-command t matlab-netshell-active-p matlab-netshell-eval matlab-shell-buffer-barf-not-running matlab-on-prompt-p error "MATLAB shell must be non-busy to do that" beginning-of-line re-search-forward matlab-point-at-eol matlab-shell-send-string matlab-shell-active-p display-buffer ((display-buffer-reuse-window display-buffer-at-bottom) (reusable-frames . visible)) msbn command comint-prompt-regexp] 5 (#$ . 57438) "r"]) #@206 Convert the region between BEG and END into a MATLAB command. Picks between different options for running the commands. Optional argument NOSHOW specifies if we should echo the region to the command line. (defalias 'matlab-shell-region-command #[(beg end &optional noshow) "\305=\2033\306 \n\"\211\307W\203\310 \n\f#\2021\311\312p!!\203,\313 \210\314 \n\f#\2021\315 \n\f#)\207 \n\f#\207" [matlab-shell-run-region-function beg end cnt noshow auto count-lines 2 matlab-shell-region->commandline file-exists-p buffer-file-name save-buffer matlab-shell-region->internal matlab-shell-region->script] 5 (#$ . 58414)]) #@150 Convert the region between BEG and END into a MATLAB command. Squeeze out newlines. When NOSHOW is non-nil, suppress output by adding ; to commands. (defalias 'matlab-shell-region->commandline #[(beg end &optional noshow) " {\306P\307\310\311\"r q\210\312\216\nc\210eb\210\313\314\315\311#\2033\315\316\317`!8)\204`S\320 |\210\202\321ed\"+\322\323\n\"\203O\n\324\211\224O\n\324\225\315OP\2029\322\325\n\"\203e\n\324\211\224O\n\324\225\315OP\202O \203\225\322\326\327!\330Q\n\"\203\200\331\332\311\211\n$\202i\322\306\n\"\203\221\331\333\311\211\n$\202\200\n\306P\n)\207" [beg end str #1=#:temp-buffer incomplete noshow "\n" generate-new-buffer " *temp*" t #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] search-forward "%" nil 3 syntax-ppss matlab-point-at-eol buffer-substring-no-properties string-match "^\\s-*\n" 0 "\\s-\\s-+" "\\s-*" regexp-quote "\\s-*\n" replace-match " " ", " matlab-elipsis-string] 5 (#$ . 59042)]) #@235 Create a command to run the region between BEG and END. Uses internal MATLAB API to execute the code keeping breakpoints and local functions active. Optional argument NOSHOW specifies if we should echo the region to the command line. (defalias 'matlab-shell-region->internal #[(beg end &optional noshow) "S\305 !\306\307\n\"\203$\212 b\210 \310e`\"\\b\210\310e`\"\\))\311\312\f\313p! %\207" [end buffer-file-coding-system enc-str beg matlab-shell-internal-emacsrunregion symbol-name string-match "\\script #[(beg end &optional noshow) "\306\307!\210\310e\"\310\n\"\311\312\313 !!p\f\314\315 !\314\315 !\260(\316\n\")\317(\320P!*\321+\322p!,r*q\210eb\210\323+!\203Med|\210edU\204W\324\325!\210+\326)\327\261\210eb\210,\330-\211.\203\244.@-\212\331\332-!\330\333#\203\232\334- \"/db\210\335\332-!\326\261\210/c\210\327c\210)).A\211.\204n*\336 \210\337 \210\340\341\342\330\343\313*!DE\"\210\344 \210)\345\346(!\347Q. \207" [beg start end len stem orig require semantic-matlab count-lines file-name-sans-extension file-name-nondirectory buffer-file-name "_" number-to-string buffer-substring-no-properties find-file-noselect ".m" "%% Automatically created temporary file created to run-region" matlab-semantic-get-local-functions-for-script looking-at error "Region extract to tmp file: Temp file not empty!" "\n\n" "\n%%\n" nil re-search-forward semantic-tag-name t matlab-semantic-tag-text "% Copy of " save-buffer accept-process-output add-hook matlab-shell-prompt-appears-hook lambda matlab-shell-cleanup-extracted-region kill-buffer "run('" expand-file-name "')\n" newf bss buff intro functions F --dolist-tail-- ft] 8 (#$ . 60609) "r"]) #@140 Cleanup the file created when we previously extracted a region. Argument FNAME specifies if we should echo the region to the command line. (defalias 'matlab-shell-cleanup-extracted-region #[(fname) "\3011\f\302!0\210\202 \210\303\304\305\306\307DE\"\207" [fname (error) delete-file remove-hook matlab-shell-prompt-appears-hook lambda nil matlab-shell-cleanup-extracted-region] 6 (#$ . 62207)]) #@60 Find the file clicked on with event E on the current path. (defalias 'matlab-find-file-click #[(e) "\302!\210\303 \211\204\304\305!\210\306 !)\207" [e f mouse-set-point matlab-read-word-at-point error "To find an M file, click on a word" matlab-shell-locate-fcn] 3 (#$ . 62611) "e"]) (provide 'matlab-shell)