From: David C. <dav...@fr...> - 2011-12-12 13:40:30
|
Ok I understand a little bit better how everything is supposed to be working now. In fact, I think there are minor problems in the function matlab-shell-mode of matlab.el and the GUD functions should be mapped as follows: (gud-def gud-finish "dbstep out" "\C-f" "Finish executing current function.") (gud-def gud-up "dbup(%p)" "<" "Up N stack frames (numeric arg).") (gud-def gud-down "dbdown(%p)" ">" "Down N stack frames (numeric arg).") On a related (but cosmetic) note, there are problems with hyperlinks when using dbup and dbdown. The matlab-shell window shows hyperlinks of the kind: In workspace belonging to file>function at line But when you click on it, it creates buffer named "workspace belonging to" and doesn't lead anywhere. Furthermore, hyperlinks also do not work with "dbstack", although the behaviour is different from that with "dbup" and "dbdown". On top of the above, I believe "dbquit" should be mapped to "gud-stop-subjob" (please anyone correct me, I'm really kind of guessing here !) At last we might also want to add to the list: (gud-def gud-until "d bstop at %l in %f; dbcont; dbclear at %l in %f" "Run until cursor or first breakpoint") Cheers, David. _____ From: David Chappaz [mailto:dav...@fr...] Sent: 09 December 2011 14:39 To: 'Eric Ludlam'; 'mat...@li...' Subject: RE: [Matlab-emacs-discuss] Matlab-Shell & Sun Grid Engine Brilliant, Eric !! Many thanks for your help. I think I'm making good progress in configuring matlab-emacs and getting used to it :-) A few more questions, if I may, because I'm really not a GUD expert. EmacsLink (and most debuggers) provides - "matlab-eei-step-out" to finish the execution of the current function, and stop. My understanding is that "gud-finish" should do the same, but for me it just invokes "dbquit" and stops there. - "matlab-eei-go-until-cursor" but although there seems to be a "gud-until" in gud.el, emacs just doesn't know this function at all (M-x gud-until can't be invoked). Any clue what the problem is ? - "matlab-eei-exit-debug" to stop the current session. My understanding is that "gud-stop-subjob" should do the same, but I only get the following string echoed in the matlab-shell window: "M-x g u d - s t o p - s u b j o b RET". At last, I think I have identified a subtle problem with hyperlinks. If I start debugging a script, and go step by step, the matlab-shell window properly shows hyperlinks with the line number, followed by the line of code. That works fine. Now say I click on any of the above hyperlinks (without quitting the debugging session), it brings me back to the source code as expected. But if I start stepping through my code again, then the hyperlinks are not parsed correctly any more, and I get something like: <a href="matlab: opentoline('~/matlab/peri.m',106,1)">106 </a>end That's a bit cosmetic really, but it looks like following the hyperlink in the first place broke something. Thanks in advance for any help you can provide on the GUD functions ! Cheers, David. _____ From: Eric Ludlam [mailto:Eri...@ma...] Sent: 09 December 2011 13:49 To: David Chappaz; mat...@li... Subject: RE: [Matlab-emacs-discuss] Matlab-Shell & Sun Grid Engine Hi, for (1), there is a function called : matlab-with-emacs-link you can use. (if (matlab-with-emacs-link) (define-key .) (define-key.) for (2), that's the way it has always worked. The keybindings, however, work in any MATLAB buffer as long as matlab-shell-enable-gud-flag is set, which is t by default. for (3), I think I've seen that reported, but not seen it myself. Your repro steps, however, were good so now I see the problem. On line 4925 the variable 'limitpos' is being set to something based on characters in the line, including the period. That means if you complete: mystruct.plotmat <TAB> it will complete ok without saying mystruct.plotmatmystruct.plotmatrix Unfortunately, when you complete for edit, the return completed file name has a . in it. To fix this, we'd have to add a little hack to know it was completing for 'edit' specifically, and to ignore the . I suppose an alternative would be to take the completion string, and search for the matching substring in the replacement string, and replace only that. I don't think there is a utility in Emacs that matches like that. (4) - the figure focus thing is annoying. The problem here is just MATLAB doesn't know where the command line is, so can't give focus back. I don't know how to fix that. (5) - matlab-shell-run-region runs the region, but gud-print I think picks some symbol under point to evaluate. I use run region to highlight a bunch of lines to run. Eric |