emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Link "bracket-types"


From: Michael Brand
Subject: Re: [O] Link "bracket-types"
Date: Fri, 11 May 2018 15:55:50 +0200

On Fri, May 11, 2018 at 3:10 PM, Nicolas Goaziou <address@hidden> wrote:
> Completing myself,
>
> Nicolas Goaziou <address@hidden> writes:
>
>> If you mean that fontification should show one pair of brackets instead
>> of hiding them all, I suggested it already, users found it added too
>> much cruft.
>>
>> You may want to check ML archives about it.
>
> I searched the ML archives about that. It was a thread named
>
>   [RFC] Change visibility for bracket links
>
> in which you participated.
>
> It never ended on anything concrete because the involved participants
> disagreed on the default value -- or, to put it differently, I disagreed
> with mostly anyone else -- and some users suggested another way to do
> it, but never implemented their suggestion fully.

Thanks for the hint, found and read it again:
http://lists.gnu.org/archive/html/emacs-orgmode/2016-10/msg00136.html

To summarize the thread there, the initial proposal there was that the links

#+begin_example
1) [[https://en.wikipedia.org/wiki/Filter][Filter (Wikipedia en)]]
2) https://en.wikipedia.org/wiki/Filter
3) [[https://en.wikipedia.org/wiki/Filter]]
4) [[https://en.wikipedia.org/wiki/Filter_(higher-order_function)]]
5) <https://en.wikipedia.org/wiki/Filter_(higher-order_function)>
#+end_example

are rendered as

#+begin_example
1) [Filter (Wikipedia en)]
2) https://en.wikipedia.org/wiki/Filter
3) [https://en.wikipedia.org/wiki/Filter]
4) [https://en.wikipedia.org/wiki/Filter_(higher-order_function)]
5) <https://en.wikipedia.org/wiki/Filter_(higher-order_function)>
#+end_example

To summarize the thread here: By changing org-activate-links

#+begin_example
-                   (visible-start (or (match-beginning 4) (match-beginning 2)))
+                   (visible-start (or (match-beginning 4) start))
-                   (visible-end (or (match-end 4) (match-end 2))))
+                   (visible-end (or (match-end 4) end)))
#+end_example

the links are rendered as

#+begin_example
1) Filter (Wikipedia en)
2) https://en.wikipedia.org/wiki/Filter
3) [[https://en.wikipedia.org/wiki/Filter]]
4) [[https://en.wikipedia.org/wiki/Filter_(higher-order_function)]]
5) <https://en.wikipedia.org/wiki/Filter_(higher-order_function)>
#+end_example

which for me is the exact right amount of show and hide of _both_
bracket pairs and URL for all cases 1..5 in all my use cases.
Inclusive org-toggle-link-display to toggle only case 1.

For me this is the better solution than my initial idea of different
faces for the different cases. Not at least because aligned tables and
filled paragraphs with links like
#+begin_example
[[abbrev:123]]
#+end_example
are aligned and filled also in non-Org tools.

(For the last reason I use links of case 1 almost never in filled
paragraphs, almost only in un-filled paragraphs with Visual Line mode.
In filled paragraphs I avoid case 1 by using case 2 (or if necessary 4
or 5) and if helpful prepend a "description" just as Org-semantically
normal text, separated from the URL with whitespace.)

I will continue to use this change in my local branch.

> Anyway, here is an updated patch from the original thread, as a POC. It
> adds `partial' to `org-descriptive-links'. It isn't complete, as
> `org-toggle-link-display' should be altered so as to not modify
> `org-descriptive-links'.

Do you mean here attached and updated as of today?

> Maybe it's time for an old idea revival.

Currently we disagree in that you suggest one bracket where I prefer
none for descriptive links and you suggest one bracket where I prefer
two for the other cases, see rendering examples and my reasons for raw
plain text in non-Org tools above. If there would be an option to show
0 (current behavior), 1 (your suggestion) or 2 brackets (new)
everywhere I could use 2 as a compromise. If the option 0, 1 or 2
would be individual for case 1 and for case 3/4 that would of course
be perfect at least for me.

Michael



reply via email to

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