From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: link fontification issue in org 9.0.8 Date: Wed, 21 Jun 2017 22:58:13 +0200 Message-ID: <87vanp83dm.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39188) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNmhi-0000HX-Tt for emacs-orgmode@gnu.org; Wed, 21 Jun 2017 16:58:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dNmhe-0005Vm-2g for emacs-orgmode@gnu.org; Wed, 21 Jun 2017 16:58:22 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:58092) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dNmhd-0005VR-Sp for emacs-orgmode@gnu.org; Wed, 21 Jun 2017 16:58:18 -0400 In-Reply-To: (John Kitchin's message of "Wed, 21 Jun 2017 07:20:11 -0400") 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: John Kitchin Cc: "emacs-orgmode@gnu.org" Hello, John Kitchin writes: > in a recent upgrade to 9.0.8, all the links have reverted to being > fontified with an org-link face. > > For example, this link definition > > #+BEGIN_SRC emacs-lisp > (org-link-set-parameters > "red" > :follow (lambda (path) (message "You clicked me.")) > :export (lambda (path desc backend) > (cond > ((eq 'html backend) > (format "%s" > (or desc path))))) > :face '(:foreground "red") > :help-echo "Click me for a message.") > #+END_SRC > > #+RESULTS: > > should make this link -> red:test > > have a red face with a tooltip, but it is just a blue org-link face with > the standard tooltip. The follow and export function seems to work, but not > the face and help-echo. > > I think this is related to the consolidation of org-activate-links. In the > properties section it incorrectly uses code like: (org-link-get-parameter > type :face) where type is defined as plain/bracket/... etc. That code > should be replaced with this, which gets the link-type from (link-type > (org-element-property :type link-object)) and replaces type with link-type. > > This is around line 5982 in org.el > > (let* ((link-object (save-excursion > (goto-char start) > (save-match-data (org-element-link-parser)))) > (link (org-element-property :raw-link link-object)) > (link-type (org-element-property :type link-object)) > (path (org-element-property :path link-object)) > (properties ;for link's visible part > (list > 'face (pcase (org-link-get-parameter link-type :face) > ((and (pred functionp) face) (funcall face path)) > ((and (pred facep) face) face) > ((and (pred consp) face) face) ;anonymous > (_ 'org-link)) > 'mouse-face (or (org-link-get-parameter link-type :mouse-face) > 'highlight) > 'keymap (or (org-link-get-parameter link-type :keymap) > org-mouse-map) > 'help-echo (pcase (org-link-get-parameter link-type :help-echo) > ((and (pred stringp) echo) echo) > ((and (pred functionp) echo) echo) > (_ (concat "LINK: " link))) > 'htmlize-link (pcase (org-link-get-parameter link-type > :htmlize-link) > ((and (pred functionp) f) (funcall f)) > (_ `(:uri ,link))) > 'font-lock-multiline t))) Fixed. Thank you for the report and the analysis. Regards, -- Nicolas Goaziou