On Mon, Jul 18, 2011 at 5:14 PM, abp <abp...@googlemail.com> wrote:
> Why is it necessary to press TAB at all? Couldn't auto-indent be the
> default for a line and only manually reindented lines opt-out until
> one opts in again using TAB or something?

This is an interesting thought. On the other hand, when lines are
merged or split, where does this status go? I'm thinking when a line
is split the second of the two resulting lines should start out
indented correctly relative to the first, and inherit the first's
status; when two lines are merged, the status of the first of the two
becomes the status of the merged line. This is consistent with the
status being an invisible metacharacter at the start of the line that
is deleted with the immediately preceding newline and cloned if enter
is hit in the middle of that line.

What about multi-line pastes? If the paste is of material cut or
copied from inside clooj, the status of each line that was cut or
copied would be stored OOB somewhere and used for the paste. (Actually
using funny extra characters inline in the copied material has
problems if material is copied from clooj and pasted into something
else, such as a post to this list.) From outside clooj? Some sensible
default, such as autoindent off (keep paste's formatting) or on
(auto-fix to context). Maybe let the user choose either in an options
screen.

Saving the state across sessions also seems to need to be OOB. Putting
it in the .clj file at the start of each line would gum up other
tools, and adding clooj-internal comments to source files isn't much
better. A clooj.dat file in the project root?

Alternatively, avoid the mess and just always maintain
structure-determined indent of all lines at all times. Does anyone
really want fully user-controlled indenting outside of comments
anyway? Spaces and tabs in the indent can just jump you to the start
of the forms on the line, and self-insert normally in string literals
and in ; comments, and single spaces normally anywhere (maybe turn
tabs into spaces and tab or space next to a space just moves you to
the right of the space).

Or, the traditional thing: full control, but tab or something will
reindent the current line, or all lines intersecting the selection if
any, to structurally-correct positions based on all of the code above,
if tab is hit outside a string literal or ; comment.

-- 
Protege: What is this seething mass of parentheses?!
Master: Your father's Lisp REPL. This is the language of a true
hacker. Not as clumsy or random as C++; a language for a more
civilized age.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to