bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#36009: [PATCH] Use lexical-binding in textmodes/page.el and add test


From: Stefan Kangas
Subject: bug#36009: [PATCH] Use lexical-binding in textmodes/page.el and add tests
Date: Fri, 14 Jun 2019 00:02:21 +0200

Simen Heggestøyl <simenheg@gmail.com> writes:
> Oh, sorry Stefan, what a coincidence! I chose that file at random
> yesterday. I should do a Debbugs search in advance next time.

No worries -- this fruit was clearly ripe for the taking. :)

> Regarding the tests they look almost identical, except that I left out
> tests for `count-lines-page' and `what-page', because I was unsure
> whether they would be too dependent on the format of the user messages.
>
> Maybe it would be good to factor out the meat of `count-lines-page'
> and `what-page' into two internal functions returning just the raw
> numbers, test those, and turn the interactive functions into
> interfaces for them?

Thanks for your input.

I did an experiment in your suggested direction, but it didn't come
out very successful.  In particular, I felt like I had to make this
simple and straightforward code ugly and convoluted.  I could attach
the final result of that experiment here, but I don't think it's very
helpful.

Based on this, I'm instead suggesting the attached simple patch for
installation.  It depends on the message string, but this should be
easy to update in the future if the format changes.

Thanks,
Stefan Kangas

Attachment: 0001-Add-tests-for-count-lines-page-and-what-page.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]