From 0cdbd5bef99c6b298da45dfea885dadd5958734d Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Thu, 23 Nov 2023 20:05:59 +0100 Subject: [PATCH] update elfeed Signed-off-by: Andreas Gerler --- bba.org | 4 +- elpa/elfeed-20191227.426/elfeed-pkg.el | 5 - elpa/elfeed-20210822.2129/README.md | 409 ++++++++++++++++++ .../elfeed-autoloads.el | 37 +- .../elfeed-csv.el | 0 .../elfeed-curl.el | 73 +++- .../elfeed-db.el | 0 .../elfeed-lib.el | 7 +- .../elfeed-link.el | 4 +- .../elfeed-log.el | 0 elpa/elfeed-20210822.2129/elfeed-pkg.el | 10 + .../elfeed-search.el | 88 ++-- .../elfeed-show.el | 54 ++- .../elfeed.el | 10 +- .../xml-query.el | 0 .../elfeed-org-pkg.el | 2 - .../elfeed-org-autoloads.el | 10 +- .../elfeed-org-20221118.852/elfeed-org-pkg.el | 18 + .../elfeed-org.el | 81 ++-- 19 files changed, 657 insertions(+), 155 deletions(-) delete mode 100644 elpa/elfeed-20191227.426/elfeed-pkg.el create mode 100644 elpa/elfeed-20210822.2129/README.md rename elpa/{elfeed-20191227.426 => elfeed-20210822.2129}/elfeed-autoloads.el (73%) rename elpa/{elfeed-20191227.426 => elfeed-20210822.2129}/elfeed-csv.el (100%) rename elpa/{elfeed-20191227.426 => elfeed-20210822.2129}/elfeed-curl.el (89%) rename elpa/{elfeed-20191227.426 => elfeed-20210822.2129}/elfeed-db.el (100%) rename elpa/{elfeed-20191227.426 => elfeed-20210822.2129}/elfeed-lib.el (98%) rename elpa/{elfeed-20191227.426 => elfeed-20210822.2129}/elfeed-link.el (94%) rename elpa/{elfeed-20191227.426 => elfeed-20210822.2129}/elfeed-log.el (100%) create mode 100644 elpa/elfeed-20210822.2129/elfeed-pkg.el rename elpa/{elfeed-20191227.426 => elfeed-20210822.2129}/elfeed-search.el (94%) rename elpa/{elfeed-20191227.426 => elfeed-20210822.2129}/elfeed-show.el (91%) rename elpa/{elfeed-20191227.426 => elfeed-20210822.2129}/elfeed.el (99%) rename elpa/{elfeed-20191227.426 => elfeed-20210822.2129}/xml-query.el (100%) delete mode 100644 elpa/elfeed-org-20181015.1100/elfeed-org-pkg.el rename elpa/{elfeed-org-20181015.1100 => elfeed-org-20221118.852}/elfeed-org-autoloads.el (74%) create mode 100644 elpa/elfeed-org-20221118.852/elfeed-org-pkg.el rename elpa/{elfeed-org-20181015.1100 => elfeed-org-20221118.852}/elfeed-org.el (84%) diff --git a/bba.org b/bba.org index 6cb97232..5792aa6d 100644 --- a/bba.org +++ b/bba.org @@ -1012,8 +1012,8 @@ necessary. #+BEGIN_SRC emacs-lisp (if (>= emacs-major-version 24) (progn - (add-to-list 'load-path "~/.emacs.d/elpa/elfeed-20191227.426") - (add-to-list 'load-path "~/.emacs.d/elpa/elfeed-org-20181015.1100") + (add-to-list 'load-path "~/.emacs.d/elpa/elfeed-20210822.2129") + (add-to-list 'load-path "~/.emacs.d/elpa/elfeed-org-20221118.852") (require 'elfeed-org) (elfeed-org) (setq rmh-elfeed-org-files (list "~/org/elfeed.org")))) diff --git a/elpa/elfeed-20191227.426/elfeed-pkg.el b/elpa/elfeed-20191227.426/elfeed-pkg.el deleted file mode 100644 index dc803bb7..00000000 --- a/elpa/elfeed-20191227.426/elfeed-pkg.el +++ /dev/null @@ -1,5 +0,0 @@ -(define-package "elfeed" "20191227.426" "an Emacs Atom/RSS feed reader" - '((emacs "24.3"))) -;; Local Variables: -;; no-byte-compile: t -;; End: diff --git a/elpa/elfeed-20210822.2129/README.md b/elpa/elfeed-20210822.2129/README.md new file mode 100644 index 00000000..2e167ef2 --- /dev/null +++ b/elpa/elfeed-20210822.2129/README.md @@ -0,0 +1,409 @@ +# Elfeed Emacs Web Feed Reader + +Elfeed is an extensible web feed reader for Emacs, supporting both +Atom and RSS. It requires Emacs 24.3 and is available for download +from [MELPA](http://melpa.milkbox.net/) or +[el-get](https://github.com/dimitri/el-get). Elfeed was inspired by +[notmuch](http://notmuchmail.org/). + +For a longer overview, + + * [Introducing Elfeed, an Emacs Web Feed Reader](http://nullprogram.com/blog/2013/09/04/). + * [Tips and Tricks](http://nullprogram.com/blog/2013/11/26/) + * [Read your RSS feeds in Emacs with Elfeed +](http://pragmaticemacs.com/emacs/read-your-rss-feeds-in-emacs-with-elfeed/) + * [Scoring Elfeed articles](http://kitchingroup.cheme.cmu.edu/blog/2017/01/05/Scoring-elfeed-articles/) + * [Using Emacs 29](https://www.youtube.com/watch?v=pOFqzK1Ymr4), + [30](https://www.youtube.com/watch?v=tjnK1rkO7RU), + [31](https://www.youtube.com/watch?v=5zuSUbAHH8c) + * [Take Elfeed everywhere: Mobile rss reading Emacs-style (for free/cheap)](http://babbagefiles.blogspot.com/2017/03/take-elfeed-everywhere-mobile-rss.html) + * [Elfeed Rules!](https://noonker.github.io/posts/2020-04-22-elfeed/) ([reddit](https://old.reddit.com/r/emacs/comments/g6oowz/elfeed_rules/)) + * [Elfeed with Tiny Tiny RSS](https://codingquark.com/emacs/2020/04/19/elfeed-protocol-ttrss.html) ([hn](https://news.ycombinator.com/item?id=22915200)) + * [Open Emacs elfeed links in the background](http://xenodium.com/open-emacs-elfeed-links-in-background/) + * [Using Emacs 72](https://cestlaz.github.io/post/using-emacs-72-customizing-elfeed/) + * [Lazy Elfeed](https://karthinks.com/blog/lazy-elfeed/) + * [Using Elfeed to View Videos](https://joshrollinswrites.com/help-desk-head-desk/20200611/) + * [Manage podcasts in Emacs with Elfeed and Bongo](https://protesilaos.com/codelog/2020-09-11-emacs-elfeed-bongo/) + * [... more ...](http://nullprogram.com/tags/elfeed/) + * [... and more ...](http://pragmaticemacs.com/category/elfeed/) + +[![](http://i.imgur.com/kxgF5AH.png)](http://i.imgur.com/kxgF5AH.png) + +The database format is stable and is never expected to change. + +## Prerequisites + +**It is *strongly* recommended you have cURL installed**, either in +your PATH or configured via `elfeed-curl-program-name`. Elfeed will +prefer it to Emacs' own URL-fetching mechanism, `url-retrieve`. It's +also essential for running Elfeed on Windows, where `url-retrieve` is +broken. Updates using cURL are significantly faster than the built-in +method, both for you and the feed hosts. + +If this is giving you problems, fetching with cURL can be disabled by +setting `elfeed-use-curl` to nil. + +## Extensions + +These projects extend Elfeed with additional features: + +* [elfeed-org](https://github.com/remyhonig/elfeed-org) +* [elfeed-goodies](https://github.com/algernon/elfeed-goodies) +* [elfeed-protocol](https://github.com/fasheng/elfeed-protocol) +* [elfeed-score](https://github.com/sp1ff/elfeed-score) +* [Elfeed Android interface](https://github.com/areina/elfeed-cljsrn) + ([Google Play](https://play.google.com/store/apps/details?id=com.elfeedcljsrn)) +* [elfeed-dashboard](https://github.com/Manoj321/elfeed-dashboard) + +## Getting Started + +Elfeed is broken into a multiple source files, so if you manually +install it you will need to add the Elfeed package directory to your +`load-path`. If installed via package.el or el-get, this will be done +automatically. + +It is recommended that you make a global binding for `elfeed`. + +```el +(global-set-key (kbd "C-x w") 'elfeed) +``` + +Running the interactive function `elfeed` will pop up the +`*elfeed-search*` buffer, which will display feed items. + + * g: refresh view of the feed listing + * G: fetch feed updates from the servers + * s: update the search filter (see tags) + * c: clear the search filter + +This buffer will be empty until you add your feeds to the +`elfeed-feeds` list and initiate an update with `M-x elfeed-update` +(or G in the Elfeed buffer). This will populate the Elfeed +database with entries. + +```el +;; Somewhere in your .emacs file +(setq elfeed-feeds + '("http://nullprogram.com/feed/" + "https://planet.emacslife.com/atom.xml")) +``` + +Another option for providing a feed list is with an OPML file. Running +`M-x elfeed-load-opml` will fill `elfeed-feeds` with feeds listed in +an OPML file. When `elfeed-load-opml` is called interactively, it will +automatically save the feedlist to your customization file, so you +will only need to do this once. + +If there are a lot of feeds, the initial update will take noticeably +longer than normal operation because of the large amount of +information being written the database. Future updates will only need +to write new or changed data. If updating feeds slows down Emacs too +much for you, reduce the number of concurrent fetches via +`elfeed-set-max-connections`. + +If you're getting many "Queue timeout exceeded" errors, increase the +fetch timeout via `elfeed-set-timeout`. + +~~~el +(setf url-queue-timeout 30) +~~~ + +From the search buffer there are a number of ways to interact with +entries. Entries are selected by placing the point over an entry. +Multiple entries are selected at once by using an active region. + + * RET: view selected entry in a buffer + * b: open selected entries in your browser (`browse-url`) + * y: copy selected entries URL to the clipboard + * r: mark selected entries as read + * u: mark selected entries as unread + * +: add a specific tag to selected entries + * -: remove a specific tag from selected entries + +## Tags + +Elfeed maintains a list of arbitrary tags -- symbols attached to an +entry. The tag `unread` is treated specially by default, with unread +entries appearing in bold. + +### Autotagging + +Tags can automatically be applied to entries discovered in specific +feeds through extra syntax in `elfeed-feeds`. Normally this is a list +of strings, but an item can also be a list, providing set of +"autotags" for a feed's entries. + +```el +(setq elfeed-feeds + '(("http://nullprogram.com/feed/" blog emacs) + "http://www.50ply.com/atom.xml" ; no autotagging + ("http://nedroid.com/feed/" webcomic))) +``` + +### Filter Syntax + +To make tags useful, the Elfeed entry listing buffer can be filtered +by tags. Use `elfeed-search-set-filter` (or s) to update +the filter. Use `elfeed-search-clear-filter` to restore the default. + +Any component of the search string beginning with a `+` or +a `-` is treated like a tag. `+` means the tag is required, `-` means +the tag must not be present. + +A component beginning with a `@` indicates an age or a date range. An +age is a relative time expression or an absolute date expression. +Entries older than this age are filtered out. The age description +accepts plain English, but cannot have spaces, so use dashes. For +example, `"@2-years-old"`, `"@3-days-ago"` or `"@2019-06-24"`. A date +range are two ages seperated by a `--`, e.g. +`"@2019-06-20--2019-06-24"` or `"@5-days-ago--1-day-ago"`. The entry +must be newer than the first expression but older than the second. The +database is date-oriented, so **filters that include an age +restriction are significantly more efficient.** + +A component beginning with a `!` is treated as an "inverse" regular +expression. This means that any entry matching this regular expression +will be filtered out. The regular expression begins *after* the `!` +character. You can read this as "entry not matching `foo`". + +A component beginning with a `#` limits the total number of entries +displayed to the number immediately following the symbol. For example, +to limit the display to 20 entries: `#20`. + +A component beginning with a `=` is a regular expression matching the +entry's feed (title or URL). Only entries belonging to a feed that +matches at least one of the `=` expressions will be shown. + +A component beginning with a `~` is a regular expression matching the +entry's feed (title or URL). Only entries belonging to a feed that +matches none of the `~` expressions will be shown. + +All other components are treated as a regular expression, and only +entries matching it (title or URL) will be shown. + +Here are some example filters. + + * `@6-months-ago +unread` + +Only show unread entries of the last six months. This is the default filter. + + * `linu[xs] @1-year-old` + +Only show entries about Linux or Linus from the last year. + + * `-unread +youtube #10` + +Only show the most recent 10 previously-read entries tagged as +`youtube`. + + * `+unread !x?emacs` + +Only show unread entries not having `emacs` or `xemacs` in the title +or link. + +* `+emacs =http://example.org/feed/` + +Only show entries tagged as `emacs` from a specific feed. + +#### Default Search Filter + +You can set your default search filter by changing the default value +of `elfeed-search-filter`. It only changes buffer-locally when you're +adjusting the filter within Elfeed. For example, some users prefer to +have a space on the end for easier quick searching. + + (setq-default elfeed-search-filter "@1-week-ago +unread ") + +### Tag Hooks + +The last example assumes you've tagged posts with `youtube`. You +probably want to do this sort of thing automatically, either through +the "autotags" feature mentioned above, or with the +`elfeed-new-entry-hook`. Functions in this hook are called with new +entries, allowing them to be manipulated, such as adding tags. + +```el +;; Mark all YouTube entries +(add-hook 'elfeed-new-entry-hook + (elfeed-make-tagger :feed-url "youtube\\.com" + :add '(video youtube))) +``` + +Avoiding tagging old entries as `unread`: + +```el +;; Entries older than 2 weeks are marked as read +(add-hook 'elfeed-new-entry-hook + (elfeed-make-tagger :before "2 weeks ago" + :remove 'unread)) +``` + +Or building your own subset feeds: + +```el +(add-hook 'elfeed-new-entry-hook + (elfeed-make-tagger :feed-url "example\\.com" + :entry-title '(not "something interesting") + :add 'junk + :remove 'unread)) +``` + +Use `M-x elfeed-apply-hooks-now` to apply `elfeed-new-entry-hook` to +all existing entries. Otherwise hooks will only apply to new entries +on discovery. + +### Custom Tag Faces + +By default, entries marked `unread` will have bolded titles in the +`*elfeed-search*` listing. You can customize how tags affect an +entry's appearance by customizing `elfeed-search-face-alist`. For +example, this configuration makes entries tagged `important` stand out +in red. + +~~~el +(defface important-elfeed-entry + '((t :foreground "#f77")) + "Marks an important Elfeed entry.") + +(push '(important important-elfeed-entry) + elfeed-search-face-alist) +~~~ + +All faces from all tags will be applied to the entry title. The faces +will be ordered as they appear in `elfeed-search-face-alist`. + +## Bookmarks + +Filters can be saved and restored using Emacs' built-in [bookmarks +feature][bm]. While in the search buffer, use `M-x bookmark-set` to +save the current filter, and `M-x bookmark-jump` to restore a saved +filter. Emacs automatically persists bookmarks across sessions. + +[bm]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Bookmarks.html + +## Metadata Plist + +All feed and entry objects have plist where you can store your own +arbitrary, [readable values][rd]. These values are automatically +persisted in the database. This metadata is accessed using the +polymorphic `elfeed-meta` function. It's setf-able. + +~~~el +(setf (elfeed-meta entry :rating) 4) +(elfeed-meta entry :rating) +;; => 4 + +(setf (elfeed-meta feed :title) "My Better Title") +~~~ + +Elfeed itself adds some entries to this plist, some for your use, some +for its own use. Here are the properties that Elfeed uses: + +* `:authors` : A list of author plists (`:name`, `:uri`, `:email`). +* `:canonical-url` : The final URL for the feed after all redirects. +* `:categories` : The feed-supplied categories for this entry. +* `:etag` : HTTP Etag header, for conditional GETs. +* `:failures` : Number of times this feed has failed to update. +* `:last-modified` : HTTP Last-Modified header, for conditional GETs. +* `:title` : Overrides the feed-supplied title for display purposes, + both for feeds and entries. See also `elfeed-search-set-feed-title` + and `elfeed-search-set-entry-title`. + +This list will grow in time, so you might consider namespacing your +own properties to avoid collisions (e.g. `:xyz/rating`), or simply not +using keywords as keys. Elfeed will always use keywords without a +slash. + +[rd]: http://nullprogram.com/blog/2013/12/30/ + +## Hooks + +A number of hooks are available to customize the behavior of Elfeed at +key points without resorting to advice. + +* `elfeed-new-entry-hook` : Called each time a new entry it added to + the database, allowing for automating tagging and such. +* `elfeed-new-entry-parse-hook` : Called with each new entry and the + full XML structure from which it was parsed, allowing for additional + information to be drawn from the original feed XML. +* `elfeed-http-error-hooks` : Allows for special behavior when HTTP + errors occur, beyond simply logging the error to `*elfeed-log*` . +* `elfeed-parse-error-hooks` : Allows for special behavior when feed + parsing fails, beyond logging. +* `elfeed-db-update-hook` : Called any time the database has had a + major modification. + +## Viewing Entries + +Entries are viewed locally in Emacs by typing `RET` while over an +entry in the search listing. The content will be displayed in a +separate buffer using `elfeed-show-mode`, rendered using Emacs' +built-in shr package. This requires an Emacs compiled with `libxml2` +bindings, which provides the necessary HTML parser. + +Sometimes displaying images can slow down or even crash Emacs. Set +`shr-inhibit-images` to disable images if this is a problem. + +## Web Interface + +Elfeed includes a demonstration/toy web interface for remote network +access. It's a single-page web application that follows the database +live as new entries arrive. It's packaged separately as `elfeed-web`. +To fire it up, run `M-x elfeed-web-start` and visit +http://localhost:8080/elfeed/ (check your `httpd-port`) with a +browser. See the `elfeed-web.el` header for endpoint documentation if +you'd like to access the Elfeed database through the web API. + +It's rough and unfinished -- no keyboard shortcuts, read-only, no +authentication, and a narrow entry viewer. This is basically Elfeed's +"mobile" interface. Patches welcome. + +## Platform Support + +Summary: Install cURL and most problems disappear for all platforms. + +I personally only use Elfeed on Linux, but it's occasionally tested on +Windows. Unfortunately the Windows port of Emacs is a bit too unstable +for parallel feed downloads with `url-retrieve`, not to mention the +[tiny, hard-coded, 512 open descriptor limitation][files], so it +limits itself to one feed at a time on this platform. + +[files]: http://msdn.microsoft.com/en-us/library/kdfaxaay%28vs.71%29.aspx + +If you fetch HTTPS feeds without cURL on *any* platform, it's +essential that Emacs is built with the `--with-gnutls` option. +Otherwise Emacs runs gnutls in an inferior process, which rarely works +well. + +## Database Management + +The database should keep itself under control without any manual +intervention, but steps can be taken to minimize the database size if +desired. The simplest option is to run the `elfeed-db-compact` +command, which will pack the loose-file content database into a single +compressed file. This function works well in `kill-emacs-hook`. + +Going further, a function could be added to `elfeed-new-entry-hook` to +strip unwanted/unneeded content from select entries before being +stored in the database. For example, for YouTube videos only the entry +link is of interest and the regularly-changing entry content could be +tossed to save time and storage. + +## Status and Roadmap + +Elfeed is to the point where it can serve 100% of my own web feed +needs. My personal selection of about 150 feeds has been acting as my +test case as I optimize and add features. + +Some things I still might want to add: + +* Database synchronization between computers +* Parallel feed fetching via separate Emacs subprocesses + +## Motivation + +As far as I know, outside of Elfeed there does not exist an +extensible, text-file configured, power-user web feed client that can +handle a reasonable number of feeds. The existing clients I've tried +are missing some important capability that limits its usefulness to +me. diff --git a/elpa/elfeed-20191227.426/elfeed-autoloads.el b/elpa/elfeed-20210822.2129/elfeed-autoloads.el similarity index 73% rename from elpa/elfeed-20191227.426/elfeed-autoloads.el rename to elpa/elfeed-20210822.2129/elfeed-autoloads.el index 24f4e004..d849e119 100644 --- a/elpa/elfeed-20191227.426/elfeed-autoloads.el +++ b/elpa/elfeed-20210822.2129/elfeed-autoloads.el @@ -1,4 +1,4 @@ -;;; elfeed-autoloads.el --- automatically extracted autoloads +;;; elfeed-autoloads.el --- automatically extracted autoloads -*- lexical-binding: t -*- ;; ;;; Code: @@ -10,14 +10,10 @@ ;;; Generated autoloads from elfeed.el (autoload 'elfeed-update "elfeed" "\ -Update all the feeds in `elfeed-feeds'. - -\(fn)" t nil) +Update all the feeds in `elfeed-feeds'." t nil) (autoload 'elfeed "elfeed" "\ -Enter elfeed. - -\(fn)" t nil) +Enter elfeed." t nil) (autoload 'elfeed-load-opml "elfeed" "\ Load feeds from an OPML file into `elfeed-feeds'. @@ -31,35 +27,35 @@ Export the current feed listing to OPML-formatted FILE. \(fn FILE)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "elfeed" '("elfeed-"))) +(register-definition-prefixes "elfeed" '("elfeed-")) ;;;*** ;;;### (autoloads nil "elfeed-csv" "elfeed-csv.el" (0 0 0 0)) ;;; Generated autoloads from elfeed-csv.el -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "elfeed-csv" '("elfeed-csv-"))) +(register-definition-prefixes "elfeed-csv" '("elfeed-csv-")) ;;;*** ;;;### (autoloads nil "elfeed-curl" "elfeed-curl.el" (0 0 0 0)) ;;; Generated autoloads from elfeed-curl.el -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "elfeed-curl" '("elfeed-curl-"))) +(register-definition-prefixes "elfeed-curl" '("elfeed-curl-")) ;;;*** ;;;### (autoloads nil "elfeed-db" "elfeed-db.el" (0 0 0 0)) ;;; Generated autoloads from elfeed-db.el -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "elfeed-db" '("elfeed-" "with-elfeed-db-visit"))) +(register-definition-prefixes "elfeed-db" '("elfeed-" "with-elfeed-db-visit")) ;;;*** ;;;### (autoloads nil "elfeed-lib" "elfeed-lib.el" (0 0 0 0)) ;;; Generated autoloads from elfeed-lib.el -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "elfeed-lib" '("elfeed-"))) +(register-definition-prefixes "elfeed-lib" '("elfeed-")) ;;;*** @@ -72,9 +68,7 @@ Store a link to an elfeed search or entry buffer. When storing a link to an entry, automatically extract all the entry metadata. These can be used in the capture templates as %:elfeed-entry-. See `elfeed-entry--create' for the list -of available props. - -\(fn)" nil nil) +of available props." nil nil) (autoload 'elfeed-link-open "elfeed-link" "\ Jump to an elfeed entry or search. @@ -91,7 +85,7 @@ search buffer or show a concrete entry. ;;;### (autoloads nil "elfeed-log" "elfeed-log.el" (0 0 0 0)) ;;; Generated autoloads from elfeed-log.el -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "elfeed-log" '("elfeed-log"))) +(register-definition-prefixes "elfeed-log" '("elfeed-log")) ;;;*** @@ -110,21 +104,26 @@ Restore the state of an elfeed-search buffer on desktop restore. (add-to-list 'desktop-buffer-mode-handlers '(elfeed-search-mode . elfeed-search-desktop-restore)) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "elfeed-search" '("elfeed-s"))) +(register-definition-prefixes "elfeed-search" '("elfeed-s")) ;;;*** ;;;### (autoloads nil "elfeed-show" "elfeed-show.el" (0 0 0 0)) ;;; Generated autoloads from elfeed-show.el -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "elfeed-show" '("elfeed-"))) +(autoload 'elfeed-show-bookmark-handler "elfeed-show" "\ +Show the bookmarked entry saved in the `RECORD'. + +\(fn RECORD)" nil nil) + +(register-definition-prefixes "elfeed-show" '("elfeed-")) ;;;*** ;;;### (autoloads nil "xml-query" "xml-query.el" (0 0 0 0)) ;;; Generated autoloads from xml-query.el -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "xml-query" '("xml-query"))) +(register-definition-prefixes "xml-query" '("xml-query")) ;;;*** diff --git a/elpa/elfeed-20191227.426/elfeed-csv.el b/elpa/elfeed-20210822.2129/elfeed-csv.el similarity index 100% rename from elpa/elfeed-20191227.426/elfeed-csv.el rename to elpa/elfeed-20210822.2129/elfeed-csv.el diff --git a/elpa/elfeed-20191227.426/elfeed-curl.el b/elpa/elfeed-20210822.2129/elfeed-curl.el similarity index 89% rename from elpa/elfeed-20191227.426/elfeed-curl.el rename to elpa/elfeed-20210822.2129/elfeed-curl.el index 9e3308d8..b24d9f9b 100644 --- a/elpa/elfeed-20191227.426/elfeed-curl.el +++ b/elpa/elfeed-20210822.2129/elfeed-curl.el @@ -183,7 +183,9 @@ output format." (defun elfeed-curl-get-capabilities () "Return capabilities plist for the curl at `elfeed-curl-program-name'. :version -- cURL's version string -:compression -- non-nil if --compressed is supported" +:compression -- non-nil if --compressed is supported +:protocols -- symbol list of supported protocols +:features -- string list of supported features" (let* ((cache elfeed-curl--capabilities-cache) (cache-value (gethash elfeed-curl-program-name cache))) (if cache-value @@ -195,12 +197,21 @@ output format." (setf (point) (point-min)) (when (re-search-forward "[.0-9]+" nil t) (match-string 0)))) - (compression + (protocols (progn (setf (point) (point-min)) - (not (null (re-search-forward "libz\\>" nil t)))))) + (when (re-search-forward "^Protocols: \\(.*\\)$" nil t) + (mapcar #'intern (split-string (match-string 1)))))) + (features + (progn + (setf (point) (point-min)) + (when (re-search-forward "^Features: \\(.*\\)$") + (split-string (match-string 1)))))) (setf (gethash elfeed-curl-program-name cache) - `(:version ,version :compression ,compression))))))) + (list :version version + :compression (not (null (member "libz" features))) + :protocols protocols + :features features))))))) (defun elfeed-curl-get-version () "Return the version of curl for `elfeed-curl-program-name'." @@ -252,7 +263,7 @@ abcdefghijklmnopqrstuvwxyz|~")) (:header (narrow-to-region h-start h-end)) (:content (narrow-to-region c-start c-end)))))) -(defun elfeed-curl--parse-headers () +(defun elfeed-curl--parse-http-headers () "Parse the current HTTP response headers into buffer-locals. Sets `elfeed-curl-headers'and `elfeed-curl-status-code'. Use `elfeed-curl--narrow' to select a header." @@ -306,10 +317,11 @@ URL can be a string or a list of URL strings." (nconc (nreverse args) url) (nreverse (cons url args))))) -(defun elfeed-curl--prepare-response (url n) +(defun elfeed-curl--prepare-response (url n protocol) "Prepare response N for delivery to user." (elfeed-curl--narrow :header n) - (elfeed-curl--parse-headers) + (when (eq protocol 'http) + (elfeed-curl--parse-http-headers)) (setf elfeed-curl-location (elfeed-curl--final-location url elfeed-curl-headers)) (elfeed-curl--narrow :content n) @@ -328,28 +340,44 @@ DATA is the content to include in the request." (coding-system-for-read 'binary)) (apply #'call-process elfeed-curl-program-name nil t nil args)) (elfeed-curl--parse-write-out) - (elfeed-curl--prepare-response url 0))) + (elfeed-curl--prepare-response url 0 (elfeed-curl--protocol-type url)))) + +(defun elfeed-curl--protocol-type (url) + (let ((scheme (intern (or (url-type (url-generic-parse-url url)) "nil")))) + (cl-case scheme + ((https nil) 'http) + (otherwise scheme)))) (defun elfeed-curl--call-callback (buffer n url cb) "Prepare the buffer for callback N and call it." - (let ((result nil)) + (let ((result nil) + (protocol (elfeed-curl--protocol-type url))) (with-current-buffer buffer (setf elfeed-curl-error-message "unable to parse curl response") (unwind-protect (progn - (elfeed-curl--prepare-response url n) - (if (and (>= elfeed-curl-status-code 400) - (<= elfeed-curl-status-code 599)) - (setf elfeed-curl-error-message - (format "HTTP %d" elfeed-curl-status-code)) - (setf result t - elfeed-curl-error-message nil))) - ;; Always call callback - (unwind-protect - (funcall cb result) - ;; Always clean up - (when (zerop (cl-decf elfeed-curl--refcount)) - (kill-buffer))))))) + (elfeed-curl--prepare-response url n protocol) + (cond ((eq protocol 'file) + ;; No status code is returned by curl for file:// urls + (setf result t + elfeed-curl-error-message nil)) + ((eq protocol 'gopher) + (setf result t + elfeed-curl-error-message nil + elfeed-curl-status-code nil)) + ((and (>= elfeed-curl-status-code 400) + (<= elfeed-curl-status-code 599)) + (setf elfeed-curl-error-message + (format "HTTP %d" elfeed-curl-status-code))) + (t + (setf result t + elfeed-curl-error-message nil))) + ;; Always call callback + (unwind-protect + (funcall cb result) + ;; Always clean up + (when (zerop (cl-decf elfeed-curl--refcount)) + (kill-buffer)))))))) (defun elfeed-curl--fail-callback (buffer cb) "Inform the callback the request failed." @@ -416,6 +444,7 @@ results will not." elfeed-curl--refcount (length url))) (push (cons url cb) elfeed-curl--requests) (setf elfeed-curl--refcount 1)) + (set-process-query-on-exit-flag process nil) (setf (process-sentinel process) #'elfeed-curl--sentinel))))) (defun elfeed-curl--request-key (url headers method data) diff --git a/elpa/elfeed-20191227.426/elfeed-db.el b/elpa/elfeed-20210822.2129/elfeed-db.el similarity index 100% rename from elpa/elfeed-20191227.426/elfeed-db.el rename to elpa/elfeed-20210822.2129/elfeed-db.el diff --git a/elpa/elfeed-20191227.426/elfeed-lib.el b/elpa/elfeed-20210822.2129/elfeed-lib.el similarity index 98% rename from elpa/elfeed-20191227.426/elfeed-lib.el rename to elpa/elfeed-20210822.2129/elfeed-lib.el index 5168a390..4db9f1b3 100644 --- a/elpa/elfeed-20191227.426/elfeed-lib.el +++ b/elpa/elfeed-20210822.2129/elfeed-lib.el @@ -9,11 +9,12 @@ ;;; Code: -(require 'xml) (require 'cl-lib) +(require 'thingatpt) (require 'time-date) (require 'url-parse) (require 'url-util) +(require 'xml) (defun elfeed-expose (function &rest args) "Return an interactive version of FUNCTION, 'exposing' it to the user." @@ -269,7 +270,9 @@ systems." (defun elfeed-get-url-at-point () "Try to get a plain URL at point." - (or (url-get-url-at-point) + (or (if (fboundp 'thing-at-point-url-at-point) + (thing-at-point-url-at-point) + (with-no-warnings (url-get-url-at-point))) (thing-at-point 'url))) (defun elfeed-move-to-first-empty-line () diff --git a/elpa/elfeed-20191227.426/elfeed-link.el b/elpa/elfeed-20210822.2129/elfeed-link.el similarity index 94% rename from elpa/elfeed-20191227.426/elfeed-link.el rename to elpa/elfeed-20210822.2129/elfeed-link.el index c127bf2e..40500677 100644 --- a/elpa/elfeed-20191227.426/elfeed-link.el +++ b/elpa/elfeed-20210822.2129/elfeed-link.el @@ -25,7 +25,9 @@ entry metadata. These can be used in the capture templates as %:elfeed-entry-. See `elfeed-entry--create' for the list of available props." (cond ((derived-mode-p 'elfeed-search-mode) - (org-store-link-props + (funcall (if (fboundp 'org-link-store-props) + #'org-link-store-props + (with-no-warnings #'org-store-link-props)) :type "elfeed" :link (format "elfeed:%s" elfeed-search-filter) :description elfeed-search-filter)) diff --git a/elpa/elfeed-20191227.426/elfeed-log.el b/elpa/elfeed-20210822.2129/elfeed-log.el similarity index 100% rename from elpa/elfeed-20191227.426/elfeed-log.el rename to elpa/elfeed-20210822.2129/elfeed-log.el diff --git a/elpa/elfeed-20210822.2129/elfeed-pkg.el b/elpa/elfeed-20210822.2129/elfeed-pkg.el new file mode 100644 index 00000000..3018653d --- /dev/null +++ b/elpa/elfeed-20210822.2129/elfeed-pkg.el @@ -0,0 +1,10 @@ +(define-package "elfeed" "20210822.2129" "an Emacs Atom/RSS feed reader" + '((emacs "24.3")) + :commit "162d7d545ed41c27967d108c04aa31f5a61c8e16" :authors + '(("Christopher Wellons" . "wellons@nullprogram.com")) + :maintainer + '("Christopher Wellons" . "wellons@nullprogram.com") + :url "https://github.com/skeeto/elfeed") +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/elpa/elfeed-20191227.426/elfeed-search.el b/elpa/elfeed-20210822.2129/elfeed-search.el similarity index 94% rename from elpa/elfeed-20191227.426/elfeed-search.el rename to elpa/elfeed-20210822.2129/elfeed-search.el index a439e5c5..d1d9b572 100644 --- a/elpa/elfeed-20191227.426/elfeed-search.el +++ b/elpa/elfeed-20210822.2129/elfeed-search.el @@ -116,13 +116,13 @@ When live editing the filter, it is bound to :live.") (quit-window)) (defun elfeed-search-last-entry () - "Place point on first entry." + "Place point on last entry." (interactive) (setf (point) (point-max)) - (forward-line -2)) + (forward-line -1)) (defun elfeed-search-first-entry () - "Place point on last entry." + "Place point on first entry." (interactive) (setf (point) (point-min))) @@ -183,19 +183,7 @@ When live editing the filter, it is bound to :live.") unread-count entry-count (hash-table-count feeds)))))) -(defvar elfeed-search--header-cache nil - "Cache of the last computed header.") - (defun elfeed-search--header () - "Returns the string to be used as the Elfeed header." - (if (eql (car elfeed-search--header-cache) (buffer-modified-tick)) - (cdr elfeed-search--header-cache) - (let* ((header (elfeed-search--header-1)) - (cache (cons (buffer-modified-tick) header))) - (prog1 header - (setf elfeed-search--header-cache cache))))) - -(defun elfeed-search--header-1 () "Computes the string to be used as the Elfeed header." (cond ((zerop (elfeed-db-last-update)) @@ -229,7 +217,15 @@ When live editing the filter, it is bound to :live.") truncate-lines t buffer-read-only t desktop-save-buffer #'elfeed-search-desktop-save - header-line-format '(:eval (funcall elfeed-search-header-function))) + ;; Provide format string via symbol value slot so that it will + ;; not be %-construct interpolated. The symbol is uninterned + ;; so that it's not *really* a global variable. + header-line-format + (let ((symbol (make-symbol "dummy"))) + (put symbol 'risky-local-variable t) + `(:eval + (prog1 ',symbol + (set ',symbol (funcall elfeed-search-header-function)))))) (set (make-local-variable 'bookmark-make-record-function) #'elfeed-search-bookmark-make-record) (buffer-disable-undo) @@ -465,15 +461,12 @@ AFTER-SECONDS and BEFORE-SECONDS." The time (@n-units-ago) filter may not exactly match the original, but will be equal in its effect." (let ((output ())) - (let ((after (plist-get filter :after)) - (before (plist-get filter :before)) - (must-have (plist-get filter :must-have)) - (must-not-have (plist-get filter :must-not-have)) - (matches (plist-get filter :matches)) - (not-matches (plist-get filter :not-matches)) - (limit (plist-get filter :limit)) - (feeds (plist-get filter :feeds)) - (not-feeds (plist-get filter :not-feeds))) + (cl-destructuring-bind (&key after before + must-have must-not-have + matches not-matches + feeds not-feeds + limit &allow-other-keys) + filter (when after (push (elfeed-search--recover-units after before) output)) (dolist (tag must-have) @@ -501,14 +494,11 @@ filtering against a limit filter (ex. #10). See `elfeed-search-set-filter' for format/syntax documentation. This function must *only* be called within the body of `with-elfeed-db-visit' because it may perform a non-local exit." - (let ((after (plist-get filter :after)) - (must-have (plist-get filter :must-have)) - (must-not-have (plist-get filter :must-not-have)) - (matches (plist-get filter :matches)) - (not-matches (plist-get filter :not-matches)) - (limit (plist-get filter :limit)) - (feeds (plist-get filter :feeds)) - (not-feeds (plist-get filter :not-feeds))) + (cl-destructuring-bind (&key must-have must-not-have + matches not-matches + feeds not-feeds + after limit &allow-other-keys) + filter (let* ((tags (elfeed-entry-tags entry)) (date (elfeed-entry-date entry)) (age (- (float-time) date)) @@ -548,15 +538,12 @@ This function must *only* be called within the body of Executing a filter in bytecode form is generally faster than \"interpreting\" the filter with `elfeed-search-filter'." - (let ((after (plist-get filter :after)) - (before (plist-get filter :before)) - (must-have (plist-get filter :must-have)) - (must-not-have (plist-get filter :must-not-have)) - (matches (plist-get filter :matches)) - (not-matches (plist-get filter :not-matches)) - (limit (plist-get filter :limit)) - (feeds (plist-get filter :feeds)) - (not-feeds (plist-get filter :not-feeds))) + (cl-destructuring-bind (&key after before + must-have must-not-have + matches not-matches + feeds not-feeds + limit &allow-other-keys) + filter `(lambda (,(if (or after matches not-matches must-have must-not-have) 'entry '_entry) @@ -727,8 +714,10 @@ When FORCE is non-nil, redraw even when the database hasn't changed." (dolist (entry elfeed-search-entries) (funcall elfeed-search-print-entry-function entry) (insert "\n")) - (insert "End of entries.\n") (setf elfeed-search-last-update (float-time)))) + (when (zerop (buffer-size)) + ;; If nothing changed, force a header line update + (force-mode-line-update)) (run-hooks 'elfeed-search-update-hook)))) (defun elfeed-search-fetch (prefix) @@ -785,16 +774,21 @@ If IGNORE-REGION-P is non-nil, only return the entry under point." If there is a prefix argument, visit the current entry in the browser defined by `browse-url-generic-program'." (interactive "P") - (let ((entries (elfeed-search-selected))) + (let ((buffer (current-buffer)) + (entries (elfeed-search-selected))) (cl-loop for entry in entries do (elfeed-untag entry 'unread) when (elfeed-entry-link entry) do (if use-generic-p (browse-url-generic it) (browse-url it))) - (mapc #'elfeed-search-update-entry entries) - (unless (or elfeed-search-remain-on-entry (use-region-p)) - (forward-line)))) + ;; `browse-url' could have switched to another buffer if eww or another + ;; internal browser is used, but the remainder of the functions needs to + ;; run in the elfeed buffer. + (with-current-buffer buffer + (mapc #'elfeed-search-update-entry entries) + (unless (or elfeed-search-remain-on-entry (use-region-p)) + (forward-line))))) (defun elfeed-search-yank () "Copy the selected feed items to clipboard and kill-ring." diff --git a/elpa/elfeed-20191227.426/elfeed-show.el b/elpa/elfeed-20210822.2129/elfeed-show.el similarity index 91% rename from elpa/elfeed-20191227.426/elfeed-show.el rename to elpa/elfeed-20210822.2129/elfeed-show.el index 033ade0b..4915cae4 100644 --- a/elpa/elfeed-20191227.426/elfeed-show.el +++ b/elpa/elfeed-20210822.2129/elfeed-show.el @@ -9,6 +9,8 @@ (require 'url-parse) (require 'browse-url) (require 'message) ; faces +(require 'bookmark) +(bookmark-maybe-load-default-file) (require 'elfeed) (require 'elfeed-db) @@ -28,15 +30,20 @@ (defvar elfeed-show-entry nil "The entry being displayed in this buffer.") -(defvar elfeed-show-entry-switch #'switch-to-buffer - "Function to call to display and switch to the feed entry buffer. -Defaults to `switch-to-buffer'.") - -(defvar elfeed-show-entry-delete #'elfeed-kill-buffer - "Function called when quitting from the elfeed-entry -buffer. Does not take any arguments. +(defcustom elfeed-show-entry-switch #'switch-to-buffer + "Function used to display the feed entry buffer." + :group 'elfeed + :type '(choice (function-item switch-to-buffer) + (function-item pop-to-buffer) + function)) -Defaults to `elfeed-kill-buffer'.") +(defcustom elfeed-show-entry-delete #'elfeed-kill-buffer + "Function called when quitting from the elfeed-entry buffer. +Called without arguments." + :group 'elfeed + :type '(choice (function-item elfeed-kill-buffer) + (function-item delete-window) + function)) (defvar elfeed-show-refresh-function #'elfeed-show-refresh--mail-style "Function called to refresh the `*elfeed-entry*' buffer.") @@ -81,6 +88,8 @@ Defaults to `elfeed-kill-buffer'.") buffer-read-only t) (buffer-disable-undo) (make-local-variable 'elfeed-show-entry) + (set (make-local-variable 'bookmark-make-record-function) + #'elfeed-show-bookmark-make-record) (run-mode-hooks 'elfeed-show-mode-hook)) (defalias 'elfeed-show-tag--unread @@ -119,9 +128,8 @@ Defaults to `elfeed-kill-buffer'.") (defun elfeed--show-format-author (author) "Format author plist for the header." - (let ((name (plist-get author :name)) - (uri (plist-get author :uri)) - (email (plist-get author :email))) + (cl-destructuring-bind (&key name uri email &allow-other-keys) + author (cond ((and name uri email) (format "%s <%s> (%s)" name email uri)) ((and name email) @@ -215,6 +223,7 @@ The result depends on the value of `elfeed-show-unique-buffers'." (interactive) (funcall elfeed-show-entry-delete) (with-current-buffer (elfeed-search-buffer) + (when elfeed-search-remain-on-entry (forward-line 1)) (call-interactively #'elfeed-search-show-entry))) (defun elfeed-show-prev () @@ -222,6 +231,7 @@ The result depends on the value of `elfeed-show-unique-buffers'." (interactive) (funcall elfeed-show-entry-delete) (with-current-buffer (elfeed-search-buffer) + (when elfeed-search-remain-on-entry (forward-line 1)) (forward-line -2) (call-interactively #'elfeed-search-show-entry))) @@ -463,6 +473,28 @@ Prompts for ENCLOSURE-INDEX when called interactively." (progn (kill-new url) (message url)) (call-interactively 'shr-copy-url)))) +;; Bookmarks + +;;;###autoload +(defun elfeed-show-bookmark-handler (record) + "Show the bookmarked entry saved in the `RECORD'." + (let* ((id (bookmark-prop-get record 'id)) + (entry (elfeed-db-get-entry id)) + (position (bookmark-get-position record))) + (elfeed-show-entry entry) + (goto-char position))) + +(defun elfeed-show-bookmark-make-record () + "Save the current position and the entry into a bookmark." + (let ((id (elfeed-entry-id elfeed-show-entry)) + (position (point)) + (title (elfeed-entry-title elfeed-show-entry))) + `(,(format "elfeed entry \"%s\"" title) + (id . ,id) + (location . ,title) + (position . ,position) + (handler . elfeed-show-bookmark-handler)))) + (provide 'elfeed-show) ;;; elfeed-show.el ends here diff --git a/elpa/elfeed-20191227.426/elfeed.el b/elpa/elfeed-20210822.2129/elfeed.el similarity index 99% rename from elpa/elfeed-20191227.426/elfeed.el rename to elpa/elfeed-20210822.2129/elfeed.el index b8b8d851..bbfef261 100644 --- a/elpa/elfeed-20191227.426/elfeed.el +++ b/elpa/elfeed-20210822.2129/elfeed.el @@ -10,14 +10,6 @@ ;; Elfeed is a web feed client for Emacs, inspired by notmuch. See ;; the README for full documentation. -;; Notice: Before stamping a new release the following places need to -;; be updated: -;; * NEWS.md -;; * elfeed.el (`elfeed-version') -;; * elfeed-pkg.el -;; * web/elfeed-web-pkg.el -;; * Makefile (VERSION) - ;;; Code: (require 'cl-lib) @@ -39,7 +31,7 @@ "An Emacs web feed reader." :group 'comm) -(defconst elfeed-version "3.3.0") +(defconst elfeed-version "3.4.1") (defcustom elfeed-feeds () "List of all feeds that Elfeed should follow. diff --git a/elpa/elfeed-20191227.426/xml-query.el b/elpa/elfeed-20210822.2129/xml-query.el similarity index 100% rename from elpa/elfeed-20191227.426/xml-query.el rename to elpa/elfeed-20210822.2129/xml-query.el diff --git a/elpa/elfeed-org-20181015.1100/elfeed-org-pkg.el b/elpa/elfeed-org-20181015.1100/elfeed-org-pkg.el deleted file mode 100644 index 87a54ba5..00000000 --- a/elpa/elfeed-org-20181015.1100/elfeed-org-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "elfeed-org" "20181015.1100" "Configure elfeed with one or more org-mode files" '((elfeed "1.1.1") (org "8.2.7") (dash "2.10.0") (s "1.9.0") (cl-lib "0.5")) :commit "607b8bf4923a995260a072559b77bee188614a06" :keywords '("news") :authors '(("Remy Honig" . "remyhonig@gmail.com")) :maintainer '("Remy Honig" . "remyhonig@gmail.com") :url "https://github.com/remyhonig/elfeed-org") diff --git a/elpa/elfeed-org-20181015.1100/elfeed-org-autoloads.el b/elpa/elfeed-org-20221118.852/elfeed-org-autoloads.el similarity index 74% rename from elpa/elfeed-org-20181015.1100/elfeed-org-autoloads.el rename to elpa/elfeed-org-20221118.852/elfeed-org-autoloads.el index 4d673410..e0f0c487 100644 --- a/elpa/elfeed-org-20181015.1100/elfeed-org-autoloads.el +++ b/elpa/elfeed-org-20221118.852/elfeed-org-autoloads.el @@ -1,4 +1,4 @@ -;;; elfeed-org-autoloads.el --- automatically extracted autoloads +;;; elfeed-org-autoloads.el --- automatically extracted autoloads -*- lexical-binding: t -*- ;; ;;; Code: @@ -10,11 +10,13 @@ ;;; Generated autoloads from elfeed-org.el (autoload 'elfeed-org "elfeed-org" "\ -Hook up rmh-elfeed-org to read the `org-mode' configuration when elfeed is run. +Hook up rmh-elfeed-org to read the `org-mode' configuration when elfeed is run." t nil) -\(fn)" t nil) +(register-definition-prefixes "elfeed-org" '("elfeed-org-" "rmh-elfeed-")) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "elfeed-org" '("elfeed-org-" "rmh-elfeed-org-"))) +;;;*** + +;;;### (autoloads nil nil ("elfeed-org-pkg.el") (0 0 0 0)) ;;;*** diff --git a/elpa/elfeed-org-20221118.852/elfeed-org-pkg.el b/elpa/elfeed-org-20221118.852/elfeed-org-pkg.el new file mode 100644 index 00000000..99c6dba4 --- /dev/null +++ b/elpa/elfeed-org-20221118.852/elfeed-org-pkg.el @@ -0,0 +1,18 @@ +(define-package "elfeed-org" "20221118.852" "Configure elfeed with one or more org-mode files" + '((elfeed "1.1.1") + (org "8.2.7") + (dash "2.10.0") + (s "1.9.0") + (cl-lib "0.5")) + :commit "3242ec0519800a58f20480c8a6e3b3337d137084" :authors + '(("Remy Honig" . "remyhonig@gmail.com")) + :maintainers + '(("Remy Honig" . "remyhonig@gmail.com")) + :maintainer + '("Remy Honig" . "remyhonig@gmail.com") + :keywords + '("news") + :url "https://github.com/remyhonig/elfeed-org") +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/elpa/elfeed-org-20181015.1100/elfeed-org.el b/elpa/elfeed-org-20221118.852/elfeed-org.el similarity index 84% rename from elpa/elfeed-org-20181015.1100/elfeed-org.el rename to elpa/elfeed-org-20221118.852/elfeed-org.el index 84f4c273..cf2db468 100644 --- a/elpa/elfeed-org-20181015.1100/elfeed-org.el +++ b/elpa/elfeed-org-20221118.852/elfeed-org.el @@ -4,7 +4,6 @@ ;; Author : Remy Honig ;; Package-Requires : ((elfeed "1.1.1") (org "8.2.7") (dash "2.10.0") (s "1.9.0") (cl-lib "0.5")) -;; Package-Version: 20181015.1100 ;; URL : https://github.com/remyhonig/elfeed-org ;; Version : 20170423.1 ;; Keywords : news @@ -35,6 +34,7 @@ (require 'elfeed) (require 'org) +(require 'org-element) (require 'dash) (require 's) (require 'cl-lib) @@ -61,7 +61,7 @@ :group 'elfeed-org :type 'bool) -(defcustom rmh-elfeed-org-files (list "~/.emacs.d/elfeed.org") +(defcustom rmh-elfeed-org-files (list (locate-user-emacs-file "elfeed.org")) "The files where we look to find trees with the `rmh-elfeed-org-tree-id'." :group 'elfeed-org :type '(repeat (file :tag "org-mode file"))) @@ -128,11 +128,23 @@ all. Which in my opinion makes the process more traceable." (level 1)) (org-element-map parsed-org 'headline (lambda (h) - (let* ((current-level (org-element-property :level h)) - (delta-level (- current-level level)) - (delta-tags (--map (intern (substring-no-properties it)) - (org-element-property :tags h))) - (heading (org-element-property :raw-value h))) + (pcase-let* + ((current-level (org-element-property :level h)) + (delta-level (- current-level level)) + (delta-tags (--map (intern (substring-no-properties it)) + (org-element-property :tags h))) + (heading (org-element-property :raw-value h)) + (`(,link ,description) + (org-element-map (org-element-property :title h) 'link + (lambda (link) + (list + (org-element-property :raw-link link) + (when (and (org-element-property :contents-begin link) + (org-element-property :contents-end link)) + (buffer-substring + (org-element-property :contents-begin link) + (org-element-property :contents-end link))))) + nil t))) ;; update the tags stack when we visit a parent or sibling (unless (> delta-level 0) (let ((drop-num (+ 1 (- delta-level)))) @@ -142,8 +154,12 @@ all. Which in my opinion makes the process more traceable." ;; save the tags that might apply to potential children of the current heading (push (-concat (-first-item tags) delta-tags) tags) ;; return the heading and inherited tags - (-concat (list heading) - (-first-item tags))))))) + (if (and link description) + (-concat (list link) + (-first-item tags) + (list description)) + (-concat (list (if link link heading)) + (-first-item tags)))))))) ;; TODO: mark wrongly formatted feeds (PoC for unretrievable feeds) (defun rmh-elfeed-org-flag-headlines (parsed-org) @@ -159,7 +175,7 @@ all. Which in my opinion makes the process more traceable." (-filter (lambda (entry) (and - (string-match "\\(http\\|entry-title\\)" (car entry)) + (string-match "\\(http\\|gopher\\|file\\|entry-title\\)" (car entry)) (not (member (intern rmh-elfeed-org-ignore-tag) entry)))) list)) @@ -202,8 +218,9 @@ all. Which in my opinion makes the process more traceable." (> (length headline) 1)) (progn (add-to-list 'elfeed-feeds (butlast headline)) - (let ((feed (elfeed-db-get-feed (car headline)))) - (setf (elfeed-meta feed :title) (car (last headline))) + (let ((feed (elfeed-db-get-feed (car headline))) + (title (substring-no-properties (car (last headline))))) + (setf (elfeed-meta feed :title) title) (elfeed-meta feed :title))) (add-to-list 'elfeed-feeds headline))) @@ -219,11 +236,10 @@ all. Which in my opinion makes the process more traceable." ;; Convert org structure to elfeed structure and register taggers and subscriptions (let* ((headlines (rmh-elfeed-org-import-headlines-from-files files tree-id)) - (subscriptions (rmh-elfeed-org-filter-subscriptions headlines)) (taggers (rmh-elfeed-org-filter-taggers headlines)) (elfeed-taggers (-map 'rmh-elfeed-org-convert-headline-to-tagger-params taggers)) (elfeed-tagger-hooks (-map 'rmh-elfeed-org-export-entry-hook elfeed-taggers))) - (-each subscriptions 'rmh-elfeed-org-export-feed) + (-each headlines 'rmh-elfeed-org-export-feed) (-each taggers 'rmh-elfeed-org-export-entry-hook)) ;; Tell user what we did @@ -236,6 +252,22 @@ all. Which in my opinion makes the process more traceable." (--each elfeed-org-new-entry-hook (funcall it entry))) +(defun rmh-elfeed-apply-autotags-now-advice () + "Make entry title matching rules works with `elfeed-apply-autotags-now'." + (interactive) + (let* ((headlines (rmh-elfeed-org-import-headlines-from-files + rmh-elfeed-org-files rmh-elfeed-org-tree-id)) + (subscriptions (rmh-elfeed-org-filter-subscriptions headlines)) + (taggers (rmh-elfeed-org-filter-taggers headlines)) + (elfeed-taggers (-map 'rmh-elfeed-org-convert-headline-to-tagger-params taggers)) + (entry-match-taggers (-map (lambda (tagger-params) + (elfeed-make-tagger + :entry-title (nth 0 tagger-params) + :add (nth 1 tagger-params))) elfeed-taggers))) + (with-elfeed-db-visit (entry feed) + (dolist (tagger entry-match-taggers) + (funcall tagger entry))))) + (defun rmh-elfeed-org-filter-taggers (headlines) "Filter tagging rules from the HEADLINES in the tree." (-non-nil (-map @@ -243,21 +275,6 @@ all. Which in my opinion makes the process more traceable." (when (s-starts-with? "entry-title" (car headline)) headline)) headlines))) -(defun rmh-elfeed-org-filter-subscriptions (headlines) - "Filter subscriptions to rss feeds from the HEADLINES in the tree." - (-non-nil (-map - (lambda (headline) - (let* ((text (car headline)) - (link-and-title (s-match "^\\[\\[\\(http.+?\\)\\]\\[\\(.+?\\)\\]\\]" text)) - (hyperlink (s-match "^\\[\\[\\(http.+?\\)\\]\\(?:\\[.+?\\]\\)?\\]" text))) - (cond ((s-starts-with? "http" text) headline) - (link-and-title (-concat (list (nth 1 hyperlink)) - (cdr headline) - (list (nth 2 link-and-title)))) - (hyperlink (-concat (list (nth 1 hyperlink)) (cdr headline)))))) - headlines))) - - (defun rmh-elfeed-org-convert-opml-to-org (xml level) "Convert OPML content to Org format. Argument XML content of the OPML file. @@ -319,7 +336,8 @@ Argument ORG-BUFFER the buffer to write the OPML content to." (if url (setq opml-outline (format " %s\n" (make-string (* 2 current-level) ? ) - title (xml-escape-string url))) + (xml-escape-string title) + (xml-escape-string url))) (unless (s-starts-with? "entry-title" heading) (unless (member rmh-elfeed-org-tree-id tags) ;; insert category title only when it is neither the top @@ -328,7 +346,7 @@ Argument ORG-BUFFER the buffer to write the OPML content to." (push current-level need-ends) (setq opml-outline (format " %s\n" (make-string (* 2 current-level) ? ) - title)))))) + (xml-escape-string title))))))) (setq opml-body (concat opml-body opml-outline)))))) ;; fill missing end outlines at end @@ -371,6 +389,7 @@ because most of Feed/RSS readers only support trees of 2 levels deep." "Load all feed settings before elfeed is started." (rmh-elfeed-org-process rmh-elfeed-org-files rmh-elfeed-org-tree-id)) (add-hook 'elfeed-new-entry-hook #'elfeed-org-run-new-entry-hook) + (advice-add 'elfeed-apply-autotags-now :after #'rmh-elfeed-apply-autotags-now-advice) (add-hook 'elfeed-http-error-hooks (lambda (url status) (when rmh-elfeed-org-auto-ignore-invalid-feeds (rmh-elfeed-org-mark-feed-ignore url)))) -- 2.47.3