Conversation
Save the value of the corresponding elfeed-entry in text-property and only call elfeed-search-print-entry-function when the entry has changed or we have encountered a new entry.
|
In current state, if window-width or any parameter for the elfeed-search-print-entry-function has changed in the meantime, the un-updated rows and updated rows will look inconsistent. For such a situation, I have added an option for a 'reset argument which clears the buffers before proceeding. |
alphapapa
left a comment
There was a problem hiding this comment.
Of course, I'm not Chris, but maybe I can save him a little time by suggesting a few things.
In addition to the specific comments, please untabify your changes and be sure they are indented properly, because several of these forms aren't.
elfeed-search.el
Outdated
| (insert (propertize feed-title 'face 'elfeed-search-feed-face) " ")) | ||
| (when tags | ||
| (insert "(" tags-str ")")) | ||
| (add-text-properties |
There was a problem hiding this comment.
You should probably use put-text-property here, since you're only setting one property.
elfeed-search.el
Outdated
| (move-to-column column))))) | ||
|
|
||
| (defun elfeed-search-update (&optional force) | ||
| (defun elfeed-entries-compare (entry-a entry-b) |
There was a problem hiding this comment.
Please reorder these functions so the diff can be more cleanly read (see how it shows the elfeed-search-update function's first line being replaced, but the new line is far below it in the diff).
elfeed-search.el
Outdated
| (let ((inhibit-read-only t) | ||
| (standard-output (current-buffer)) | ||
| (sorter (or elfeed-search-sort-function #'elfeed-entries-compare))) | ||
| (when reset |
There was a problem hiding this comment.
Is it necessary to have both force and reset flags?
elfeed-search.el
Outdated
| (while | ||
| (let ((saved-entry (get-text-property (point) 'saved-elfeed-entry))) | ||
| (cond | ||
| ;; no change in entry |
There was a problem hiding this comment.
This comment is a bit redundant, considering the simple equal... below. :)
elfeed-search.el
Outdated
| ((equal entry saved-entry) | ||
| (forward-line 1) | ||
| nil) | ||
| ;; saved-entry sorts after entry, insert and moved on |
There was a problem hiding this comment.
This comment is not very clear. Could you rewrite it as a sentence?
elfeed-search.el
Outdated
| (funcall elfeed-search-print-entry-function entry) | ||
| (insert "\n") | ||
| nil) | ||
| ;; found an entry that sorts before id, |
There was a problem hiding this comment.
This comment could be more succinct, like "Entry sorts before ID: delete it."
Save the value of the corresponding elfeed-entry in text-property and
only call elfeed-search-print-entry-function when the entry has changed
or we have encountered a new entry.
On my system, with ~7000 elfeed-search-entries this reduces the time of
elfeed-search-update with a small number of changes from ~0.70s to ~0.03s.