From 6c8aec38be059fe8bb8ed67617abc0df2d202ec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Wed, 23 May 2018 14:43:49 +0200 Subject: [PATCH] view: render URLs as "[%d]" not "[%d]" When we render URLs like https://gnu.org/[1] right-clicking on them in e.g. GNOME Terminal will also copy the "[1]" as well as the URL, inserting zero-width-space[1] between the two avoids this. I know about "g" (mu4e-view-go-to-url), but sometimes I want to open a URL in a different browser, or copy it into a non-Emacs program. This makes that easier. I think this improves the UI at a very trivial cost to users that don't care about this use-case. I could make this configurable, but unless someone vehemently objects to this I don't see the point of not just making it the default. In GNOME Terminal a ZWS is rendered simply as a space, and copy/pasting works as expected, but in Emacs's GTK GUI there's no space between the two. This was initially a plain ASCII space character, but djcb preferred a ZWP, and this works as well. 1. https://en.wikipedia.org/wiki/Zero-width_space --- mu4e/mu4e-view.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mu4e/mu4e-view.el b/mu4e/mu4e-view.el index f2fac567..cf694fd2 100644 --- a/mu4e/mu4e-view.el +++ b/mu4e/mu4e-view.el @@ -965,7 +965,7 @@ Also number them so they can be opened using `mu4e-view-go-to-url'." help-echo "[mouse-1] or [M-RET] to open the link")) (overlay-put ov 'after-string - (propertize (format "[%d]" num) + (propertize (format "\u200B[%d]" num) 'face 'mu4e-url-number-face)))))))))