# [texworks] Early thoughts

Will Robertson wspr81 at gmail.com
Thu Sep 18 14:17:53 CEST 2008

Hello,

Now there's a mailing list for TeXworks (which nobody told me about!)
I don't feel so bad about posting suggestions for the program :) What
follows is a serious "wish" list in that while I wish it was there,
I'm still going to use the program without these features.

I'm trying hard not to suggest ideas that would complexify the program.

I'll omit bugs and behaviour that could be improved in favour of the
bug tracker…whenever I get around to doing that.

(1) The UI can be simplified! The following items should be dropped
preferences:
- "Font…"
- "Wrap lines"
- "Syntax Coloring"

(2) I'd really like the Find/Replace panels to be merged :)

(3) Filtering the list of "Processing tools" (pdfLaTeX, etc.) could be
done quite reliably to omit options that don't make sense. E.g.,

Matches ^\\usepackage([.*])?{fontspec} (etc.) -> XeLaTeX
Matches ^\\usepackage([.*])?{microtype} (etc.) -> pdfLaTeX
None of the above & matches ^\\bye -> Plain
Matches ^\\bibliography\{ -> BibTeX

You'd only need a very small number of regexps, I think, to match the
majority of cases most of the time. And this would simply things in
the UI very nicely.

For the people that will complain that it doesn't work in their tiny,
specific, edge case, just offer an option to turn off the filtering.
(Or a secret preference to edit the filtering regexps.)

(4) Syntax colouring for LaTeX3 would be nice, but I won't hold my
breath unless I write it :) (This basically entails treating _ and :
as part of macro names whenever you're inside a file that contains
\ProvidesExplPackage (or Class))

(5) As well as command completion, I'd like automatic trigger stuff.
E.g., typing \begin{ on an otherwise empty line would immediately
insert an \end{ on the next line and then fill in both environment
delimiters at the same time as you typed the name of the environment.
Editing one of them would edit the other, simultaneously.

(6) Smart <return> behaviour.
- Match the indentation of the previous line
- To generalise this idea, match the "prefix" of the previous line,
such as "[%]*[ ]*" or even "%<[a-zA-Z]*>[ ]*" (for .dtx files)
- Increase the indentation when the previous line contains
\begin{([a-zA-Z]*)} but doesn't contain \end{\1}
- Increase the indentation when the previous line ends with {
- Hitting delete after a smart indentation or a smart line prefix
insertion would undo the "smart whatever" rather than just backspacing
a key.

Better get back to work.
Sorry for the ramble!

Will