<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Approximatrix Forums — indent file]]></title>
	<link rel="self" href="https://forums.approximatrix.com/extern.php?action=feed&amp;tid=369&amp;type=atom" />
	<updated>2014-09-23T20:44:58Z</updated>
	<generator>PunBB</generator>
	<id>https://forums.approximatrix.com/viewtopic.php?id=369</id>
		<entry>
			<title type="html"><![CDATA[Re: indent file]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=1517#p1517" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>Problem is, though, where exactly to break a line.</p></blockquote></div><p>That&#039;s the problem I was referring to.&nbsp; Algorithmically speaking, it&#039;s simple enough to just split a line exceeding the length limit in an acceptable (from a strict standards point of view) position.&nbsp; The problem actually becomes where to do it that it makes sense from a human perspective.&nbsp; You could probably set some arbitrary rules, but there are so many edge cases.&nbsp; </p><p>For example, what if a continuation already exists, and 4 characters exist on the continued line.&nbsp; When Smart Indent runs, it finds that the first line is now too long again and continues it on a second line, but there&#039;s already a third line.&nbsp; Something along the lines of (and this is purely an example):</p><div class="codebox"><pre><code>         WRITE (1000, 1200) &quot;Here&#039;s a string with some output variables&quot;, X, Y, Z,
     .                      A, B ,C</code></pre></div><p>Smart Indent with automatic wrapping, however, might do something like:</p><div class="codebox"><pre><code>                 WRITE (1000, 1200) &quot;Here&#039;s a string with some output variables&quot;, 
     &amp;           X, Y, Z,
     .                      A, B ,C</code></pre></div><p>The above is just an example (I probably got the columns wrong), but it shows why automatically wrapping is probably a bad idea.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2014-09-23T20:44:58Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=1517#p1517</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: indent file]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=1516#p1516" />
			<content type="html"><![CDATA[<p>Are the continuation rules for, <br />&nbsp; &nbsp;(1)&nbsp; &#039;&amp;&#039; at the end of a line or <br />&nbsp; &nbsp;(2)&nbsp; &#039;C&#039; in character position 1..</p><p>..strictly restricted to .for and .f90/.f95 code, or are they interchangeable?</p><p>I&#039;ve neither experimented with thjs nor even ever used the &#039;&amp;&#039; continuation method - though I really should start doing so.<br />If that can be used in all flavours of FORTRAN then my suggestion would be to adopt it for linewraps in auto-indenting.</p><p>Problem is, though, where exactly to break a line.&nbsp; <br />I&#039;m sure most of us do this just before or just after = signs or + - * / arithmetic operators, or // concatenation symbols, and try always to do it outside not inside quoted strings, etc, but there must be a lot of rules that need to be thought up to make this automatic.</p><p>Another way might be deliberately to trigger an error, eg by wrapping the line without a line-wrap instructio, or perhaps better by not doing so but inserting instead an extra line with an illegal character, to force a compile error that will bring the user straight to each place where line-wrap is needed.&nbsp; This might me made optional.<br />--- <br />J.</p>]]></content>
			<author>
				<name><![CDATA[JohnWasilewski]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=102</uri>
			</author>
			<updated>2014-09-23T15:33:10Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=1516#p1516</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: indent file]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=1514#p1514" />
			<content type="html"><![CDATA[<p>I did want to point out that the Smart Indent feature will not automatically wrap lines when necessary after performing indentation.&nbsp; When using the feature, lines may exceed the Fortran column limit, especially under fixed-format Fortran.&nbsp; I struggled a bit with whether the feature should provide automatic wrapping, but I think that handling the line continuation might best be left to the user as the automatic process may lead to some &quot;ugly&quot; continuation placement.</p><p>Any thoughts from users?</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2014-09-23T13:24:04Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=1514#p1514</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: indent file]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=1509#p1509" />
			<content type="html"><![CDATA[<p>Great work! Thanks!</p>]]></content>
			<author>
				<name><![CDATA[a2182008]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3573</uri>
			</author>
			<updated>2014-09-23T06:44:23Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=1509#p1509</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: indent file]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=1504#p1504" />
			<content type="html"><![CDATA[<p>I just wanted to point out that this feature will be present in version 2.16.&nbsp; It is currently working for free-format Fortran, and fixed-format Fortran support is being implemented right now.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2014-09-12T14:04:47Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=1504#p1504</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: indent file]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=1501#p1501" />
			<content type="html"><![CDATA[<p>Sorry, I didn&#039;t understand your original description of &quot;indent whole file.&quot;&nbsp; It should be relatively easy and safe to implement.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2014-09-08T13:42:50Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=1501#p1501</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: indent file]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=1500#p1500" />
			<content type="html"><![CDATA[<p>Indent - simple adds [Tab] as for now. I mean smart tabs (line <a href="http://www.emacswiki.org/SmartTabs)">http://www.emacswiki.org/SmartTabs)</a></p>]]></content>
			<author>
				<name><![CDATA[a2182008]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3573</uri>
			</author>
			<updated>2014-09-08T04:33:02Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=1500#p1500</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: indent file]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=1496#p1496" />
			<content type="html"><![CDATA[<p>There isn&#039;t an explicit menu option, but one could use &quot;Select All&quot; (Control-A) and then simply hit the Tab key to indent a whole file.</p><p>I agree, though.&nbsp; A &quot;beautifier&quot; feature would certainly be nice to have.&nbsp; I&#039;ll have a look at how it can be done.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2014-09-05T14:05:54Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=1496#p1496</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[indent file]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=1495#p1495" />
			<content type="html"><![CDATA[<p>Hello!</p><p>Feature request - add &quot;indent whole file&quot; menu.<br />Or even better like in slickedit <a href="http://www.slickedit.com/products/slickedit/cool-features/#xmlhtml">http://www.slickedit.com/products/slick … s/#xmlhtml</a></p><p>Thank you</p>]]></content>
			<author>
				<name><![CDATA[a2182008]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3573</uri>
			</author>
			<updated>2014-09-05T13:03:56Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=1495#p1495</id>
		</entry>
</feed>
