From 762d035611ae9687082ac0fbecaa452fdd0fff75 Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Sun, 22 Jun 2025 10:44:08 +0200 Subject: [PATCH] Search RSS links from end of article MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The “Link” link is usually placed at the very end of the article, so search from there. Furthermore, when another link also contains “Link”, searching from the end will avoid opening this link instead. --- site-lisp/db-mail.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/site-lisp/db-mail.el b/site-lisp/db-mail.el index ec30f25..478fa73 100644 --- a/site-lisp/db-mail.el +++ b/site-lisp/db-mail.el @@ -318,7 +318,7 @@ METHOD specifies the encrypt method used. Can be either (delete-trailing-whitespace))) (defun db/gnus-summary-open-Link () - "Open link named \"Link\" in current article." + "Open last link named \"Link\" in current article." (interactive) (save-window-excursion (save-mark-and-excursion @@ -327,10 +327,10 @@ METHOD specifies the encrypt method used. Can be either (let ((url nil)) (unless (eq major-mode 'gnus-article-mode) (gnus-summary-select-article-buffer)) - (goto-char (point-min)) + (goto-char (point-max)) (while (and (not url) - (search-forward "Link")) - (backward-char) + (search-backward "Link")) + (forward-char) (setq url (get-text-property (point) 'shr-url))) (when url (browse-url url)))))))