aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2022-03-15 12:36:06 +0100
committerLars Ingebrigtsen2022-03-15 12:36:06 +0100
commit8a9b4cfdff3422d9085cf052a8f6d34d81d7ac96 (patch)
tree992ac5576125be7d2f0efbfc05d08c75c95f2870
parente547ca1f8953ebbcd3bb65acc6eac34335ab3826 (diff)
downloademacs-8a9b4cfdff3422d9085cf052a8f6d34d81d7ac96.tar.gz
emacs-8a9b4cfdff3422d9085cf052a8f6d34d81d7ac96.zip
Revert "New command `gnus-summary-browse-all-urls' bound to "v""
This reverts commit f52dcfd03ad542704d9a43faab0c33be09ab442e. It was never agreed that this should be added.
-rw-r--r--etc/NEWS5
-rw-r--r--lisp/gnus/gnus-sum.el57
2 files changed, 22 insertions, 40 deletions
diff --git a/etc/NEWS b/etc/NEWS
index fc6c8b82546..d6b5da3902e 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -699,11 +699,6 @@ displayed as emojis. Default nil.
699This is bound to 'W D e' and will display symbols that have emoji 699This is bound to 'W D e' and will display symbols that have emoji
700representation as emojis. 700representation as emojis.
701 701
702+++
703*** New command 'gnus-summary-browse-all-urls'.
704This is for the rare cases when you want to open _all_ the URLs in the
705article, and is bound to "v".
706
707** EIEIO 702** EIEIO
708 703
709+++ 704+++
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 098d3a067d3..1be5a48068c 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -2010,7 +2010,6 @@ increase the score of each group you read."
2010 "s" #'gnus-summary-isearch-article 2010 "s" #'gnus-summary-isearch-article
2011 "TAB" #'gnus-summary-button-forward 2011 "TAB" #'gnus-summary-button-forward
2012 "<backtab>" #'gnus-summary-button-backward 2012 "<backtab>" #'gnus-summary-button-backward
2013 "v" #'gnus-summary-browse-all-urls
2014 "w" #'gnus-summary-browse-url 2013 "w" #'gnus-summary-browse-url
2015 "t" #'gnus-summary-toggle-header 2014 "t" #'gnus-summary-toggle-header
2016 "g" #'gnus-summary-show-article 2015 "g" #'gnus-summary-show-article
@@ -2197,7 +2196,6 @@ increase the score of each group you read."
2197 "s" #'gnus-summary-isearch-article 2196 "s" #'gnus-summary-isearch-article
2198 "TAB" #'gnus-summary-button-forward 2197 "TAB" #'gnus-summary-button-forward
2199 "<backtab>" #'gnus-summary-button-backward 2198 "<backtab>" #'gnus-summary-button-backward
2200 "v" #'gnus-summary-browse-all-urls
2201 "w" #'gnus-summary-browse-url 2199 "w" #'gnus-summary-browse-url
2202 "P" #'gnus-summary-print-article 2200 "P" #'gnus-summary-print-article
2203 "S" #'gnus-sticky-article 2201 "S" #'gnus-sticky-article
@@ -9447,16 +9445,6 @@ The 1st element is the button named by `gnus-collect-urls-primary-text'."
9447 (push primary urls)) 9445 (push primary urls))
9448 (delete-dups urls))) 9446 (delete-dups urls)))
9449 9447
9450(defun gnus-collect-urls-from-article ()
9451 "Select the article and return the list of URLs in it.
9452See 'gnus-collect-urls'."
9453 (gnus-summary-select-article)
9454 (gnus-with-article-buffer
9455 (article-goto-body)
9456 ;; Back up a char, in case body starts with a button.
9457 (backward-char)
9458 (gnus-collect-urls)))
9459
9460(defun gnus-shorten-url (url max) 9448(defun gnus-shorten-url (url max)
9461 "Return an excerpt from URL not exceeding MAX characters." 9449 "Return an excerpt from URL not exceeding MAX characters."
9462 (if (<= (length url) max) 9450 (if (<= (length url) max)
@@ -9468,38 +9456,37 @@ See 'gnus-collect-urls'."
9468 (concat "#" target))))) 9456 (concat "#" target)))))
9469 (concat host (string-truncate-left rest (- max (length host))))))) 9457 (concat host (string-truncate-left rest (- max (length host)))))))
9470 9458
9471(defun gnus-summary-browse-url (&optional _external) 9459(defun gnus-summary-browse-url (&optional external)
9472 "Scan the current article body for links, and offer to browse them. 9460 "Scan the current article body for links, and offer to browse them.
9473 9461
9474Links are opened using `browse-url' unless a prefix argument is 9462Links are opened using `browse-url' unless a prefix argument is
9475given: then `browse-url-secondary-browser-function' is used instead. 9463given: Then `browse-url-secondary-browser-function' is used instead.
9476 9464
9477If only one link is found, browse that directly, otherwise use 9465If only one link is found, browse that directly, otherwise use
9478completion to select a link. The first link marked in the 9466completion to select a link. The first link marked in the
9479article text with `gnus-collect-urls-primary-text' is the 9467article text with `gnus-collect-urls-primary-text' is the
9480default." 9468default."
9481 (interactive "P" gnus-summary-mode) 9469 (interactive "P" gnus-summary-mode)
9482 (let* ((urls (gnus-collect-urls-from-article)) 9470 (let (urls target)
9483 (target 9471 (gnus-summary-select-article)
9484 (cond ((= (length urls) 1) 9472 (gnus-with-article-buffer
9485 (car urls)) 9473 (article-goto-body)
9486 ((> (length urls) 1) 9474 ;; Back up a char, in case body starts with a button.
9487 (completing-read 9475 (backward-char)
9488 (format-prompt "URL to browse" 9476 (setq urls (gnus-collect-urls))
9489 (gnus-shorten-url (car urls) 40)) 9477 (setq target
9490 urls nil t nil nil (car urls)))))) 9478 (cond ((= (length urls) 1)
9491 (if target 9479 (car urls))
9492 (browse-url-button-open-url target) ; this handles the prefix arg 9480 ((> (length urls) 1)
9493 (message "No URLs found.")))) 9481 (completing-read
9494 9482 (format-prompt "URL to browse"
9495(defun gnus-summary-browse-all-urls (&optional _external) 9483 (gnus-shorten-url (car urls) 40))
9496 "Scan the current article body for links, and browse them. 9484 urls nil t nil nil (car urls)))))
9497 9485 (if target
9498Links are opened using `browse-url' unless a prefix argument is 9486 (if external
9499given: then `browse-url-secondary-browser-function' is used instead." 9487 (funcall browse-url-secondary-browser-function target)
9500 (interactive "P" gnus-summary-mode) 9488 (browse-url target))
9501 (dolist (url (gnus-collect-urls-from-article)) 9489 (message "No URLs found.")))))
9502 (browse-url-button-open-url url))) ; this handles the prefix arg
9503 9490
9504(defun gnus-summary-isearch-article (&optional regexp-p) 9491(defun gnus-summary-isearch-article (&optional regexp-p)
9505 "Do incremental search forward on the current article. 9492 "Do incremental search forward on the current article.