From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Brand Subject: Re: Link "bracket-types" Date: Thu, 10 May 2018 21:59:07 +0200 Message-ID: References: <87a7t8q64z.fsf@nicolasgoaziou.fr> <87603vr86w.fsf@nicolasgoaziou.fr> <87mux7prcw.fsf@nicolasgoaziou.fr> <87a7t7pjb2.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]:48430) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGriX-0000Lo-CU for emacs-orgmode@gnu.org; Thu, 10 May 2018 15:59:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fGriW-0007Ek-Cj for emacs-orgmode@gnu.org; Thu, 10 May 2018 15:59:09 -0400 Received: from mail-qt0-x22c.google.com ([2607:f8b0:400d:c0d::22c]:40834) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fGriW-0007Ec-8g for emacs-orgmode@gnu.org; Thu, 10 May 2018 15:59:08 -0400 Received: by mail-qt0-x22c.google.com with SMTP id h2-v6so4209274qtp.7 for ; Thu, 10 May 2018 12:59:08 -0700 (PDT) In-Reply-To: <87a7t7pjb2.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 Hi Nicolas On Thu, May 10, 2018 at 6:27 PM, Nicolas Goaziou wrote: > IIUC, you want fontification to make it obvious there are square > brackets in links, so that you know when they can be removed, for > improved readability outside Org. Yes, and generally just to see what is going on in Org with a little bit more details. In the meantime I tried a changed 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 to show the brackets of case 3/4 always which I even prefer over my earlier proposal of fontification. And org-toggle-link-display can still be used to toggle case 1. Somehow I don't like to hide the brackets for case 3/4 where nothing else is to be hidden. > If I'm correct, why don't you write a function that normalizes links for > you, so you don't have to bother, e.g., something that turns [[URL]] > into URL unless URL contains parenthesis or spaces? The search criteria is more complex because e. g. : https://en.wikipedia.org/wiki/Filter_(signal_processing) does not need brackets. The changed org-activate-links works better for me than an automatic normalization as I don't need and want to change all : [[URL]] now and prefer something similar to lazy evaluation: Change such links only when I stumble upon for some other reason because after bracket removal or replacement with angle brackets I have to interact anyway with org-fill-paragraph and table realignment etc. because I used org-descriptive-links nil before. Michael