On 06/23/19 14:16 PM, Lars Ingebrigtsen wrote: > Eric Abrahamsen writes: > >> I think once I was using widget-forward to collect buttons, it seemed >> natural to be able to handle all the types of buttons, not just URLs. >> For instance, I'd like to be able to start composing messages to mailto: >> buttons. > > Hm... I think that sounds less useful, really. In 99.9% of the cases, > you don't want to hit anything but the URLs, I think, and "polluting" > the list of URLs with mailto: stuff would make the feature more > cumbersome to use, in my opinion. > >> Then the only reliable way to "do" what the button does was to >> press it. Later Eric Fraga posted a variant that checked if the URL was >> a http URL, and used `browse-url' directly in that case. The whole >> function could be a lot simpler if we only collected http links. Though >> I'd still like to compose messages to email addresses... > > If we want to have a "collect mailto: addresses" thing, that could be a > separate command. > >> I'm posting the most recent version of the function below. Another bad >> thing is does is tries to manage window state, returning the >> summary/article config to what it was before clicking links, and I think >> that should be removed -- it's fragile, and none of the other >> summary/article commands do that. > > Yeah, good point. Okay, all sounds good. Here's a proper commit, with docs. I've bound it to both "w" and "A w". My only problem is, right now I'm getting URLs out of the buttons like so: (or (get-text-property (point) 'shr-url) (get-text-property (point) 'gnus-string)) In my experiments, I've only found http URLs from 'gnus-string not 'shr-url, and the 'gnus-string values also include things like email addresses. (I just noticed that having the `url-handler-mode' minor mode enabled breaks `browse-url's ability to browse mailto: links.) I could just filter URLs out based on a "http" prefix, but it still feels a bit limited. WDYT?