Amin Bandali writes: > Lars Ingebrigtsen writes: > > [...] >> >> So I think for this to work with erc, I think >> it would make sense to separate out the URL >> recognition in erc from other buttons, and >> base it on browse-url-button-regexp instead, >> which has worked out these kinks and is >> pretty DWIM. >> >> And then you can change the syntax table to >> make the other, simpler buttons (for nicks >> etc) work. > > Nice, I think that would make sense. FWIW, I'm > not familiar with how ERC does URL recognition > either, but I'll try to look into it soon-ish. > In the mean time, if anyone else is familiar > with this already, your help would be much > appreciated. :) > So I had a bit of time on my hands again, and looked into erc-button per Lars’s suggestion. Turns out there’s a C-h v erc-button-url-regexp RET. Replacing it with C-h v browse-url-button-regexp RET seems to improve things with surrounding pair of parens. In particular, the closing paren isn’t wrongly buttonized anymore, which is nice. I think the only nice-to-have at this point would be if quotes without a matching one were buttonized as part of the address, e.g. the one from Lars’s earlier example. For instance, currently in all the following examples buttonizing ends right before the quote (i.e. the t is the last clickable character): - https://example.org/test"x - https://example.org/test'x - https://example.org/test’x - https://example.org/test" - https://example.org/test' - https://example.org/test’ Note that the current behaviour is *not* a side-effect of my patch. > > Also, I'll keep on using my patch on my local > checkout and will report back if I notice any > serious issues. So far it's been working > pretty nicely here, minus the URL buttons. > Quick update: I’ve been using my patch every day for the past ~40 days, and I haven’t had any issues with it so far. * * * Finally, the updated patch (against master, but I’m hoping since it hasn’t diverged from emacs-27 much yet, it should still apply there):