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 an option to mark elfeed entries as read when added to Pocket. #27

Closed
wants to merge 1 commit into from

Conversation

mssdvd
Copy link
Contributor

@mssdvd mssdvd commented Dec 6, 2020

No description provided.

@alphapapa
Copy link
Owner

Thanks, but I'd prefer that you handle this by defining a command in your own config that does this. As is, this PR would add a new defcustom that is unnecessary if Elfeed isn't installed, and if it were moved into the with-eval-after-load form, it would cause a compilation warning due to the variable's not being defined. It would only be a few lines of code in your config.

What do you think? Thanks.

@mssdvd
Copy link
Contributor Author

mssdvd commented Dec 7, 2020 via email

@alphapapa
Copy link
Owner

I agree, it seems reasonable for that to be the default behavior. It's what I have in this command in my config:

(defun ap/elfeed-add-links-to-pocket ()
    "Add selected entries in Elfeed search buffer to Pocket, with tags, and mark as unstarred and read in Elfeed."
    (interactive)
    (when-let* ((entries (elfeed-search-selected))
                (groups (--group-by (elfeed-entry-tags it) entries)))
      ;; Add each group to Pocket
      (cl-loop with added-urls
               for group in groups
               for tags = (substring-no-properties (s-join "," (mapcar #'symbol-name (remove 'unread (car group)))))
               for links = (--map (elfeed-entry-link it) (cdr group))
               when (pocket-lib-add-urls links :tags tags)
               append links into added-urls
               finally do (message "Added: %s" (s-join ", " added-urls)))
      (apply #'elfeed-untag entries '(unread starred))
      (mapc #'elfeed-search-update-entry entries)))

So if you want to add it directly to the command without the option, I think that's a sensible improvement. Thanks.

@mssdvd
Copy link
Contributor Author

mssdvd commented Dec 7, 2020 via email

@alphapapa
Copy link
Owner

If you don't mind, please redo this PR as a branch on your repo other than master.

@mssdvd
Copy link
Contributor Author

mssdvd commented Dec 26, 2020

I removed the option. I wouldn't add tag uploads as it might clutter the users' feed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants