Re: [q-lang-users] New 'where' syntax
Brought to you by:
agraef
From: Albert G. <Dr....@t-...> - 2007-05-26 18:59:55
|
Eddie Rucker wrote: > I went to the SoureForge Archives and saw this submission that I didn't > get via email. Strange. I just looked at the header and I'm sure it was also sent to your pm. > foo X > where Y = bar X: > = Y/2; Right. I'd actually prefer to have the lhs qualifiers stick to the leftmost column, without any indentation, but your format also looks fine. Maybe there could be parameters in q-mode.el for the relative indentation of both lhs and rhs qualifiers (IIRC there already is for the rhs quals). I'm not sure how to do it since you probably have to do a full parse of equations to assign indentation properly. The equation syntax is actually regular so that shouldn't be a problem, but of course the expression syntax isn't and so you'll need to at least keep track of nested if-then-else and parens/brackets/braces to make this work. Also, figuring out where to start the parse without parsing the whole source file might be tricky. ;-) > I'm sure the email won't preserve the indention though. I'm seriously > considering changing my emacs mode to indent "=" on the lhs differently > than than the introductory "=" part of the equation. I'm also considering > changing the way nested "if then else" constructs within parenthesis > currently indent. I would like them to indent like without ()s. Is this > something other Q users would want? Yes, as I already pointed out above, q-mode.el most certainly needs a full overhaul of the indentation code. The current code is a hack which started from a Prolog mode which only needed rudimentary indentation; nevertheless, it worked astonishingly well until if-then-else arrived. ;-) For if-then-else it doesn't really do anything useful right now, and the mode also needs to be adapted for the lhs qualifiers, of course. If you can figure that out I'd be very thankful. I hate elisp hacking. :) Cheers, Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |