<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: EditorMacro v2 &#8211; setting Command Window key-bindings</title>
	<atom:link href="http://undocumentedmatlab.com/blog/editormacro-v2-setting-command-window-key-bindings/feed/" rel="self" type="application/rss+xml" />
	<link>http://undocumentedmatlab.com/blog/editormacro-v2-setting-command-window-key-bindings/</link>
	<description>Charting Matlab's unsupported hidden underbelly</description>
	<lastBuildDate>Thu, 09 Sep 2010 11:59:30 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Yair Altman</title>
		<link>http://undocumentedmatlab.com/blog/editormacro-v2-setting-command-window-key-bindings/comment-page-1/#comment-2261</link>
		<dc:creator>Yair Altman</dc:creator>
		<pubDate>Sat, 22 Aug 2009 19:47:28 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=518#comment-2261</guid>
		<description>@Jo - Here&#039;s a snippet of a sample macro (callback) function:

&lt;pre lang=&quot;matlab&quot;&gt;
function myCallback(jDocument, jEventData, varargin)
   filename = jDocument.getFilename;
   % do some user-defined stuff

   % Now save the file:
   com.mathworks.mlservices.MLEditorServices.saveDocument(filename);
end  % myCallback
&lt;/pre&gt;

Also look at Perttu&#039;s &lt;b&gt;&lt;i&gt;KeyBindings&lt;/i&gt;&lt;/b&gt; utility for other usage examples of MLEditorServices.

Yair</description>
		<content:encoded><![CDATA[<p>@Jo &#8211; Here&#8217;s a snippet of a sample macro (callback) function:</p>

<div class="wp_syntax"><div class="code"><pre class="matlab" style="font-family:monospace;"><span style="color: #0000FF;">function</span> myCallback<span style="color: #080;">&#40;</span>jDocument, jEventData, <span style="color: #0000FF;">varargin</span><span style="color: #080;">&#41;</span>
   filename = jDocument.<span style="">getFilename</span>;
   <span style="color: #228B22;">% do some user-defined stuff</span>
&nbsp;
   <span style="color: #228B22;">% Now save the file:</span>
   com.<span style="">mathworks</span>.<span style="">mlservices</span>.<span style="">MLEditorServices</span>.<span style="">saveDocument</span><span style="color: #080;">&#40;</span>filename<span style="color: #080;">&#41;</span>;
<span style="color: #0000FF;">end</span>  <span style="color: #228B22;">% myCallback</span></pre></div></div>

<p>Also look at Perttu&#8217;s <b><i>KeyBindings</i></b> utility for other usage examples of MLEditorServices.</p>
<p>Yair</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jo</title>
		<link>http://undocumentedmatlab.com/blog/editormacro-v2-setting-command-window-key-bindings/comment-page-1/#comment-2241</link>
		<dc:creator>jo</dc:creator>
		<pubDate>Fri, 21 Aug 2009 20:43:48 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=518#comment-2241</guid>
		<description>Thanks!
EditorMacro has been added to the startup.m file! :)
So far I&#039;ve created few macros that remarkably speed up my work. 
One of them is a macro that executes code between  tags embedded in a comment of an m-file - excellent alternative for Edit Run Configuration... + F5 combination during debugging an m-file, but... I cannot solve one problem: automatic saving file before run (eg. to activate fresh breakpoints).
Your post about internal commands gave me new hope. I&#039;ve made some trials to save m-file programmatically but without effect.

Do you know if such an action is possible from inside the macro?</description>
		<content:encoded><![CDATA[<p>Thanks!<br />
EditorMacro has been added to the startup.m file! <img src='http://undocumentedmatlab.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
So far I&#8217;ve created few macros that remarkably speed up my work.<br />
One of them is a macro that executes code between  tags embedded in a comment of an m-file &#8211; excellent alternative for Edit Run Configuration&#8230; + F5 combination during debugging an m-file, but&#8230; I cannot solve one problem: automatic saving file before run (eg. to activate fresh breakpoints).<br />
Your post about internal commands gave me new hope. I&#8217;ve made some trials to save m-file programmatically but without effect.</p>
<p>Do you know if such an action is possible from inside the macro?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
