Eric Abrahamsen <[email protected]> wrote: >>> Something to be aware of is that, sometime not too long ago, Lars >>> re-implemented links in article bodies using widgets instead of buttons.
>> The other way around -- they used to be widgets, and they're now >> buttons. > Sure enough, I didn't really know what I was talking about :) But at > least that points to a likely source of Tim's problem: he's trying to > use button commands in a version of Emacs/Gnus that is still using > widgets? Maybe :-). Anyway, I found a solution for one of my news- letters that states the number of entries in its subject and then has two links per entry with one link containing one information and the other link containing another informa- tion and additional (older) entries following that: | (let | ((subject (gnus-summary-article-subject))) | (if (string-match "^\\([0-9]+\\) new entries$" subject) | (let | ((number-of-entries-todo (string-to-number (match-string 1 subject)))) | (gnus-with-article-buffer | (article-goto-body) | (let | ((article-body-start (point)) | last-field1 | last-url) | (while (> number-of-entries-todo 0) | (widget-forward 1) | (if (< (point) article-body-start) | (error "Moved past the wrap!")) | (let | ((url-at-point (button-get (button-at (point)) 'shr-url)) | (widget-label (let | ((widget-properties (cdr (widget-at)))) | (buffer-substring-no-properties (plist-get widget-properties :from) (plist-get widget-properties :to))))) | (when (string-match "^https://domain.com/some-prefix/" url-at-point) | (if (not (string= last-url url-at-point)) | (setq last-field1 widget-label | last-url url-at-point) | (setq number-of-entries-todo (- number-of-entries-todo 1)) | (if (y-or-n-p (format "Browse %s (%s)? " widget-label last-field1)) | (browse-url url-at-point))))))))))) Now: a) The formula for widget-label feels way too complicated, but I did not find a predefined function for that pur- pose. Did I miss something? b) I use this code as part of gnus-select-article-hook. widget-forward does move point internally, but does not update/recenter the display. Is this due to gnus-with-article-buffer? What is the best way to make the *Article* buffer follow point's movement? TIA, Tim _______________________________________________ info-gnus-english mailing list [email protected] https://lists.gnu.org/mailman/listinfo/info-gnus-english
