emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Link "bracket-types"


From: Nicolas Goaziou
Subject: Re: [O] Link "bracket-types"
Date: Thu, 10 May 2018 10:14:36 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

Hello,

Michael Brand <address@hidden> writes:
>
> For the four different Org link "bracket-types" shown below I would
> like to have four different faces to be able to distinguish them at
> first sight. What is the recommended way to do this?

This is not possible. I'm not even sure this is desirable.

Note that 2) is not a "bracket type".

> The four Org link bracket-types by example:
>
> Buffer raw content (or visible-mode):
> : 1) 
> [[https://en.wikipedia.org/wiki/Filter#References][https://en.wikipedia.org/wiki/Filter]]
> : 2) https://en.wikipedia.org/wiki/Filter
> : 3) [[https://en.wikipedia.org/wiki/Filter]]
> : 4) [[https://en.wikipedia.org/wiki/Filter_(higher-order_function)]]
>
> (To try them out copy the above into an Org buffer and remove the colons.)
>
> Currently rendered all with the same face as:
> : 1) https://en.wikipedia.org/wiki/Filter
> : 2) https://en.wikipedia.org/wiki/Filter
> : 3) https://en.wikipedia.org/wiki/Filter
> : 4) https://en.wikipedia.org/wiki/Filter_(higher-order_function)
>
> As you know and can see above 1) to 3) can not be distinguished when
> rendered with the default of org-descriptive-links t.

Just move the mouse over them. A tooltip or the minibuffer will display
what the link is really.

> The brackets for 3) are optional as 2) opens the same URL.

They are strictly equivalent, indeed.

> The brackets for 4) are mandatory because without them
> "_(higher-order_function)" is not fontified and not recognized by
> org-open-at-point as part of the Org link any more.

True. This limitation is a feature. You cannot have parenthesis in plain
links even though they are technically allowed in URL.

However, you could also use angle brackets.

<https://en.wikipedia.org/wiki/Filter_(higher-order_function)>

The advantage on angle brackets is that they make it clear there is no
description attached to the link, i.e., the brackets are visible when
fontified). You can also use angle brackets for a more prominent visual
clue.

I'm not sure to understand the problem you want to solve. What is
important is if the displayed part of a link is a description or the URL
itself, i.e., case 1. This is solved by hovering the mouse above the
link. The other cases are equivalent, barring the limitation from case
2.

Regards,

-- 
Nicolas Goaziou



reply via email to

[Prev in Thread] Current Thread [Next in Thread]