From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Brand Subject: Re: Link "bracket-types" Date: Fri, 11 May 2018 15:55:50 +0200 Message-ID: References: <87a7t8q64z.fsf@nicolasgoaziou.fr> <87603vr86w.fsf@nicolasgoaziou.fr> <87mux7prcw.fsf@nicolasgoaziou.fr> <87a7t7pjb2.fsf@nicolasgoaziou.fr> <87603voxbl.fsf@nicolasgoaziou.fr> <877eoanxrv.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46652) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fH8Ww-0007QC-ME for emacs-orgmode@gnu.org; Fri, 11 May 2018 09:56:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fH8Ws-0001ul-Nh for emacs-orgmode@gnu.org; Fri, 11 May 2018 09:56:18 -0400 Received: from mail-qt0-x231.google.com ([2607:f8b0:400d:c0d::231]:42906) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fH8Ws-0001nR-JW for emacs-orgmode@gnu.org; Fri, 11 May 2018 09:56:14 -0400 Received: by mail-qt0-x231.google.com with SMTP id c2-v6so7130685qtn.9 for ; Fri, 11 May 2018 06:55:51 -0700 (PDT) In-Reply-To: <877eoanxrv.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Nicolas Goaziou Cc: Org Mode On Fri, May 11, 2018 at 3:10 PM, Nicolas Goaziou wrote: > Completing myself, > > Nicolas Goaziou 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) #+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) #+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) #+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