emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: miles christopher <numbchild@gmail.com>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Cc: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: [QUESTION] Org "customid" and "coderef" links seems not fontified as other file: link
Date: Tue, 5 Jan 2021 04:37:02 +0000	[thread overview]
Message-ID: <VI1PR1001MB1070A6568AF3D9641063F7E0A3D10@VI1PR1001MB1070.EURPRD10.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <87lfd8a7ji.fsf@nicolasgoaziou.fr>


Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Hello,
>
> stardiviner <numbchild@gmail.com> writes:
>
>> Bump this thread, hi, Nicolas, any thoughts or update about this?
>>
>> stardiviner <numbchild@gmail.com> writes:
>>
>>> I have following minimal testing code:
>>>
>>> #+begin_src emacs-lisp
>>> (defun org-link-beautify (start end path bracketp)
>>>   "Display icon for the Org link type."
>>>   (message
>>>    (format "start: %s, end: %s, path: %s, bracketp: %s" start end path bracketp)))
>>>
>>> (dolist (link-type (mapcar 'car org-link-parameters))
>>>     (org-link-set-parameters link-type :activate-func #'org-link-beautify))
>>> #+end_src
>>>
>>> The ~message~ does not print parameter values at all. I guess those "customid"
>>> [[#Usage] and "coderef" (coderef) are different with "file:" etc links. Is this
>>> true? 
>
> That's correct. coderef, customid, and fuzzy links are internal links.
> They are not really customizable. They are meant to behave the same in
> all Org documents.
>
>>> Here is my complete source code I want to try fontify customid and coderef
>>> links.
>>>
>>> https://github.com/stardiviner/org-link-beautify/blob/master/org-link-beautify.el#L67
>>>
>>> Is there any way to fix this problem?
>
> Coderef and custom-id links are fontified, so you may still change their
> appearance using font-lock configuration variables. Here be dragons.
>
> Regards,

I see, I searched some font-lock example code, but have not found any example
about font-lock + text-property. (Maybe my searching words is not good
enough...) How to write it? Do you got any hints? Thanks for your helping.

By the way I got an issue that org-link-beautify conflict with yasnippet[fn:1].
I know the key point is how Org Mode fontify the link. I tried to read code, but
have not found hint about how to disable fontify on link temporary. Can you give
some suggestion about this problem? Thanks too.

[fn:1] https://github.com/stardiviner/org-link-beautify/issues/5

Regards,

-- 
[ stardiviner ]
       I try to make every word tell the meaning that I want to express.

       Blog: https://stardiviner.github.io/
       IRC(freenode): stardiviner, Matrix: stardiviner
       GPG: F09F650D7D674819892591401B5DF1C95AE89AC3




      reply	other threads:[~2021-01-05  4:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-22  0:38 [QUESTION] Org "customid" and "coderef" links seems not fontified as other file: link stardiviner
2020-05-22 15:21 ` Nicolas Goaziou
2020-05-23  1:16   ` stardiviner
2020-12-23  2:48 ` stardiviner
2021-01-04 18:20   ` Nicolas Goaziou
2021-01-05  4:37     ` miles christopher [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=VI1PR1001MB1070A6568AF3D9641063F7E0A3D10@VI1PR1001MB1070.EURPRD10.PROD.OUTLOOK.COM \
    --to=numbchild@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=mail@nicolasgoaziou.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).