clarete / hackernews.el

Hacker News client for Emacs
GNU General Public License v3.0
248 stars 26 forks source link

Async preparations #43

Closed basil-conto closed 6 years ago

basil-conto commented 6 years ago

This PR should not change any user-visible behaviour[1] and serves only to redesign how internal functions maintain and communicate state, both for the sake of cleaner design, but also with an eye to make #40 easier to implement.

The basic idea is to create the hackernews buffer upfront, so as to store state there sooner. The retrieval and rendering functions then need only refer to buffer-local variables, as opposed to those within scope. This is important because #40 may introduce multiple simultaneous retrievals of different feeds.

Please refer to each individual commit for details.

[1] Actually there is a minor bug fix included relating to hackernews-preserve-point; see the last commit.

basil-conto commented 6 years ago

As usual, I intend to merge this PR in around a week's time if it doesn't receive any comments/objections in the meantime.

basil-conto commented 6 years ago

Thanks for the positive feedback! :) Since opening this PR, I have found what I think is a more elegant way of linking the different parts of the pipeline, such that the append argument becomes a plain boolean, as its name suggests. Nevertheless, I wouldn't have gotten there without the refactor in this PR, so I'm merging as it is. :)