Closed accidentalrebel closed 6 years ago
Hello! I am so sorry I somehow missed your work here... So first, thanks for doing that!
The code seems ok to me, but it is at the wrong place I think: the code in the function speed-type--pick-text-to-type is used by both speed-type-buffer (used with a buffer selection) or speed-type (used with downloaded books).
I believe it should only go to the books section, that is somewhere around https://github.com/accidentalrebel/speed-type/blob/73f77e602426dec7c93d697e3abf422b11d27926/speed-type.el#L469. You can pass start and end to speed-type--pick-text-to-type anyway, so it should be quite straightforward. Do you mind updating your code please?
Hello! No problem! I'll work on it and resubmit. Thanks!
I moved the code under the speed-type-text
function as requested. I've also improved the regex string and tested it out on all the books (There were some books that were returning 404, but will open a different issue for that).
I just squashed your commits, and merged the patch in 7a67fcd7bf825eee890097bd4a1b3c4f531a1135. Thank you! And feel free to look into other issues or improvements. :)
Fixes issue https://github.com/hagleitn/speed-type/issues/10 from the old repo.
In this fix: Each Gutenberg Ebook has the lines:
*** START OF THIS PROJECT GUTENBERG EBOOK ...
or*** START OF THE PROJECT GUTENBERG EBOOK ...
and
*** END OF THIS PROJECT GUTENBERG EBOOK ...
or*** START OF THE PROJECT GUTENBERG EBOOK ...
The content of a Gutenberg ebook is in between these lines. Outside these lines contain license and tech info that are not part of the book and are trimmed so that they are not picked.
If there are no such lines, the
START
andEND
defaults to(point-min)
and(point-max)
.