From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Link "bracket-types" Date: Fri, 11 May 2018 16:15:59 +0200 Message-ID: <8736yynuqo.fsf@nicolasgoaziou.fr> 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: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53380) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fH8qS-0003eC-Kg for emacs-orgmode@gnu.org; Fri, 11 May 2018 10:16:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fH8qO-00055A-Jv for emacs-orgmode@gnu.org; Fri, 11 May 2018 10:16:28 -0400 Received: from relay3-d.mail.gandi.net ([2001:4b98:c:538::195]:55511) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fH8qO-00054F-Cl for emacs-orgmode@gnu.org; Fri, 11 May 2018 10:16:24 -0400 In-Reply-To: (Michael Brand's message of "Fri, 11 May 2018 15:55:50 +0200") 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: Michael Brand Cc: Org Mode --=-=-= Content-Type: text/plain Michael Brand writes: > Do you mean here attached and updated as of today? I meant to attach it, but apparently forgot. I attach it here for other feedback. > 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. Indeed, we disagree. I find your suggestion not predictable enough. Sometimes square brackets appear, sometimes not... Besides, it doesn't solve the issue my suggestion was initially trying to solve. > 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. It's a matter of taste. Showing 2 square brackets doesn't bring much value, IMO. Anyway, we might need more feedback on the topic. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Add-partial-to-org-descriptive-link.patch Content-Description: partial link visibility >From 9e49be14b86a359cd4ea834763c697349eba0d2f Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Fri, 11 May 2018 14:59:33 +0200 Subject: [PATCH] Add `partial' to `org-descriptive-link' * lisp/org.el (org-activate-links): Handle `partial' value. --- lisp/org.el | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 2cfe46697..bf1e19f36 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -5914,8 +5914,17 @@ This includes angle, plain, and bracket links." ,(or (org-link-get-parameter type :display) 'org-link)) properties)) - (visible-start (or (match-beginning 4) (match-beginning 2))) - (visible-end (or (match-end 4) (match-end 2)))) + (visible-start + (pcase org-descriptive-links + (`nil start) + (`partial (or (match-beginning 3) + (1- (match-beginning 2)))) + (_ (or (match-beginning 4) (match-beginning 2))))) + (visible-end + (pcase org-descriptive-links + (`nil end) + (`partial (or (match-end 3) (1+ (match-end 2)))) + (_ (or (match-end 4) (match-end 2)))))) (add-text-properties start visible-start hidden) (add-text-properties visible-start visible-end properties) (add-text-properties visible-end end hidden) -- 2.17.0 --=-=-=--