Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to fill window with stories #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions hackernews.el
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@
'hackernews-items-per-page "0.4.0")

(defcustom hackernews-items-per-page 20
"Default number of stories to retrieve in one go."
"Default number of stories to retrieve in one go.
If nil, the stories will fill the window."
Copy link
Collaborator

@basil-conto basil-conto May 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes to user options should be accompanied by updates to their :type and :version/:package-version tags.

:package-version '(hackernews . "0.4.0")
:group 'hackernews
:type 'integer)
Expand Down Expand Up @@ -505,9 +506,10 @@ rendered at the end of the hackernews buffer."
(hackernews--put :register (cons offset ids))
(hackernews--put :items (make-vector
(max 0 (min (- (length ids) offset)
(if n
(prefix-numeric-value n)
hackernews-items-per-page)))
(cond
(n (prefix-numeric-value n))
(hackernews-items-per-page)
(t (1- (window-text-height))))))
()))

(hackernews--retrieve-items)
Expand Down