diff options
author | Ricardo Wurmus <rekado@elephly.net> | 2023-09-21 16:03:50 +0200 |
---|---|---|
committer | Ricardo Wurmus <rekado@elephly.net> | 2023-09-24 13:49:53 +0200 |
commit | 670fc6ee50a2882fba8004de7d9d24e80459add2 (patch) | |
tree | b5a780ca2df3f37345506841fdc9dd3ea68891f2 /gnu/artwork.scm | |
parent | 5027bc19d8a3c7bac1d89d80fc3c717ae3ec399a (diff) |
etc/committer: Speed up surrounding-sexp.
The old surrounding-sexp procedure would read all S-expressions from the
beginning of the file up to the given line number and then return the last
encountered S-expression. This is quite wasteful. Instead we can record all
lines that begin with an S-expression and jump straight to the offset closest
to the desired line number to read the S-expression there.
* etc/committer.scm.in (lines+offsets-with-opening-parens): New procedure.
(surrounding-sexp): Use it.
Diffstat (limited to 'gnu/artwork.scm')
0 files changed, 0 insertions, 0 deletions