branch: elpa/elfeed
commit 88911fa44ca249010a33b9bbb8070649f6f0a828
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>
elfeed-search-set-entry/feed-title: Use old title as initial input
---
elfeed-search.el | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
diff --git a/elfeed-search.el b/elfeed-search.el
index 970deb6e5a..86e7390ed2 100644
--- a/elfeed-search.el
+++ b/elfeed-search.el
@@ -972,22 +972,31 @@ the browser defined by
`browse-url-secondary-browser-function'."
(declare-function elfeed-show-entry "elfeed-show")
(elfeed-show-entry entry)))
-(defun elfeed-search-set-entry-title (title)
+(defun elfeed-search-set-entry-title (&optional title)
"Manually set TITLE for the entry under point.
Sets the :title key of the entry's metadata. See `elfeed-meta'."
- (interactive "sEntry title: " elfeed-search-mode)
+ (interactive nil elfeed-search-mode)
(let ((entry (or (elfeed-search-selected :ignore-region)
(user-error "No entry selected!"))))
+ (unless title
+ (setq title (read-from-minibuffer "Entry title: "
+ (or (elfeed-meta entry :title)
+ (elfeed-entry-title entry)))))
(setf (elfeed-meta entry :title) title)
(elfeed-search-update-entry entry)))
-(defun elfeed-search-set-feed-title (title)
+(defun elfeed-search-set-feed-title (&optional title)
"Manually set TITLE for the feed belonging to the entry under point.
Sets the :title key of the feed's metadata. See `elfeed-meta'."
- (interactive "sFeed title: " elfeed-search-mode)
- (let ((entry (or (elfeed-search-selected :ignore-region)
- (user-error "No entry selected!"))))
- (setf (elfeed-meta (elfeed-entry-feed entry) :title) title)
+ (interactive nil elfeed-search-mode)
+ (let ((feed (elfeed-entry-feed
+ (or (elfeed-search-selected :ignore-region)
+ (user-error "No entry selected!")))))
+ (unless title
+ (setq title (read-from-minibuffer "Feed title: "
+ (or (elfeed-meta feed :title)
+ (elfeed-feed-title feed)))))
+ (setf (elfeed-meta feed :title) title)
(elfeed-search-update :force)))
;; Live Filters