Re: [Matlab-emacs-discuss] matlab-shell segfaults with matlab R2016b on Mac OS 10.11.6 Emacs 25.1

2016-11-18 Thread Peter Mao
Further evidence (I hope this helps someone solve the problem):

1. 2016b works in NONE of the emacs terminals: shell, term or e-shell.
2. 2016b works fine (even with -nodesktop) from Xquartz's xterm or OSX's
terminal
3. 2016a works fine in emacs
4. Running diff on the java directories (where the potentially offending
files reside) shows NO difference between 2016a and 2016b!
$ diff -ur /Applications/MATLAB_R2016b.app/sys/java
/Applications/MATLAB_R2016a.app/sys/java

This might not be a Java issue.

On Thu, Nov 10, 2016 at 7:37 PM, Peter Mao  wrote:

> Yes, I'm seeing this problem, too.  Mathworks won't touch it, as it does
> seem to be a real third party issue with Emacs.
>
> I'm having the problem with OSX 10.12 and Emacs 25.1.1, although it was
> also present with my previous emacs (24.5?).
>
> I checked the environment variables, and the only thing I see
> significantly different is that emacs shell reports as TERM=dumb, while the
> Xquartz one is TERM=xterm and apple's terminal is TERM=xterm-256color.
>
> In all cases, the actual shell is /bin/bash.  I'm guessing this has
> something to do with how emacs is setting up the shell, but I can't figure
> out what the issue is, exactly.  May be time to cross post to emacs
> developers.
>
> Peter
>
--
___
Matlab-emacs-discuss mailing list
Matlab-emacs-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss


[Matlab-emacs-discuss] Feature request: Don't wait for a prompt

2016-11-18 Thread Csquared
Hello,
I like to mimic the behavior of f9 when I am editing an .m file.  So 
when I hit f9, I want the line to be sent to matlab and then I want to 
go to the next line in the buffer.   I believe matlab.el does not 
currently have a function that supports this behavior.  To get part of 
this behavior I created the following lisp function which I would bind to f9
(defun my-matlab-shell-run-region ()
"Runs shell command"
;(implement-debug-on-entry)
(interactive)
(setq mybuf (buffer-name))
(matlab-shell-run-region-or-line)
(switch-to-buffer mybuf)
(next-line)
)
This works great until I step across a region of code that matlab.el 
recognizes as a block.  If I press f9 once entering this block, 
matlab-run-region issues an error about the shell being busy.  Then I 
have to copy and paste the rest of the block manually.  I would rather 
have the option that the code be sent to matlab and a warning issued.  
Octave-mode already has this feature, without the warning. Below is the 
modification I made to matlab-shell-run-region.
--- a/matlab.el
+++ b/matlab.el
@@ -5212,15 +5212,19 @@ This command requires an active MATLAB shell."
 (setq msbn (matlab-shell-buffer-barf-not-running))
 (set-buffer msbn)
 (if (not (matlab-on-prompt-p))
-   (error "MATLAB shell must be non-busy to do that"))
-   ;; Save the old command
-   (beginning-of-line)
-   (re-search-forward comint-prompt-regexp)
-   (setq lastcmd (buffer-substring (point) (matlab-point-at-eol)))
-   (delete-region (point) (matlab-point-at-eol))
-   ;; We are done error checking, run the command.
-   (matlab-shell-send-string command)
-   (insert lastcmd))
+   (progn
+ (matlab-shell-send-string command)
+ (message "Continue Entering Statement"))
+ (progn
+   ;; Save the old command
+   (beginning-of-line)
+   (re-search-forward comint-prompt-regexp)
+   (setq lastcmd (buffer-substring (point) (matlab-point-at-eol)))
+   (delete-region (point) (matlab-point-at-eol))
+   ;; We are done error checking, run the command.
+   (matlab-shell-send-string command)
+   (insert lastcmd)
+   )))
(set-buffer msbn)
(goto-char (point-max))
(display-buffer msbn nil "visible"))
-- 


--
___
Matlab-emacs-discuss mailing list
Matlab-emacs-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss