I'm using Emacs, and I have a macro that's like a switch for regexes, and runs an expression with variables bound to match results.
The indentation isn't what I'd like but I can't find if there's a way to tell the macro to indent sub-expressions.
E.g. currently usage looks like:
(regex-case "some-string"
("name +([a-z]+) +(.+)" (arg1 arg2)
(format t "~A / ~A~%" arg1 arg2))
("A*" ()
(format t "all A~%")))
But I'd like the parts that run to be indented more like functions, i.e.:
(regex-case "some-string"
("name +([a-z]+) +(.+)" (arg1 arg2)
(format t "~A / ~A~%" arg1 arg2))
("A*" ()
(format t "all A~%")))
Is there a way to do this?
I figure a next-best thing would be to have the regex and the variables in a list, and then it naturally becomes:
(regex-case "some-string"
(("name +([a-z]+) +(.+)" (arg1 arg2))
(format t "~A / ~A~%" arg1 arg2))
(("A*" ())
(format t "all A~%")))
But I'd really like more control over it than that, if possible.