Trying Newsticker and other built-in tools in Emacs
After almost 1 year that I decided to try Emacs, It feels like I find the way computing should be done, and I have to say Emacs really catch my interest enough to keep using it for more time.
I was a vim/neovim user for almost 3 years, I still use it sometimes, I loved it so much that I tried to bring the entire unix philosophy with the vim spirit on my computing, I could do that using other terminal tools for that purpose (Suckless tools, Mutt, Newsboat, Tmux, Ncmpcpp, etc). All these tools are a blessing, but dealing with each one and try to integrate it into your workflow bring sometimes rough edges, not hard to deal with, but still is a work You have to do.
I think Emacs, deal with this in a better way, the integration is smoother because there is a platform that unify many unix-like tools and one programming language that you can use to manage your environment (Elisp).
Prefering built-in tools in Emacs
Lastly, after a while enjoying Emacs, I decided that I want to reduce the dependency to external packages as much as possible and when is pertinent to do so, there are several reasons to prefer this approach, but my 2 main reasons are:
Security: Reducing the bloat and prefering some tools that already come with Emacs will reduce the risk of being hacked , I will trust more the Emacs core developers rather than a package that is only review it for one developer in his free time.
Freedom: I want to learn my tools well, and using external packages sometimes get in my way, vanilla Emacs with some extra add-ons and a well time invested in learning elisp can solve most of my problems in my opinion while ensuring that I can keep an environment accesible to my needs.
Exploring Newsticker
For a while I was using Elfeed, and I like it, is the first time I think that I can keep up using an RSS reader and enjoying reading news, I have a tab in emacs call "news" with elfeed and time to time update it to read the news that interest me.
But as I said earlier, my interest in built-in tool has increased and in Emacs you have two main options: Newsticker and Gnus. The second one is a big one that you can use to follow mailing list, and also to send emails. For this reason I was seriously considering to explore it, but it will take time, and for other side Newsticker was a more simple version of what I wanted, and the way of setting your rss feed is similar to Elfeed.
I decided my set-up is basically something like this:
(use-package newsticker
:ensure nil
:config
(setq newsticker-frontend 'newsticker-treeview)
(setq newsticker-retrieval-interval 3600)
(setq newsticker-url-list '(
("Planet Emacslife" "https://planet.emacslife.com/atom.xml")
("Planet Debian" "https://planet.debian.org/rss20.xml")
;; Other RSS you want to follow come here
))
)
(defun my/close-newsticker ()
"Kill all tree-view related buffers."
(kill-buffer "*Newsticker List*")
(kill-buffer "*Newsticker Item*")
(kill-buffer "*Newsticker Tree*"))
(advice-add 'newsticker-treeview-quit :after 'my/close-newsticker)
(defun my/newsticker-treeview-browse-url ()
"Play YouTube links with mpv, others with browse-url."
(interactive)
(with-current-buffer (newsticker--treeview-list-buffer)
(let ((url (get-text-property (point) :nt-link)))
(if (and url (string-match-p "youtube\\.com\\|youtu\\.be" url))
(progn
(message "Opening URL %s with mpv King" url)
(start-process "mpv" nil "mpv" url))
(when url
(browse-url url)
(if newsticker-automatically-mark-visited-items-as-old
(newsticker-treeview-mark-item-old)))))))
(defun my/setup-newsticker-treeview-keys ()
"Bind `v` to `my/newsticker-treeview-browse-url` in both treeview modes."
(dolist (map-symbol '(newsticker-treeview-list-mode-map
newsticker-treeview-item-mode-map))
(when (boundp map-symbol)
(let ((map (symbol-value map-symbol)))
(define-key map (kbd "v") #'my/newsticker-treeview-browse-url)
))))
;; Try now, in case the maps are already defined
(my/setup-newsticker-treeview-keys)
;; Also ensure keys are set when modes activate
(add-hook 'newsticker-treeview-list-mode-hook #'my/setup-newsticker-treeview-keys)
(add-hook 'newsticker-treeview-item-mode-hook #'my/setup-newsticker-treeview-keys)
With this piece of code I can close all the windows with q, and for other side I can open Youtube videos using mpv, the last one is a feature that I think everyone should use.
First impressions on Newsticker
While I have to say I like the simple style of Elfeed with just one plain view, I believe there is a wisdom in a treeview panel (Newsticker also has a plainview, but if you have many feeds it will take a longer time to retrieve them all), I follow some independent bloggers that has very low frequency posting, and some news sites and blog aggregators that for obvious reasons have a much higher frequency post, a plainview that mix everything will make difficult the view of this independent bloggers, and while Elfeed provide nice filtering settings, I think a treeview is a nicer way to see the "whole picture".
With that said, still there are some rough edges that I am still trying to figure it out how to fix it, one is the retrieving method, that often encounter errors, I am using the built-in tool in Emacs but you can use something like wget. And for some reason the new posts will be marked as viewed even when I didn't open it yet, because Newstickers run the command to retrieve the news from all feeds, which is not the behavior I am expecting.
Conclusions
There are many interesting things to learn from the Emacs ecosystem, and still having fun with experimenting with my config file. I highly recommend people to try Newsticker, Emacs can have a very good RSS reader built-in without the need of third parties and I think is almost there.