<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Keep your code readable with smart indenting</title>
	<link>http://blogs.mathworks.com/desktop/2009/05/11/keep-your-code-readable-with-smart-indenting/</link>
	<description>Ken &#38; Mike work on the MATLAB Desktop team</description>
	<pubDate>Mon, 23 Nov 2009 00:47:48 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
		<item>
		<title>By: junziyang</title>
		<link>http://blogs.mathworks.com/desktop/2009/05/11/keep-your-code-readable-with-smart-indenting/#comment-6248</link>
		<dc:creator>junziyang</dc:creator>
		<pubDate>Mon, 18 May 2009 13:28:12 +0000</pubDate>
		<guid>http://blogs.mathworks.com/desktop/2009/05/11/keep-your-code-readable-with-smart-indenting/#comment-6248</guid>
		<description>Thanks, Mike. Greak symbols can be entered using a softkeyboard.I want to know how you enter the superscript 2?
Further more, It would be great if the Editor can translate LATEX symbols in the comments directly, just like when we enter "\alpha" etc. in a Figure's label.</description>
		<content:encoded><![CDATA[<p>Thanks, Mike. Greak symbols can be entered using a softkeyboard.I want to know how you enter the superscript 2?<br />
Further more, It would be great if the Editor can translate LATEX symbols in the comments directly, just like when we enter &#8220;\alpha&#8221; etc. in a Figure&#8217;s label.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://blogs.mathworks.com/desktop/2009/05/11/keep-your-code-readable-with-smart-indenting/#comment-6247</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Mon, 18 May 2009 11:41:35 +0000</pubDate>
		<guid>http://blogs.mathworks.com/desktop/2009/05/11/keep-your-code-readable-with-smart-indenting/#comment-6247</guid>
		<description>Junziyang,

 You can put symbols in comments. The editor supports whatever you system character encoding is, and thus can display whatever your font supports for a particular char. For instance, this is from my windows xp R2009a MATLAB, using the windows-1252 encoding:

&lt;img src="http://blogs.mathworks.com/images/desktop/ken_orr_smart_indenting/symbols.png"&gt;

Alternatively you can use LaTeX in a comment and publish the file, which is ideal for sharing your code with students: &lt;a href="http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_env/f6-30186.html#brrnpjv-1" rel="nofollow"&gt;http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_env/f6-30186.html#brrnpjv-1&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Junziyang,</p>
<p> You can put symbols in comments. The editor supports whatever you system character encoding is, and thus can display whatever your font supports for a particular char. For instance, this is from my windows xp R2009a MATLAB, using the windows-1252 encoding:</p>
<p><img src="http://blogs.mathworks.com/images/desktop/ken_orr_smart_indenting/symbols.png"/></p>
<p>Alternatively you can use LaTeX in a comment and publish the file, which is ideal for sharing your code with students: <a href="http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_env/f6-30186.html#brrnpjv-1" rel="nofollow">http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_env/f6-30186.html#brrnpjv-1</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: junziyang</title>
		<link>http://blogs.mathworks.com/desktop/2009/05/11/keep-your-code-readable-with-smart-indenting/#comment-6245</link>
		<dc:creator>junziyang</dc:creator>
		<pubDate>Sun, 17 May 2009 01:04:52 +0000</pubDate>
		<guid>http://blogs.mathworks.com/desktop/2009/05/11/keep-your-code-readable-with-smart-indenting/#comment-6245</guid>
		<description>Indent can make the CODE more readable. The readbility of the comments is also very important, I think. For example,the ability to input equations with Greak symbols, make them look more like what we see on the textbook.</description>
		<content:encoded><![CDATA[<p>Indent can make the CODE more readable. The readbility of the comments is also very important, I think. For example,the ability to input equations with Greak symbols, make them look more like what we see on the textbook.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://blogs.mathworks.com/desktop/2009/05/11/keep-your-code-readable-with-smart-indenting/#comment-6244</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Fri, 15 May 2009 17:35:47 +0000</pubDate>
		<guid>http://blogs.mathworks.com/desktop/2009/05/11/keep-your-code-readable-with-smart-indenting/#comment-6244</guid>
		<description>Eric, 

 Another interesting suggestion. I'll look into the pre thing.</description>
		<content:encoded><![CDATA[<p>Eric, </p>
<p> Another interesting suggestion. I&#8217;ll look into the pre thing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric</title>
		<link>http://blogs.mathworks.com/desktop/2009/05/11/keep-your-code-readable-with-smart-indenting/#comment-6243</link>
		<dc:creator>Eric</dc:creator>
		<pubDate>Fri, 15 May 2009 14:57:47 +0000</pubDate>
		<guid>http://blogs.mathworks.com/desktop/2009/05/11/keep-your-code-readable-with-smart-indenting/#comment-6243</guid>
		<description>Oops, my last line was meant to read "As an aside, why is an empty line after the 'closing pre' tag removed?"</description>
		<content:encoded><![CDATA[<p>Oops, my last line was meant to read &#8220;As an aside, why is an empty line after the &#8216;closing pre&#8217; tag removed?&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric</title>
		<link>http://blogs.mathworks.com/desktop/2009/05/11/keep-your-code-readable-with-smart-indenting/#comment-6242</link>
		<dc:creator>Eric</dc:creator>
		<pubDate>Fri, 15 May 2009 14:56:39 +0000</pubDate>
		<guid>http://blogs.mathworks.com/desktop/2009/05/11/keep-your-code-readable-with-smart-indenting/#comment-6242</guid>
		<description>Somewhat related, it would be nice for multiline array or cell definitions if the 2nd and following lines were aligned with the first character of the first element instead of the bracket.

Right now you get this:

&lt;pre&gt;
a = [ 1 2 3
____4 5 6
____7 8 9 ];
&lt;/pre&gt;

instead of this:
&lt;pre&gt;
a = [ 1 2 3
______4 5 6
______7 8 9 ];
&lt;/pre&gt;

Also, would it be possible to allow multiline array and cell definitions to fold? That would be great! As an aside, why is an empty line after the &lt;/pre&gt; tag removed?</description>
		<content:encoded><![CDATA[<p>Somewhat related, it would be nice for multiline array or cell definitions if the 2nd and following lines were aligned with the first character of the first element instead of the bracket.</p>
<p>Right now you get this:</p>
<pre>
a = [ 1 2 3
____4 5 6
____7 8 9 ];
</pre>
<p>instead of this:</p>
<pre>
a = [ 1 2 3
______4 5 6
______7 8 9 ];
</pre>
<p>Also, would it be possible to allow multiline array and cell definitions to fold? That would be great! As an aside, why is an empty line after the 
</p><p> tag removed?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://blogs.mathworks.com/desktop/2009/05/11/keep-your-code-readable-with-smart-indenting/#comment-6238</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Wed, 13 May 2009 17:02:45 +0000</pubDate>
		<guid>http://blogs.mathworks.com/desktop/2009/05/11/keep-your-code-readable-with-smart-indenting/#comment-6238</guid>
		<description>V, 

 That is correct, this auto-aligning is not possible. We just added the &lt;code&gt;pre&lt;/code&gt; instructions a few minutes ago. :)</description>
		<content:encoded><![CDATA[<p>V, </p>
<p> That is correct, this auto-aligning is not possible. We just added the <code>pre</code> instructions a few minutes ago. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: V</title>
		<link>http://blogs.mathworks.com/desktop/2009/05/11/keep-your-code-readable-with-smart-indenting/#comment-6237</link>
		<dc:creator>V</dc:creator>
		<pubDate>Wed, 13 May 2009 16:08:19 +0000</pubDate>
		<guid>http://blogs.mathworks.com/desktop/2009/05/11/keep-your-code-readable-with-smart-indenting/#comment-6237</guid>
		<description>Yep, your first and third examples are what I tried to convey without fixed width font.  Apparently I missed the pre tag section for my last post!

Unfortunately, your response indicates that such automatic alignment isn't possible yet :(</description>
		<content:encoded><![CDATA[<p>Yep, your first and third examples are what I tried to convey without fixed width font.  Apparently I missed the pre tag section for my last post!</p>
<p>Unfortunately, your response indicates that such automatic alignment isn&#8217;t possible yet :(</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://blogs.mathworks.com/desktop/2009/05/11/keep-your-code-readable-with-smart-indenting/#comment-6236</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Wed, 13 May 2009 13:24:18 +0000</pubDate>
		<guid>http://blogs.mathworks.com/desktop/2009/05/11/keep-your-code-readable-with-smart-indenting/#comment-6236</guid>
		<description>V,

 That's a good suggestion. Of course you can imagine in addition to those two you might have:
&lt;pre&gt;&lt;code&gt;
some_function(arg1,...
______________arg2,...
______________arg3);
&lt;/code&gt;&lt;/pre&gt;
or even,
&lt;pre&gt;&lt;code&gt;
some_function(arg1,...
__________________arg2,...
__________________arg3);
&lt;/code&gt;&lt;/pre&gt;
and so on. Also if it's property value pair as the input maybe you'd want:
&lt;pre&gt;&lt;code&gt;
some_function('prop',val,...
______________'prop2',val2,...
&lt;/code&gt;&lt;/pre&gt;
Mike</description>
		<content:encoded><![CDATA[<p>V,</p>
<p> That&#8217;s a good suggestion. Of course you can imagine in addition to those two you might have:</p>
<pre><code>
some_function(arg1,...
______________arg2,...
______________arg3);
</code></pre>
<p>or even,</p>
<pre><code>
some_function(arg1,...
__________________arg2,...
__________________arg3);
</code></pre>
<p>and so on. Also if it&#8217;s property value pair as the input maybe you&#8217;d want:</p>
<pre><code>
some_function('prop',val,...
______________'prop2',val2,...
</code></pre>
<p>Mike</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: V</title>
		<link>http://blogs.mathworks.com/desktop/2009/05/11/keep-your-code-readable-with-smart-indenting/#comment-6235</link>
		<dc:creator>V</dc:creator>
		<pubDate>Wed, 13 May 2009 03:26:13 +0000</pubDate>
		<guid>http://blogs.mathworks.com/desktop/2009/05/11/keep-your-code-readable-with-smart-indenting/#comment-6235</guid>
		<description>Speaking of indentation, is there a way for MATLAB to vertically align function arguments in a multi-line context?

For example, let's say some_function() takes in three arguments:

some_function('arg1', 'arg2', 'arg3')

If I place each argument on their own line, smart indent indents by "one level" for each subsequent line instead of ensuring each argument is aligned vertically.

some_function('arg1', ...
__indent__'arg2', ...
__indent__'arg3');

This usually results in 'arg1' not lining up with the other arguments.  My current workaround is to place even the first argument on it's own line for readability/sanity.

some_function( ...
__indent__'arg1', ...
__indent__'arg2', ...
__indent__'arg3');

I'd love to learn of a way to correctly vertically align arguments like in emacs and vim.  Unfortunately, I don't know how to turn on M-lint in those editors!</description>
		<content:encoded><![CDATA[<p>Speaking of indentation, is there a way for MATLAB to vertically align function arguments in a multi-line context?</p>
<p>For example, let&#8217;s say some_function() takes in three arguments:</p>
<p>some_function(&#8217;arg1&#8242;, &#8216;arg2&#8242;, &#8216;arg3&#8242;)</p>
<p>If I place each argument on their own line, smart indent indents by &#8220;one level&#8221; for each subsequent line instead of ensuring each argument is aligned vertically.</p>
<p>some_function(&#8217;arg1&#8242;, &#8230;<br />
__indent__&#8217;arg2&#8242;, &#8230;<br />
__indent__&#8217;arg3&#8242;);</p>
<p>This usually results in &#8216;arg1&#8242; not lining up with the other arguments.  My current workaround is to place even the first argument on it&#8217;s own line for readability/sanity.</p>
<p>some_function( &#8230;<br />
__indent__&#8217;arg1&#8242;, &#8230;<br />
__indent__&#8217;arg2&#8242;, &#8230;<br />
__indent__&#8217;arg3&#8242;);</p>
<p>I&#8217;d love to learn of a way to correctly vertically align arguments like in emacs and vim.  Unfortunately, I don&#8217;t know how to turn on M-lint in those editors!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
