You are reading the article How To Use Emacs For Rss With Elfeed updated in September 2023 on the website Lifecanntwaitvn.com. We hope that the information we have shared is helpful to you. If you find the content interesting and meaningful, please share it with your friends and continue to follow and support us for the latest updates. Suggested October 2023 How To Use Emacs For Rss With Elfeed
Emacs is a very extensible piece of software. It can be your text editor, your email client and even your USENET reader. With Elfeed, you can also use Emacs as your RSS feed reader.What Is Elfeed?
Elfeed is a lightweight yet powerful RSS feed reader written for Emacs. It uses a simple tag-based system to sort your RSS feeds. Not only that, it also comes with a powerful “hook-based” tagging system that allows you to automatically tag feeds based on their content.
This makes Elfeed useful for people who are following plenty of RSS feeds and are looking for a way to automatically sort their feeds.Why Use a Feedreader in Emacs?
Emacs works in the notion of interoperability, as Emacs takes data and allows it to be interpreted in various different ways.
While you can use Emacs to exclusively edit text, being able to access your email while editing text, for example, can allow you to seamlessly use the text you are writing in the email you are composing.
This is why incorporating your RSS feed reader into Emacs can be enticing. It would allow you to use Emacs’s powerful editing capabilities to manipulate your feeds and other functions in Emacs.Installing Elfeed on Emacs
Installing Elfeed is really simple. It is available from the GNU ELPA repository, so you can access it without any modifications in your chúng tôi file.
To install Elfeed, press Alt + X to bring up the command buffer, then type package-install. You have to provide elfeed as the package name and press Enter. Emacs will download Elfeed’s source code and compile it immediately afterward.Setting Up Your First RSS Feed in Emacs
With that installed, access Elfeed by pressing Alt + X and typing elfeed in the command buffer. Doing this will load an empty Elfeed buffer.
There are two ways to add an RSS feed to Elfeed:
Manually edit your chúng tôi file
Without EmacsAdding an RSS Feed Manually in Elfeed
You can easily populate Elfeed by manually adding the feed URLs in your chúng tôi file, as Elfeed has an “elfeed-feeds” variable it tracks. This tells Elfeed which feeds to fetch and display in its overview screen.
For example, this is a snippet from my chúng tôi file.
From there, Elfeed will automatically add those links into its internal database, then load the next time you run the program.Adding an RSS Feed within Emacs
Another way of populating Elfeed is by giving it feed links while it is running. This allows you to actively update your feed roster with RSS links without reloading Emacs.
To do this, press Alt + X to open the command buffer. Type elfeed-add-feed and press Enter. Elfeed will ask you to provide the URL of the feed that you want to load.
In my case, I am providing our feed URL to Elfeed to receive daily updates on the latest technology articles.
I copy the feed URL and press Ctrl + Y in the URL prompt to paste the link to Emacs. Once pasted, I just need to press Enter to commit the feed URL to Elfeed.How to Automatically Tag and Filter Feeds in Emacs
Aside from listing and viewing RSS feeds, Elfeed can also perform a number of functions that will allow you to finely tune your feed list.
One of those neat functions is automatic tagging. This feature allows you to immediately tag RSS entries that came from a specific feed.
For example, if you have multiple feeds about a certain topic, you can set so that they will all have the same tag, making it easy and intuitive to sort through multiple feeds in the summary screen.
To do this, edit the RSS feeds in your chúng tôi file. Take a look at this brief example.
setqelfeed-feeds Filtering Your RSS Feed in Elfeed
These tags work in conjunction with Elfeed’s powerful filtering system. This allows you to group your RSS feeds based on tags alone.
For example, if you have RSS feeds tagged as “news,” “news tech” and “news gaming,” Elfeed allows you to group all of them under the “news” tag.
To filter your feed list, press S while in Elfeed to bring up Elfeed’s filter prompt. By default, the prompt contains the following:
The @ symbol indicates a date range. This could be an absolute date such as “2023-02-22” or a relative one such as “3-days-ago.”
The “+” symbol is a tag operator that tells Elfeed to explicitly include all feeds that have this tag.
With that in mind, consider the following RSS feed.
Knowing this, you can be more specific with your filtering logic. For example, if you want to include all tech links but without “f1,” you can type the following:+tech
-f1How to Automatically Tag Feeds Based on URL
Another way to automatically tag RSS entries in Elfeed is to sort them based on URL. This is useful if you are using Elfeed to subscribe to RSS feeds that have a similar URL structure.
You can use the elfeed-make-tagger function within that hook. This is a general function that tags links based on options that you set. As such, combining the two functions to create automatic tagging can look something like this:
You can also be more specific with the options that you set with elfeed-make-tagger. For example, you can both tag a feed based on the URL and filter out entries that are older than three months:
"3 months ago"
)How to Create Custom Colors and Fonts for Tags
Aside from automatic tagging, you can also customize how Elfeed looks based on the tag it is dealing with. This is useful if you want feeds with a specific tag to stand out.
To do that, you need to redefine the elfeed-search-face-alist function. This is the command that Elfeed uses to change the appearance of the summary buffer. As such, to redefine this function, you can use the defface and push functions:
The defface function creates a new “face” for Emacs. The “face” is a set of values that can contain both character fonts and background colors.
The push function, on the other hand, appends a definition to an existing command in Emacs.
With that in mind, you can combine these functions to create a custom “face” for Elfeed. For example, this is a custom face that highlights the f1 tag in red.
(defface elfeed-face-tag-f1 '
"This is a custom font face for the F1 tag in Elfeed."
Congratulations! You now know how to use Emacs as an RSS reader with Elfeed. Furthermore, you also now have a basic idea of how to customize and automate Elfeed to suit your RSS feeds’ needs.
If all this discussion made you think of what you can do more with Emacs, you can check out our article on the best productivity packages for Emacs.Frequently Asked Questions 1. How can I delete a feed in Elfeed?
For the former, removing a feed is just a matter of deleting the feed URL in your elfeed-feeds variable. For the latter, however, you need to press Alt + X to open the command buffer. From here, you need to type customize. This will open the customize window for Emacs.
From there, type elfeed-feeds in the search box. This will bring all of the feeds that you are currently subscribed to.2. What can I do if I add all my feeds in Elfeed and they don’t refresh?
Elfeed does not automatically refresh the feed links for you. To fetch the latest entries in your feeds, press Shift + G to initiate an update on all the currently-subscribed feeds.
Further, if you want to only update a specific RSS feed, run the elfeed-update-feed function.3. My automatic tags don’t seem to work. How can I solve this?
This is most probably because you have conflicting tags for the same RSS feed. That can happen if you have included the same feed URL in both your manual and automatic feeds.
Ramces is a technology writer that lived with computers all his life. A prolific reader and a student of Anthropology, he is an eccentric character that writes articles about Linux and anything *nix.
Subscribe to our newsletter!
Our latest tutorials delivered straight to your inbox
Sign up for all newsletters.
You're reading How To Use Emacs For Rss With Elfeed
Update the detailed information about How To Use Emacs For Rss With Elfeed on the Lifecanntwaitvn.com website. We hope the article's content will meet your needs, and we will regularly update the information to provide you with the fastest and most accurate information. Have a great day!