branch: elpa/elfeed
commit 3ab97952cb752631c9636b55852a7fb4682d0b6c
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>
New customization subgroups
---
elfeed-curl.el | 8 ++---
elfeed-db.el | 6 ++--
elfeed-log.el | 43 ++++++++++++----------
elfeed-search.el | 88 ++++++++++++++++++---------------------------
elfeed-show.el | 108 ++++++++++++++++++++++++++-----------------------------
elfeed-tree.el | 15 +++++---
elfeed.el | 11 +-----
7 files changed, 129 insertions(+), 150 deletions(-)
diff --git a/elfeed-curl.el b/elfeed-curl.el
index 386197c670..e5502cb2d8 100644
--- a/elfeed-curl.el
+++ b/elfeed-curl.el
@@ -46,19 +46,20 @@
(require 'elfeed-lib)
(require 'elfeed-log)
+(defgroup elfeed-curl ()
+ "Elfeed curl backend."
+ :group 'elfeed)
+
(defcustom elfeed-curl-program-name "curl"
"Name/path by which to invoke the curl program."
- :group 'elfeed
:type 'string)
(defcustom elfeed-curl-max-connections 16
"Maximum number of concurrent fetches."
- :group 'elfeed
:type 'integer)
(defcustom elfeed-curl-timeout 30
"Maximum number of seconds a fetch is allowed to take once started."
- :group 'elfeed
:type 'integer)
(defcustom elfeed-curl-extra-arguments ()
@@ -67,7 +68,6 @@ These extra arguments are appended after Elfeed's own
arguments,
and care must be taken to not interfere with Elfeed's needs. The
guideline is to avoid arguments that change anything about curl's
output format."
- :group 'elfeed
:type '(repeat string))
(defvar elfeed-curl-queue ()
diff --git a/elfeed-db.el b/elfeed-db.el
index 3ddc064e7a..6c2d308dbc 100644
--- a/elfeed-db.el
+++ b/elfeed-db.el
@@ -73,6 +73,10 @@ to the feed."
(cons :tag "Feed URL and autotags" string (repeat symbol))
(cons :tag "Feed URL, metadata and autotags" string sexp))))
+(defgroup elfeed-db ()
+ "Elfeed database."
+ :group 'elfeed)
+
(defcustom elfeed-db-directory
(locate-user-emacs-file "elfeed" "~/.elfeed")
"Directory where elfeed will store its database.
@@ -80,12 +84,10 @@ You may want to customize this setting in your user
configuration.
Elfeed uses a subdirectory of your Emacs configuration by default, e.g.,
~/.config/emacs/elfeed, in order to keep the user home clean. But if an
old ~/.elfeed directory is present, it will be used instead."
- :group 'elfeed
:type 'directory)
(defcustom elfeed-db-cache-timeout 60
"Time in seconds to keep the cache buffer alive."
- :group 'elfeed
:type 'natnum)
(defvar elfeed-db nil
diff --git a/elfeed-log.el b/elfeed-log.el
index a790b4a2ae..902138d33c 100644
--- a/elfeed-log.el
+++ b/elfeed-log.el
@@ -14,39 +14,44 @@
(require 'elfeed-lib)
+(defgroup elfeed-log ()
+ "Elfeed log buffer."
+ :group 'elfeed)
+
+(defcustom elfeed-log-buffer-name " *elfeed-log*"
+ "Name of buffer used for logging Elfeed events."
+ :type 'string)
+
+(defcustom elfeed-log-level 'info
+ "Lowest type of messages to be logged."
+ :type 'symbol)
+
+(defvar elfeed-log-error-count 0
+ "Error count.")
+
+(defgroup elfeed-log-faces ()
+ "Elfeed log buffer faces."
+ :group 'elfeed-log)
+
(defface elfeed-log-date-face
'((t :inherit font-lock-type-face))
- "Face for showing the date in the elfeed log buffer."
- :group 'elfeed)
+ "Face for showing the date in the elfeed log buffer.")
(defface elfeed-log-error-level-face
'((t :foreground "red"))
- "Face for showing the `error' log level in the elfeed log buffer."
- :group 'elfeed)
+ "Face for showing the `error' log level in the elfeed log buffer.")
(defface elfeed-log-warn-level-face
'((t :foreground "goldenrod"))
- "Face for showing the `warn' log level in the elfeed log buffer."
- :group 'elfeed)
+ "Face for showing the `warn' log level in the elfeed log buffer.")
(defface elfeed-log-info-level-face
'((t :foreground "deep sky blue"))
- "Face for showing the `info' log level in the elfeed log buffer."
- :group 'elfeed)
+ "Face for showing the `info' log level in the elfeed log buffer.")
(defface elfeed-log-debug-level-face
'((t :foreground "magenta2"))
- "Face for showing the `debug' log level in the elfeed log buffer."
- :group 'elfeed)
-
-(defvar elfeed-log-buffer-name " *elfeed-log*"
- "Name of buffer used for logging Elfeed events.")
-
-(defvar elfeed-log-level 'info
- "Lowest type of messages to be logged.")
-
-(defvar elfeed-log-error-count 0
- "Error count.")
+ "Face for showing the `debug' log level in the elfeed log buffer.")
(defun elfeed-log-buffer ()
"Returns the buffer for `elfeed-log', creating it as needed."
diff --git a/elfeed-search.el b/elfeed-search.el
index 48dde95c5f..fc68d6fa25 100644
--- a/elfeed-search.el
+++ b/elfeed-search.el
@@ -20,6 +20,10 @@
(require 'elfeed)
+(defgroup elfeed-search ()
+ "Elfeed search buffer."
+ :group 'elfeed)
+
(defvar-local elfeed-search-entries ()
"List of the entries currently on display.")
@@ -55,31 +59,26 @@ The functions may modify the search buffer or add overlays,
for example
"Delay search buffer updates by that many seconds to reduce redraws.
This delay affects only the redraws after feed updates. See also
`elfeed-search-live-delay' and `elfeed-search-resize-delay'."
- :group 'elfeed
:type 'number)
(defcustom elfeed-search-live-delay 0.1
"Delay search buffer live updates by that many seconds to reduce redraws.
This delay affects only the redraws during live filtering. See also
`elfeed-search-update-delay' and `elfeed-search-resize-delay'."
- :group 'elfeed
:type 'number)
(defcustom elfeed-search-resize-delay 0.1
"Delay search buffer resizing by that many seconds to reduce redraws.
Set to nil to disable redraw on resize."
- :group 'elfeed
:type '(choice (const nil) number))
(defcustom elfeed-search-filter "@6months +unread"
"Query string filtering shown entries."
- :group 'elfeed
:type 'string
:local t)
(defcustom elfeed-search-completion t
"Enable tag and search filter completion."
- :group 'elfeed
:type 'boolean)
(define-obsolete-variable-alias 'elfeed-sort-order
@@ -91,7 +90,6 @@ Set to nil to disable redraw on resize."
Changing this from the default will lead to misleading results
during live filter editing, but the results be will correct when
live filter editing is exited."
- :group 'elfeed
:type '(choice (const descending) (const ascending)))
(defcustom elfeed-search-sort-function nil
@@ -107,7 +105,6 @@ live filter editing is exited.
The variable can also be set to a list of functions (or nil for the
default function) such that you can cycle between the function via the
command `elfeed-search-cycle-order'."
- :group 'elfeed
:type `(choice
(const :tag "Group by feed" ,#'elfeed-search-group-by-feed)
(function :tag "Custom function")
@@ -138,14 +135,12 @@ be set to a list of symbols show, browse, tag, mark and
yank, such that
point does not move after the listed operations. Example:
(setq elfeed-search-remain-on-entry \\='(browse show yank))"
- :group 'elfeed
:type '(choice (const nil) (const t)
(repeat symbol)))
(defcustom elfeed-search-clipboard-type 'PRIMARY
"Selects the clipboard `elfeed-search-yank' should use.
Choices are the symbols PRIMARY, SECONDARY, or CLIPBOARD."
- :group 'elfeed
:type '(choice (const PRIMARY) (const SECONDARY) (const CLIPBOARD)))
(defcustom elfeed-search-date-format '("%Y-%m-%d" 10 :left)
@@ -153,19 +148,33 @@ Choices are the symbols PRIMARY, SECONDARY, or CLIPBOARD."
This should be (string integer keyword) for (format width alignment).
Possible alignments are :left and :right."
- :group 'elfeed
:type '(list string integer (choice (const :left) (const :right))))
(defcustom elfeed-search-separator-date-format "%b %Y"
"The `format-time-string' format for date separators."
- :group 'elfeed
:type '(choice (const nil) string))
(defcustom elfeed-search-compile-filter t
"If non-nil, compile search filters into bytecode on the fly."
- :group 'elfeed
:type 'boolean)
+(defcustom elfeed-search-title-max-width 70
+ "Maximum column width for titles in the `elfeed-search' buffer."
+ :type 'integer)
+
+(defcustom elfeed-search-title-min-width 16
+ "Minimum column width for titles in the `elfeed-search' buffer."
+ :type 'integer)
+
+(defcustom elfeed-search-trailing-width 30
+ "Space reserved for displaying the feed and tag information."
+ :type 'integer)
+
+(defcustom elfeed-search-face-alist
+ '((unread elfeed-search-unread-title-face))
+ "Mapping of tags to faces in the Elfeed entry listing."
+ :type '(alist :key-type symbol :value-type (repeat face)))
+
(defvar elfeed-search-header-function #'elfeed-search--header
"Function that returns the string to be used for the header line.")
@@ -381,83 +390,56 @@ The customization `elfeed-search-date-format' sets the
formatting."
(elfeed-format-column (format-time-string format (seconds-to-time date))
width align)))
+(defgroup elfeed-search-faces ()
+ "Elfeed search buffer faces."
+ :group 'elfeed-search)
+
(defface elfeed-search-date-face
'((((class color) (background light)) (:foreground "#aaa"))
(((class color) (background dark)) (:foreground "#77a")))
- "Face used in search mode for dates."
- :group 'elfeed)
+ "Face used in search mode for dates.")
(defface elfeed-search-title-face
'((((class color) (background light)) (:foreground "#000"))
(((class color) (background dark)) (:foreground "#fff")))
- "Face used in search mode for titles."
- :group 'elfeed)
+ "Face used in search mode for titles.")
(defface elfeed-search-unread-title-face
'((t :weight bold))
- "Face used in search mode for unread entry titles."
- :group 'elfeed)
+ "Face used in search mode for unread entry titles.")
(defface elfeed-search-feed-face
'((((class color) (background light)) (:foreground "#aa0"))
(((class color) (background dark)) (:foreground "#ff0")))
- "Face used in search mode for feed titles."
- :group 'elfeed)
+ "Face used in search mode for feed titles.")
(defface elfeed-search-tag-face
'((((class color) (background light)) (:foreground "#070"))
(((class color) (background dark)) (:foreground "#0f0")))
- "Face used in search mode for tags."
- :group 'elfeed)
+ "Face used in search mode for tags.")
(defface elfeed-search-last-update-face
'((t))
- "Face for showing the date and time the database was last updated."
- :group 'elfeed)
+ "Face for showing the date and time the database was last updated.")
(defface elfeed-search-unread-count-face
'((((class color) (background light)) (:foreground "#000"))
(((class color) (background dark)) (:foreground "#fff")))
- "Face used in search mode for the unread counter in the header."
- :group 'elfeed)
+ "Face used in search mode for the unread counter in the header.")
(defface elfeed-search-filter-face
'((t :inherit mode-line-buffer-id))
- "Face for showing the current Elfeed search filter."
- :group 'elfeed)
+ "Face for showing the current Elfeed search filter.")
(defface elfeed-search-marked-face
'((t :inherit (lazy-highlight bold)))
- "Face for marked entries."
- :group 'elfeed)
+ "Face for marked entries.")
(put 'elfeed-search-marked-overlay 'face 'elfeed-search-marked-face)
(defface elfeed-search-separator-face
'((t :inherit (bold elfeed-search-date-face) :underline t :extend t))
- "Face for marked entries."
- :group 'elfeed)
-
-(defcustom elfeed-search-title-max-width 70
- "Maximum column width for titles in the `elfeed-search' buffer."
- :group 'elfeed
- :type 'integer)
-
-(defcustom elfeed-search-title-min-width 16
- "Minimum column width for titles in the `elfeed-search' buffer."
- :group 'elfeed
- :type 'integer)
-
-(defcustom elfeed-search-trailing-width 30
- "Space reserved for displaying the feed and tag information."
- :group 'elfeed
- :type 'integer)
-
-(defcustom elfeed-search-face-alist
- '((unread elfeed-search-unread-title-face))
- "Mapping of tags to faces in the Elfeed entry listing."
- :group 'elfeed
- :type '(alist :key-type symbol :value-type (repeat face)))
+ "Face for marked entries.")
(defun elfeed-search--faces (tags)
"Return all the faces that apply to an entry with TAGS."
diff --git a/elfeed-show.el b/elfeed-show.el
index 5ecbdefbfb..6b016377b6 100644
--- a/elfeed-show.el
+++ b/elfeed-show.el
@@ -15,54 +15,22 @@
(require 'elfeed)
(require 'elfeed-search)
-(defface elfeed-show-header-face
- '((t :inherit font-lock-keyword-face))
- "Face for showing headers in the elfeed-entry buffer."
- :group 'elfeed)
-
-(defface elfeed-show-title-face
- '((t :weight bold :inherit font-lock-string-face))
- "Face for showing the title name in the elfeed-entry buffer."
- :group 'elfeed)
-
-(defface elfeed-show-author-face
- '((t :weight bold :inherit font-lock-string-face))
- "Face for showing the author name in the elfeed-entry buffer."
- :group 'elfeed)
-
-(defface elfeed-show-date-face
- '((t :inherit font-lock-string-face))
- "Face for showing the date in the elfeed-entry buffer."
- :group 'elfeed)
-
-(defface elfeed-show-feed-face
- '((t :inherit font-lock-string-face))
- "Face for showing the feed name in the elfeed-entry buffer."
- :group 'elfeed)
-
-(defface elfeed-show-tags-face
- '((t :inherit font-lock-string-face))
- "Face for showing the tag names in the elfeed-entry buffer."
+(defgroup elfeed-show ()
+ "Elfeed entry buffer."
:group 'elfeed)
(defcustom elfeed-show-truncate-long-urls t
"When non-nil, use an ellipsis to shorten very long displayed URLs."
- :group 'elfeed
:type 'boolean)
(define-obsolete-variable-alias 'elfeed-show-entry-author
'elfeed-show-author "4.0.0")
(defcustom elfeed-show-author t
"When non-nil, show the entry's author (if it's in the entry's metadata)."
- :group 'elfeed
:type 'boolean)
-(defvar-local elfeed-show-entry nil
- "The entry being displayed in this buffer.")
-
(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))
@@ -70,14 +38,61 @@
(defcustom elfeed-show-entry-delete #'ignore
"Function called when quitting from the elfeed-entry buffer.
Called without arguments."
- :group 'elfeed
:type '(choice function))
(defcustom elfeed-show-date-format "%a, %e %b %Y %T %Z"
"The ‘format-time-string’ format for date in the elfeed-entry buffer."
- :group 'elfeed
:type 'string)
+(defcustom elfeed-show-unique-buffers nil
+ "When non-nil, every entry buffer gets a unique name.
+This allows for displaying multiple show buffers at the same
+time."
+ :type 'boolean)
+
+(defcustom elfeed-enclosure-default-dir "~/"
+ "Default directory for saving enclosures.
+This can be either a string (a file system path), or a function
+that takes a filename and the mime-type as arguments, and returns
+the enclosure dir."
+ :type 'directory)
+
+(defcustom elfeed-save-multiple-enclosures-without-asking nil
+ "If non-nil, saving multiple enclosures asks once for a directory.
+All attachments are saved in the chosen directory."
+ :type 'boolean)
+
+(defgroup elfeed-show-faces ()
+ "Elfeed entry buffer faces."
+ :group 'elfeed-show)
+
+(defface elfeed-show-header-face
+ '((t :inherit font-lock-keyword-face))
+ "Face for showing headers in the elfeed-entry buffer.")
+
+(defface elfeed-show-title-face
+ '((t :weight bold :inherit font-lock-string-face))
+ "Face for showing the title name in the elfeed-entry buffer.")
+
+(defface elfeed-show-author-face
+ '((t :weight bold :inherit font-lock-string-face))
+ "Face for showing the author name in the elfeed-entry buffer.")
+
+(defface elfeed-show-date-face
+ '((t :inherit font-lock-string-face))
+ "Face for showing the date in the elfeed-entry buffer.")
+
+(defface elfeed-show-feed-face
+ '((t :inherit font-lock-string-face))
+ "Face for showing the feed name in the elfeed-entry buffer.")
+
+(defface elfeed-show-tags-face
+ '((t :inherit font-lock-string-face))
+ "Face for showing the tag names in the elfeed-entry buffer.")
+
+(defvar-local elfeed-show-entry nil
+ "The entry being displayed in this buffer.")
+
(defvar elfeed-show-refresh-function #'elfeed-show-refresh--mail-style
"Function called to refresh the elfeed-entry buffer.")
@@ -234,13 +249,6 @@ Used as `revert-buffer-function'."
(funcall elfeed-show-refresh-function)
(run-hooks 'elfeed-show-update-hook))
-(defcustom elfeed-show-unique-buffers nil
- "When non-nil, every entry buffer gets a unique name.
-This allows for displaying multiple show buffers at the same
-time."
- :group 'elfeed
- :type 'boolean)
-
(defun elfeed-show--buffer-name (entry)
"Return the appropriate buffer name for ENTRY.
The result depends on the value of `elfeed-show-unique-buffers'."
@@ -339,20 +347,6 @@ the browser defined by
`browse-url-secondary-browser-function'."
;; Enclosures:
-(defcustom elfeed-enclosure-default-dir "~/"
- "Default directory for saving enclosures.
-This can be either a string (a file system path), or a function
-that takes a filename and the mime-type as arguments, and returns
-the enclosure dir."
- :type 'directory
- :group 'elfeed)
-
-(defcustom elfeed-save-multiple-enclosures-without-asking nil
- "If non-nil, saving multiple enclosures asks once for a directory.
-All attachments are saved in the chosen directory."
- :type 'boolean
- :group 'elfeed)
-
(defvar elfeed-show-enclosure-filename-function
#'elfeed-show-enclosure-filename-remote
"Function called to generate the filename for an enclosure.")
diff --git a/elfeed-tree.el b/elfeed-tree.el
index 913082868e..693e6db641 100644
--- a/elfeed-tree.el
+++ b/elfeed-tree.el
@@ -47,21 +47,26 @@
(require 'elfeed-search)
(require 'outline)
-(defface elfeed-tree-highlight-unread-face
- '((t :inherit warning))
- "Face used in tree mode to highlight unread entries."
+(defgroup elfeed-tree ()
+ "Elfeed tree buffer."
:group 'elfeed)
(defcustom elfeed-tree-filter "@6months"
"Query string added to filter."
- :group 'elfeed
:type 'string)
(defcustom elfeed-tree-nodes ["├─●" "╰─●" "│ " " "]
"Strings used to visualize nodes of the tree."
- :group 'elfeed
:type '(vector string string string string))
+(defgroup elfeed-tree-faces ()
+ "Elfeed tree buffer faces."
+ :group 'elfeed-tree)
+
+(defface elfeed-tree-highlight-unread-face
+ '((t :inherit warning))
+ "Face used in tree mode to highlight unread entries.")
+
(defvar elfeed-tree-header-function #'elfeed-tree--header
"Function that returns the string to be used for the header line.")
diff --git a/elfeed.el b/elfeed.el
index 2abd219768..6b5675fb74 100644
--- a/elfeed.el
+++ b/elfeed.el
@@ -57,7 +57,6 @@
"Entry point for the command `elfeed'.
You can set this either to the search or the tree command, or an
alternative custom command if you use another custom frontend."
- :group 'elfeed
:type '(choice (const :tag "Search buffer" elfeed-search)
(const :tag "Tree buffer" elfeed-tree)
(command :tag "Custom command")))
@@ -68,7 +67,6 @@ alternative custom command if you use another custom
frontend."
#'elfeed-clipboard-get)
"List of functions to use to get possible feeds for `elfeed-add-feed'.
Each function should accept no arguments, and return a string or nil."
- :group 'elfeed
:type 'hook
:options (list #'elfeed-get-link-at-point
#'thing-at-point-url-at-point
@@ -80,7 +78,6 @@ Each function should accept no arguments, and return a string
or nil."
(warn "Elfeed: curl is not available, falling back to `url-retrieve'")
nil)
"If non-nil, fetch feeds using curl instead of `url-retrieve'."
- :group 'elfeed
:type 'boolean)
(defcustom elfeed-use-libxml nil
@@ -88,22 +85,18 @@ Each function should accept no arguments, and return a
string or nil."
This setting is experimental, and disabled for now. It may lead to
subtle differences to the usual xml.el parser, which renders certain
feeds unreadable. Enabling may yield a performance boost."
- :group 'elfeed
:type 'boolean)
(defcustom elfeed-user-agent (format "Emacs Elfeed %s" elfeed-version)
"User agent string to use for Elfeed (requires `elfeed-use-curl')."
- :group 'elfeed
:type 'string)
(defcustom elfeed-initial-tags '(unread)
"Initial tags for new entries."
- :group 'elfeed
:type '(repeat symbol))
(defcustom elfeed-confirm-browse-url 2
"Confirm `browse-url' when opening this many or more URLs."
- :group 'elfeed
:type '(choice (const :tag "No confirmation" nil)
(const :tag "Always confirm" t)
natnum))
@@ -120,7 +113,6 @@ feeds unreadable. Enabling may yield a performance boost."
(defcustom elfeed-default-directory nil
"Default directory for all Elfeed buffers."
- :group 'elfeed
:type '(choice (const :tag "current" nil)
(const :tag "user home" "~/")
directory))
@@ -136,8 +128,7 @@ feeds unreadable. Enabling may yield a performance boost."
"Maximum relative last update time in seconds in the header line.
Set to `most-positive-fixnum' to always use a relative time, or 0 to
never show a relative time."
- :type 'boolean
- :group 'elfeed)
+ :type 'boolean)
;; Fetching: