emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* How to defint functions for other org link parameters like :face :display etc?
@ 2020-05-19 10:48 stardiviner
  2020-05-19 11:44 ` John Kitchin
  0 siblings, 1 reply; 8+ messages in thread
From: stardiviner @ 2020-05-19 10:48 UTC (permalink / raw)
  To: Org Mode

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256


I'm write an extension to beautify org link with colors and unicode icons for
better intuitive looks. But I don't know how to write those functions.

I checked out this info page ([[info:org#Adding Hyperlink Types][info:org#Adding Hyperlink Types]]) of org mode.

But have not found ~org-link-set-parameters~ other parameters code examples. I
hope some examples can be added for the all other parameters.

- -- 
[ 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
      
-----BEGIN PGP SIGNATURE-----

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7DuYkUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsMMRAf/dkXg9kxbgTeCdjfcl2koeJkBmfNj
xFGkuM0MlAc1oCIvGAeZ23GZ/B9cgtbfarGdZy1FJl9r7ehFx10Qg9w5keSIptA6
mplEeCeKNgTwzyHIMQhI4xS+a80YliJNc8MgFi2o9tImKqavVV2eqwHPZDNE8HXt
NEN+tfi8k2Sg7J7XhkdQD1YiNPTnKD8OXfzaR6162l5qSo3YuwoAegGmuULie2Ti
fci2pFO56g46xLp1tWvI6z+Zxabyff/IjKkSWSNTHuQ5lhvYsmuFKF1JDfS/DHJV
zy3Rr6sXK+MY1YWMMh2uLvmigL/BYl5HvjzC/Sq6wXcqVi0FuryeEfDWzg==
=HMJr
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to defint functions for other org link parameters like :face :display etc?
  2020-05-19 10:48 How to defint functions for other org link parameters like :face :display etc? stardiviner
@ 2020-05-19 11:44 ` John Kitchin
  2020-05-19 13:20   ` stardiviner
  2020-05-19 13:27   ` stardiviner
  0 siblings, 2 replies; 8+ messages in thread
From: John Kitchin @ 2020-05-19 11:44 UTC (permalink / raw)
  To: numbchild; +Cc: Org Mode

[-- Attachment #1: Type: text/plain, Size: 1693 bytes --]

My go to reference is
https://kitchingroup.cheme.cmu.edu/blog/2016/11/04/New-link-features-in-org-9/

J

On Tue, May 19, 2020 at 6:56 AM stardiviner <numbchild@gmail.com> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
>
> I'm write an extension to beautify org link with colors and unicode icons
> for
> better intuitive looks. But I don't know how to write those functions.
>
> I checked out this info page ([[info:org#Adding Hyperlink
> Types][info:org#Adding Hyperlink Types]]) of org mode.
>
> But have not found ~org-link-set-parameters~ other parameters code
> examples. I
> hope some examples can be added for the all other parameters.
>
> - --
> [ 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
>
> -----BEGIN PGP SIGNATURE-----
>
> iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7DuYkUHG51bWJjaGls
> ZEBnbWFpbC5jb20ACgkQG13xyVromsMMRAf/dkXg9kxbgTeCdjfcl2koeJkBmfNj
> xFGkuM0MlAc1oCIvGAeZ23GZ/B9cgtbfarGdZy1FJl9r7ehFx10Qg9w5keSIptA6
> mplEeCeKNgTwzyHIMQhI4xS+a80YliJNc8MgFi2o9tImKqavVV2eqwHPZDNE8HXt
> NEN+tfi8k2Sg7J7XhkdQD1YiNPTnKD8OXfzaR6162l5qSo3YuwoAegGmuULie2Ti
> fci2pFO56g46xLp1tWvI6z+Zxabyff/IjKkSWSNTHuQ5lhvYsmuFKF1JDfS/DHJV
> zy3Rr6sXK+MY1YWMMh2uLvmigL/BYl5HvjzC/Sq6wXcqVi0FuryeEfDWzg==
> =HMJr
> -----END PGP SIGNATURE-----
>
> --
John

-----------------------------------
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu

[-- Attachment #2: Type: text/html, Size: 2644 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to defint functions for other org link parameters like :face :display etc?
  2020-05-19 11:44 ` John Kitchin
@ 2020-05-19 13:20   ` stardiviner
  2020-05-19 13:36     ` John Kitchin
  2020-05-19 13:27   ` stardiviner
  1 sibling, 1 reply; 8+ messages in thread
From: stardiviner @ 2020-05-19 13:20 UTC (permalink / raw)
  To: John Kitchin; +Cc: Org Mode

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256


John Kitchin <jkitchin@andrew.cmu.edu> writes:

> My go to reference is
> https://kitchingroup.cheme.cmu.edu/blog/2016/11/04/New-link-features-in-org-9/

Really thanks, John. I have read your blog article. Found most of link
parameters examples. But still confused me, I'm wandering how to define a
function for link parameter ":display" to append an all-the-icons unicode icon
on link. I only found one ~:display 'full~ example in your article.

an you show an example using a function for ~:display~? Thanks in advanced.

>
> On Tue, May 19, 2020 at 6:56 AM stardiviner <numbchild@gmail.com> wrote:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA256
>>
>>
>> I'm write an extension to beautify org link with colors and unicode icons
>> for
>> better intuitive looks. But I don't know how to write those functions.
>>
>> I checked out this info page ([[info:org#Adding Hyperlink
>> Types][info:org#Adding Hyperlink Types]]) of org mode.
>>
>> But have not found ~org-link-set-parameters~ other parameters code
>> examples. I
>> hope some examples can be added for the all other parameters.
>>
>> - --
>> [ 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
>>
>> -----BEGIN PGP SIGNATURE-----
>>
>> iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7DuYkUHG51bWJjaGls
>> ZEBnbWFpbC5jb20ACgkQG13xyVromsMMRAf/dkXg9kxbgTeCdjfcl2koeJkBmfNj
>> xFGkuM0MlAc1oCIvGAeZ23GZ/B9cgtbfarGdZy1FJl9r7ehFx10Qg9w5keSIptA6
>> mplEeCeKNgTwzyHIMQhI4xS+a80YliJNc8MgFi2o9tImKqavVV2eqwHPZDNE8HXt
>> NEN+tfi8k2Sg7J7XhkdQD1YiNPTnKD8OXfzaR6162l5qSo3YuwoAegGmuULie2Ti
>> fci2pFO56g46xLp1tWvI6z+Zxabyff/IjKkSWSNTHuQ5lhvYsmuFKF1JDfS/DHJV
>> zy3Rr6sXK+MY1YWMMh2uLvmigL/BYl5HvjzC/Sq6wXcqVi0FuryeEfDWzg==
>> =HMJr
>> -----END PGP SIGNATURE-----
>>
>> --
> John
>
> -----------------------------------
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu


- -- 
[ 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
      
-----BEGIN PGP SIGNATURE-----

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7D3TMUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsPoCQf/TrUtyBtPUYGtNiJeXWk0oQNbwggf
6FHX3wsvBS3O9A2VpKuzWTdnKSFR7dVUF8NkBwHbvU+599LqT5XxGtF2iDX+jgiz
t0G2207sczHtiwsE/KLGAxXmEI4tGESLv+4Jui3kjp8JJJCusDcjzTIXQ6O9sb91
PmSbQhj4dbUz/3zk+utLb3YBMUPDnsr4H+eon+ko+EQOxTL48O4x7xvjj07XrnX3
DawQG0qs9SnenkMsK2HzQBRDqCf0DfrVPmajWYUQJ62j2ocah8oXij6WH5/rgCpA
xtt2sXJrQd2TFpCxcGWn5PsyEUMWjxAx1dia8pcMkBLvnb2SQkM6204jWQ==
=SVJD
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to defint functions for other org link parameters like :face :display etc?
  2020-05-19 11:44 ` John Kitchin
  2020-05-19 13:20   ` stardiviner
@ 2020-05-19 13:27   ` stardiviner
  1 sibling, 0 replies; 8+ messages in thread
From: stardiviner @ 2020-05-19 13:27 UTC (permalink / raw)
  To: John Kitchin; +Cc: Org Mode


[-- Attachment #1.1: Type: text/plain, Size: 2204 bytes --]


I attached an image as example that I want to archive for Org links.

John Kitchin <jkitchin@andrew.cmu.edu> writes:

> My go to reference is
> https://kitchingroup.cheme.cmu.edu/blog/2016/11/04/New-link-features-in-org-9/
>
> J
>
> On Tue, May 19, 2020 at 6:56 AM stardiviner <numbchild@gmail.com> wrote:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA256
>>
>>
>> I'm write an extension to beautify org link with colors and unicode icons
>> for
>> better intuitive looks. But I don't know how to write those functions.
>>
>> I checked out this info page ([[info:org#Adding Hyperlink
>> Types][info:org#Adding Hyperlink Types]]) of org mode.
>>
>> But have not found ~org-link-set-parameters~ other parameters code
>> examples. I
>> hope some examples can be added for the all other parameters.
>>
>> - --
>> [ 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
>>
>> -----BEGIN PGP SIGNATURE-----
>>
>> iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7DuYkUHG51bWJjaGls
>> ZEBnbWFpbC5jb20ACgkQG13xyVromsMMRAf/dkXg9kxbgTeCdjfcl2koeJkBmfNj
>> xFGkuM0MlAc1oCIvGAeZ23GZ/B9cgtbfarGdZy1FJl9r7ehFx10Qg9w5keSIptA6
>> mplEeCeKNgTwzyHIMQhI4xS+a80YliJNc8MgFi2o9tImKqavVV2eqwHPZDNE8HXt
>> NEN+tfi8k2Sg7J7XhkdQD1YiNPTnKD8OXfzaR6162l5qSo3YuwoAegGmuULie2Ti
>> fci2pFO56g46xLp1tWvI6z+Zxabyff/IjKkSWSNTHuQ5lhvYsmuFKF1JDfS/DHJV
>> zy3Rr6sXK+MY1YWMMh2uLvmigL/BYl5HvjzC/Sq6wXcqVi0FuryeEfDWzg==
>> =HMJr
>> -----END PGP SIGNATURE-----
>>
>> --
> John
>
> -----------------------------------
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu


-- 
[ 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
      

[-- Attachment #1.2: 66f94f0fddf30e43924af97ed243d678f682d075.png --]
[-- Type: image/png, Size: 112045 bytes --]

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 515 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to defint functions for other org link parameters like :face :display etc?
  2020-05-19 13:20   ` stardiviner
@ 2020-05-19 13:36     ` John Kitchin
  2020-05-19 22:53       ` stardiviner
  0 siblings, 1 reply; 8+ messages in thread
From: John Kitchin @ 2020-05-19 13:36 UTC (permalink / raw)
  To: stardiviner; +Cc: Org Mode

[-- Attachment #1: Type: text/plain, Size: 4118 bytes --]

I don't know if :display is for that, I think it is mostly related to
should a link with description only show the description, or should it be
full and show link and description.

You probably want the :activate option, where you could use something like
an overlay on the link. I don't have time to make an example for that right
now. the gist is you make an activate function, and you can add a
text-property or overlay  display on the link. You probably need to check
that the property isn't there already to avoid adding overlays on
every fontification.


https://kitchingroup.cheme.cmu.edu/blog/2016/11/04/New-link-features-in-org-9/#org069cbfa
John

-----------------------------------
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



On Tue, May 19, 2020 at 9:21 AM stardiviner <numbchild@gmail.com> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
>
> John Kitchin <jkitchin@andrew.cmu.edu> writes:
>
> > My go to reference is
> >
> https://kitchingroup.cheme.cmu.edu/blog/2016/11/04/New-link-features-in-org-9/
>
> Really thanks, John. I have read your blog article. Found most of link
> parameters examples. But still confused me, I'm wandering how to define a
> function for link parameter ":display" to append an all-the-icons unicode
> icon
> on link. I only found one ~:display 'full~ example in your article.
>
> an you show an example using a function for ~:display~? Thanks in advanced.
>
> >
> > On Tue, May 19, 2020 at 6:56 AM stardiviner <numbchild@gmail.com> wrote:
> >
> >> -----BEGIN PGP SIGNED MESSAGE-----
> >> Hash: SHA256
> >>
> >>
> >> I'm write an extension to beautify org link with colors and unicode
> icons
> >> for
> >> better intuitive looks. But I don't know how to write those functions.
> >>
> >> I checked out this info page ([[info:org#Adding Hyperlink
> >> Types][info:org#Adding Hyperlink Types]]) of org mode.
> >>
> >> But have not found ~org-link-set-parameters~ other parameters code
> >> examples. I
> >> hope some examples can be added for the all other parameters.
> >>
> >> - --
> >> [ 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
> >>
> >> -----BEGIN PGP SIGNATURE-----
> >>
> >> iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7DuYkUHG51bWJjaGls
> >> ZEBnbWFpbC5jb20ACgkQG13xyVromsMMRAf/dkXg9kxbgTeCdjfcl2koeJkBmfNj
> >> xFGkuM0MlAc1oCIvGAeZ23GZ/B9cgtbfarGdZy1FJl9r7ehFx10Qg9w5keSIptA6
> >> mplEeCeKNgTwzyHIMQhI4xS+a80YliJNc8MgFi2o9tImKqavVV2eqwHPZDNE8HXt
> >> NEN+tfi8k2Sg7J7XhkdQD1YiNPTnKD8OXfzaR6162l5qSo3YuwoAegGmuULie2Ti
> >> fci2pFO56g46xLp1tWvI6z+Zxabyff/IjKkSWSNTHuQ5lhvYsmuFKF1JDfS/DHJV
> >> zy3Rr6sXK+MY1YWMMh2uLvmigL/BYl5HvjzC/Sq6wXcqVi0FuryeEfDWzg==
> >> =HMJr
> >> -----END PGP SIGNATURE-----
> >>
> >> --
> > John
> >
> > -----------------------------------
> > Professor John Kitchin
> > Doherty Hall A207F
> > Department of Chemical Engineering
> > Carnegie Mellon University
> > Pittsburgh, PA 15213
> > 412-268-7803
> > @johnkitchin
> > http://kitchingroup.cheme.cmu.edu
>
>
> - --
> [ 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
>
> -----BEGIN PGP SIGNATURE-----
>
> iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7D3TMUHG51bWJjaGls
> ZEBnbWFpbC5jb20ACgkQG13xyVromsPoCQf/TrUtyBtPUYGtNiJeXWk0oQNbwggf
> 6FHX3wsvBS3O9A2VpKuzWTdnKSFR7dVUF8NkBwHbvU+599LqT5XxGtF2iDX+jgiz
> t0G2207sczHtiwsE/KLGAxXmEI4tGESLv+4Jui3kjp8JJJCusDcjzTIXQ6O9sb91
> PmSbQhj4dbUz/3zk+utLb3YBMUPDnsr4H+eon+ko+EQOxTL48O4x7xvjj07XrnX3
> DawQG0qs9SnenkMsK2HzQBRDqCf0DfrVPmajWYUQJ62j2ocah8oXij6WH5/rgCpA
> xtt2sXJrQd2TFpCxcGWn5PsyEUMWjxAx1dia8pcMkBLvnb2SQkM6204jWQ==
> =SVJD
> -----END PGP SIGNATURE-----
>
>

[-- Attachment #2: Type: text/html, Size: 5941 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to defint functions for other org link parameters like :face :display etc?
  2020-05-19 13:36     ` John Kitchin
@ 2020-05-19 22:53       ` stardiviner
  2020-05-21 13:44         ` John Kitchin
  0 siblings, 1 reply; 8+ messages in thread
From: stardiviner @ 2020-05-19 22:53 UTC (permalink / raw)
  To: John Kitchin; +Cc: Org Mode

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256


John Kitchin <jkitchin@andrew.cmu.edu> writes:

> I don't know if :display is for that, I think it is mostly related to
> should a link with description only show the description, or should it be
> full and show link and description.
>
> You probably want the :activate option, where you could use something like
> an overlay on the link. I don't have time to make an example for that right
> now. the gist is you make an activate function, and you can add a
> text-property or overlay  display on the link. You probably need to check
> that the property isn't there already to avoid adding overlays on
> every fontification.
>
>
> https://kitchingroup.cheme.cmu.edu/blog/2016/11/04/New-link-features-in-org-9/#org069cbfa
> John

I see, let me take a try on ~:active-func~ parameter. Thanks a lot, John.

Regards

>
> -----------------------------------
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>
>
>
> On Tue, May 19, 2020 at 9:21 AM stardiviner <numbchild@gmail.com> wrote:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA256
>>
>>
>> John Kitchin <jkitchin@andrew.cmu.edu> writes:
>>
>> > My go to reference is
>> >
>> https://kitchingroup.cheme.cmu.edu/blog/2016/11/04/New-link-features-in-org-9/
>>
>> Really thanks, John. I have read your blog article. Found most of link
>> parameters examples. But still confused me, I'm wandering how to define a
>> function for link parameter ":display" to append an all-the-icons unicode
>> icon
>> on link. I only found one ~:display 'full~ example in your article.
>>
>> an you show an example using a function for ~:display~? Thanks in advanced.
>>
>> >
>> > On Tue, May 19, 2020 at 6:56 AM stardiviner <numbchild@gmail.com> wrote:
>> >
>> >> -----BEGIN PGP SIGNED MESSAGE-----
>> >> Hash: SHA256
>> >>
>> >>
>> >> I'm write an extension to beautify org link with colors and unicode
>> icons
>> >> for
>> >> better intuitive looks. But I don't know how to write those functions.
>> >>
>> >> I checked out this info page ([[info:org#Adding Hyperlink
>> >> Types][info:org#Adding Hyperlink Types]]) of org mode.
>> >>
>> >> But have not found ~org-link-set-parameters~ other parameters code
>> >> examples. I
>> >> hope some examples can be added for the all other parameters.
>> >>
>> >> - --
>> >> [ 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
>> >>
>> >> -----BEGIN PGP SIGNATURE-----
>> >>
>> >> iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7DuYkUHG51bWJjaGls
>> >> ZEBnbWFpbC5jb20ACgkQG13xyVromsMMRAf/dkXg9kxbgTeCdjfcl2koeJkBmfNj
>> >> xFGkuM0MlAc1oCIvGAeZ23GZ/B9cgtbfarGdZy1FJl9r7ehFx10Qg9w5keSIptA6
>> >> mplEeCeKNgTwzyHIMQhI4xS+a80YliJNc8MgFi2o9tImKqavVV2eqwHPZDNE8HXt
>> >> NEN+tfi8k2Sg7J7XhkdQD1YiNPTnKD8OXfzaR6162l5qSo3YuwoAegGmuULie2Ti
>> >> fci2pFO56g46xLp1tWvI6z+Zxabyff/IjKkSWSNTHuQ5lhvYsmuFKF1JDfS/DHJV
>> >> zy3Rr6sXK+MY1YWMMh2uLvmigL/BYl5HvjzC/Sq6wXcqVi0FuryeEfDWzg==
>> >> =HMJr
>> >> -----END PGP SIGNATURE-----
>> >>
>> >> --
>> > John
>> >
>> > -----------------------------------
>> > Professor John Kitchin
>> > Doherty Hall A207F
>> > Department of Chemical Engineering
>> > Carnegie Mellon University
>> > Pittsburgh, PA 15213
>> > 412-268-7803
>> > @johnkitchin
>> > http://kitchingroup.cheme.cmu.edu
>>
>>
>> - --
>> [ 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
>>
>> -----BEGIN PGP SIGNATURE-----
>>
>> iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7D3TMUHG51bWJjaGls
>> ZEBnbWFpbC5jb20ACgkQG13xyVromsPoCQf/TrUtyBtPUYGtNiJeXWk0oQNbwggf
>> 6FHX3wsvBS3O9A2VpKuzWTdnKSFR7dVUF8NkBwHbvU+599LqT5XxGtF2iDX+jgiz
>> t0G2207sczHtiwsE/KLGAxXmEI4tGESLv+4Jui3kjp8JJJCusDcjzTIXQ6O9sb91
>> PmSbQhj4dbUz/3zk+utLb3YBMUPDnsr4H+eon+ko+EQOxTL48O4x7xvjj07XrnX3
>> DawQG0qs9SnenkMsK2HzQBRDqCf0DfrVPmajWYUQJ62j2ocah8oXij6WH5/rgCpA
>> xtt2sXJrQd2TFpCxcGWn5PsyEUMWjxAx1dia8pcMkBLvnb2SQkM6204jWQ==
>> =SVJD
>> -----END PGP SIGNATURE-----
>>
>>


- -- 
[ 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
      
-----BEGIN PGP SIGNATURE-----

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7EY3EUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsMlVQgAge5MxPWefabFQfvcM1fHNgSVf4B3
vsPJmXqaVHRGmhUq2ug8wakYDoDIpdXX0M6VzVxm29ImmYsKM/JgpgEgZGR81DLI
RMyra/MvKC414klP4UZNHEqjcbpKxh2OxpnmfuDXvkve6epnSBGoX70wlRQIC1NN
BY3c1Gt44usVY1VwHnAaK+htlPU8CWc0Nn/0peOuB5qSJkjc60Pu9HKTx5EsJ0uD
OF1IdfP7k+d8Eew58LNgOgoL1S9xqpsGhzurI05qCAgtqWFlYZP0VP9tGDkh7aIF
YziNcGNPg6Nq5Dac1gIeTEyC40iCNNPCLxzNjrXYyUcmSPLIrysdTyeQ1g==
=4JMm
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to defint functions for other org link parameters like :face :display etc?
  2020-05-19 22:53       ` stardiviner
@ 2020-05-21 13:44         ` John Kitchin
  2020-05-21 14:28           ` [SOLVED] " stardiviner
  0 siblings, 1 reply; 8+ messages in thread
From: John Kitchin @ 2020-05-21 13:44 UTC (permalink / raw)
  To: stardiviner; +Cc: Org Mode

[-- Attachment #1: Type: text/plain, Size: 6285 bytes --]

Here is a real minimal example:

#+BEGIN_SRC emacs-lisp
(defun a-func (start end path bracketp)
  (let ((d (concat "@" path)))
    (set-text-properties start end `(display ,d))))


(org-link-set-parameters "alink"
                         :activate-func 'a-func)
#+END_SRC

it has some problems, and you might need to add additional cursor-sensor
type functions to remove the properties for editing, for example. That will
be tricky to get just right.

John

-----------------------------------
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



On Tue, May 19, 2020 at 6:53 PM stardiviner <numbchild@gmail.com> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
>
> John Kitchin <jkitchin@andrew.cmu.edu> writes:
>
> > I don't know if :display is for that, I think it is mostly related to
> > should a link with description only show the description, or should it be
> > full and show link and description.
> >
> > You probably want the :activate option, where you could use something
> like
> > an overlay on the link. I don't have time to make an example for that
> right
> > now. the gist is you make an activate function, and you can add a
> > text-property or overlay  display on the link. You probably need to check
> > that the property isn't there already to avoid adding overlays on
> > every fontification.
> >
> >
> >
> https://kitchingroup.cheme.cmu.edu/blog/2016/11/04/New-link-features-in-org-9/#org069cbfa
> > John
>
> I see, let me take a try on ~:active-func~ parameter. Thanks a lot, John.
>
> Regards
>
> >
> > -----------------------------------
> > Professor John Kitchin
> > Doherty Hall A207F
> > Department of Chemical Engineering
> > Carnegie Mellon University
> > Pittsburgh, PA 15213
> > 412-268-7803
> > @johnkitchin
> > http://kitchingroup.cheme.cmu.edu
> >
> >
> >
> > On Tue, May 19, 2020 at 9:21 AM stardiviner <numbchild@gmail.com> wrote:
> >
> >> -----BEGIN PGP SIGNED MESSAGE-----
> >> Hash: SHA256
> >>
> >>
> >> John Kitchin <jkitchin@andrew.cmu.edu> writes:
> >>
> >> > My go to reference is
> >> >
> >>
> https://kitchingroup.cheme.cmu.edu/blog/2016/11/04/New-link-features-in-org-9/
> >>
> >> Really thanks, John. I have read your blog article. Found most of link
> >> parameters examples. But still confused me, I'm wandering how to define
> a
> >> function for link parameter ":display" to append an all-the-icons
> unicode
> >> icon
> >> on link. I only found one ~:display 'full~ example in your article.
> >>
> >> an you show an example using a function for ~:display~? Thanks in
> advanced.
> >>
> >> >
> >> > On Tue, May 19, 2020 at 6:56 AM stardiviner <numbchild@gmail.com>
> wrote:
> >> >
> >> >> -----BEGIN PGP SIGNED MESSAGE-----
> >> >> Hash: SHA256
> >> >>
> >> >>
> >> >> I'm write an extension to beautify org link with colors and unicode
> >> icons
> >> >> for
> >> >> better intuitive looks. But I don't know how to write those
> functions.
> >> >>
> >> >> I checked out this info page ([[info:org#Adding Hyperlink
> >> >> Types][info:org#Adding Hyperlink Types]]) of org mode.
> >> >>
> >> >> But have not found ~org-link-set-parameters~ other parameters code
> >> >> examples. I
> >> >> hope some examples can be added for the all other parameters.
> >> >>
> >> >> - --
> >> >> [ 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
> >> >>
> >> >> -----BEGIN PGP SIGNATURE-----
> >> >>
> >> >> iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7DuYkUHG51bWJjaGls
> >> >> ZEBnbWFpbC5jb20ACgkQG13xyVromsMMRAf/dkXg9kxbgTeCdjfcl2koeJkBmfNj
> >> >> xFGkuM0MlAc1oCIvGAeZ23GZ/B9cgtbfarGdZy1FJl9r7ehFx10Qg9w5keSIptA6
> >> >> mplEeCeKNgTwzyHIMQhI4xS+a80YliJNc8MgFi2o9tImKqavVV2eqwHPZDNE8HXt
> >> >> NEN+tfi8k2Sg7J7XhkdQD1YiNPTnKD8OXfzaR6162l5qSo3YuwoAegGmuULie2Ti
> >> >> fci2pFO56g46xLp1tWvI6z+Zxabyff/IjKkSWSNTHuQ5lhvYsmuFKF1JDfS/DHJV
> >> >> zy3Rr6sXK+MY1YWMMh2uLvmigL/BYl5HvjzC/Sq6wXcqVi0FuryeEfDWzg==
> >> >> =HMJr
> >> >> -----END PGP SIGNATURE-----
> >> >>
> >> >> --
> >> > John
> >> >
> >> > -----------------------------------
> >> > Professor John Kitchin
> >> > Doherty Hall A207F
> >> > Department of Chemical Engineering
> >> > Carnegie Mellon University
> >> > Pittsburgh, PA 15213
> >> > 412-268-7803
> >> > @johnkitchin
> >> > http://kitchingroup.cheme.cmu.edu
> >>
> >>
> >> - --
> >> [ 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
> >>
> >> -----BEGIN PGP SIGNATURE-----
> >>
> >> iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7D3TMUHG51bWJjaGls
> >> ZEBnbWFpbC5jb20ACgkQG13xyVromsPoCQf/TrUtyBtPUYGtNiJeXWk0oQNbwggf
> >> 6FHX3wsvBS3O9A2VpKuzWTdnKSFR7dVUF8NkBwHbvU+599LqT5XxGtF2iDX+jgiz
> >> t0G2207sczHtiwsE/KLGAxXmEI4tGESLv+4Jui3kjp8JJJCusDcjzTIXQ6O9sb91
> >> PmSbQhj4dbUz/3zk+utLb3YBMUPDnsr4H+eon+ko+EQOxTL48O4x7xvjj07XrnX3
> >> DawQG0qs9SnenkMsK2HzQBRDqCf0DfrVPmajWYUQJ62j2ocah8oXij6WH5/rgCpA
> >> xtt2sXJrQd2TFpCxcGWn5PsyEUMWjxAx1dia8pcMkBLvnb2SQkM6204jWQ==
> >> =SVJD
> >> -----END PGP SIGNATURE-----
> >>
> >>
>
>
> - --
> [ 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
>
> -----BEGIN PGP SIGNATURE-----
>
> iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7EY3EUHG51bWJjaGls
> ZEBnbWFpbC5jb20ACgkQG13xyVromsMlVQgAge5MxPWefabFQfvcM1fHNgSVf4B3
> vsPJmXqaVHRGmhUq2ug8wakYDoDIpdXX0M6VzVxm29ImmYsKM/JgpgEgZGR81DLI
> RMyra/MvKC414klP4UZNHEqjcbpKxh2OxpnmfuDXvkve6epnSBGoX70wlRQIC1NN
> BY3c1Gt44usVY1VwHnAaK+htlPU8CWc0Nn/0peOuB5qSJkjc60Pu9HKTx5EsJ0uD
> OF1IdfP7k+d8Eew58LNgOgoL1S9xqpsGhzurI05qCAgtqWFlYZP0VP9tGDkh7aIF
> YziNcGNPg6Nq5Dac1gIeTEyC40iCNNPCLxzNjrXYyUcmSPLIrysdTyeQ1g==
> =4JMm
> -----END PGP SIGNATURE-----
>
>

[-- Attachment #2: Type: text/html, Size: 9329 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [SOLVED] Re: How to defint functions for other org link parameters like :face :display etc?
  2020-05-21 13:44         ` John Kitchin
@ 2020-05-21 14:28           ` stardiviner
  0 siblings, 0 replies; 8+ messages in thread
From: stardiviner @ 2020-05-21 14:28 UTC (permalink / raw)
  To: John Kitchin; +Cc: Org Mode

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256


John Kitchin <jkitchin@andrew.cmu.edu> writes:

> Here is a real minimal example:
>
> #+BEGIN_SRC emacs-lisp
> (defun a-func (start end path bracketp)
>   (let ((d (concat "@" path)))
>     (set-text-properties start end `(display ,d))))
>
>
> (org-link-set-parameters "alink"
>                          :activate-func 'a-func)
> #+END_SRC
>
> it has some problems, and you might need to add additional cursor-sensor
> type functions to remove the properties for editing, for example. That will
> be tricky to get just right.

Yes, I added simile mechanism code. I already finished this extension. Thank you
because of mostly based on your help.

Here is the repo https://github.com/stardiviner/org-link-beautify

>
> John
>
> -----------------------------------
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>
>
>
> On Tue, May 19, 2020 at 6:53 PM stardiviner <numbchild@gmail.com> wrote:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA256
>>
>>
>> John Kitchin <jkitchin@andrew.cmu.edu> writes:
>>
>> > I don't know if :display is for that, I think it is mostly related to
>> > should a link with description only show the description, or should it be
>> > full and show link and description.
>> >
>> > You probably want the :activate option, where you could use something
>> like
>> > an overlay on the link. I don't have time to make an example for that
>> right
>> > now. the gist is you make an activate function, and you can add a
>> > text-property or overlay  display on the link. You probably need to check
>> > that the property isn't there already to avoid adding overlays on
>> > every fontification.
>> >
>> >
>> >
>> https://kitchingroup.cheme.cmu.edu/blog/2016/11/04/New-link-features-in-org-9/#org069cbfa
>> > John
>>
>> I see, let me take a try on ~:active-func~ parameter. Thanks a lot, John.
>>
>> Regards
>>
>> >
>> > -----------------------------------
>> > Professor John Kitchin
>> > Doherty Hall A207F
>> > Department of Chemical Engineering
>> > Carnegie Mellon University
>> > Pittsburgh, PA 15213
>> > 412-268-7803
>> > @johnkitchin
>> > http://kitchingroup.cheme.cmu.edu
>> >
>> >
>> >
>> > On Tue, May 19, 2020 at 9:21 AM stardiviner <numbchild@gmail.com> wrote:
>> >
>> >> -----BEGIN PGP SIGNED MESSAGE-----
>> >> Hash: SHA256
>> >>
>> >>
>> >> John Kitchin <jkitchin@andrew.cmu.edu> writes:
>> >>
>> >> > My go to reference is
>> >> >
>> >>
>> https://kitchingroup.cheme.cmu.edu/blog/2016/11/04/New-link-features-in-org-9/
>> >>
>> >> Really thanks, John. I have read your blog article. Found most of link
>> >> parameters examples. But still confused me, I'm wandering how to define
>> a
>> >> function for link parameter ":display" to append an all-the-icons
>> unicode
>> >> icon
>> >> on link. I only found one ~:display 'full~ example in your article.
>> >>
>> >> an you show an example using a function for ~:display~? Thanks in
>> advanced.
>> >>
>> >> >
>> >> > On Tue, May 19, 2020 at 6:56 AM stardiviner <numbchild@gmail.com>
>> wrote:
>> >> >
>> >> >> -----BEGIN PGP SIGNED MESSAGE-----
>> >> >> Hash: SHA256
>> >> >>
>> >> >>
>> >> >> I'm write an extension to beautify org link with colors and unicode
>> >> icons
>> >> >> for
>> >> >> better intuitive looks. But I don't know how to write those
>> functions.
>> >> >>
>> >> >> I checked out this info page ([[info:org#Adding Hyperlink
>> >> >> Types][info:org#Adding Hyperlink Types]]) of org mode.
>> >> >>
>> >> >> But have not found ~org-link-set-parameters~ other parameters code
>> >> >> examples. I
>> >> >> hope some examples can be added for the all other parameters.
>> >> >>
>> >> >> - --
>> >> >> [ 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
>> >> >>
>> >> >> -----BEGIN PGP SIGNATURE-----
>> >> >>
>> >> >> iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7DuYkUHG51bWJjaGls
>> >> >> ZEBnbWFpbC5jb20ACgkQG13xyVromsMMRAf/dkXg9kxbgTeCdjfcl2koeJkBmfNj
>> >> >> xFGkuM0MlAc1oCIvGAeZ23GZ/B9cgtbfarGdZy1FJl9r7ehFx10Qg9w5keSIptA6
>> >> >> mplEeCeKNgTwzyHIMQhI4xS+a80YliJNc8MgFi2o9tImKqavVV2eqwHPZDNE8HXt
>> >> >> NEN+tfi8k2Sg7J7XhkdQD1YiNPTnKD8OXfzaR6162l5qSo3YuwoAegGmuULie2Ti
>> >> >> fci2pFO56g46xLp1tWvI6z+Zxabyff/IjKkSWSNTHuQ5lhvYsmuFKF1JDfS/DHJV
>> >> >> zy3Rr6sXK+MY1YWMMh2uLvmigL/BYl5HvjzC/Sq6wXcqVi0FuryeEfDWzg==
>> >> >> =HMJr
>> >> >> -----END PGP SIGNATURE-----
>> >> >>
>> >> >> --
>> >> > John
>> >> >
>> >> > -----------------------------------
>> >> > Professor John Kitchin
>> >> > Doherty Hall A207F
>> >> > Department of Chemical Engineering
>> >> > Carnegie Mellon University
>> >> > Pittsburgh, PA 15213
>> >> > 412-268-7803
>> >> > @johnkitchin
>> >> > http://kitchingroup.cheme.cmu.edu
>> >>
>> >>
>> >> - --
>> >> [ 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
>> >>
>> >> -----BEGIN PGP SIGNATURE-----
>> >>
>> >> iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7D3TMUHG51bWJjaGls
>> >> ZEBnbWFpbC5jb20ACgkQG13xyVromsPoCQf/TrUtyBtPUYGtNiJeXWk0oQNbwggf
>> >> 6FHX3wsvBS3O9A2VpKuzWTdnKSFR7dVUF8NkBwHbvU+599LqT5XxGtF2iDX+jgiz
>> >> t0G2207sczHtiwsE/KLGAxXmEI4tGESLv+4Jui3kjp8JJJCusDcjzTIXQ6O9sb91
>> >> PmSbQhj4dbUz/3zk+utLb3YBMUPDnsr4H+eon+ko+EQOxTL48O4x7xvjj07XrnX3
>> >> DawQG0qs9SnenkMsK2HzQBRDqCf0DfrVPmajWYUQJ62j2ocah8oXij6WH5/rgCpA
>> >> xtt2sXJrQd2TFpCxcGWn5PsyEUMWjxAx1dia8pcMkBLvnb2SQkM6204jWQ==
>> >> =SVJD
>> >> -----END PGP SIGNATURE-----
>> >>
>> >>
>>
>>
>> - --
>> [ 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
>>
>> -----BEGIN PGP SIGNATURE-----
>>
>> iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7EY3EUHG51bWJjaGls
>> ZEBnbWFpbC5jb20ACgkQG13xyVromsMlVQgAge5MxPWefabFQfvcM1fHNgSVf4B3
>> vsPJmXqaVHRGmhUq2ug8wakYDoDIpdXX0M6VzVxm29ImmYsKM/JgpgEgZGR81DLI
>> RMyra/MvKC414klP4UZNHEqjcbpKxh2OxpnmfuDXvkve6epnSBGoX70wlRQIC1NN
>> BY3c1Gt44usVY1VwHnAaK+htlPU8CWc0Nn/0peOuB5qSJkjc60Pu9HKTx5EsJ0uD
>> OF1IdfP7k+d8Eew58LNgOgoL1S9xqpsGhzurI05qCAgtqWFlYZP0VP9tGDkh7aIF
>> YziNcGNPg6Nq5Dac1gIeTEyC40iCNNPCLxzNjrXYyUcmSPLIrysdTyeQ1g==
>> =4JMm
>> -----END PGP SIGNATURE-----
>>
>>


- -- 
[ 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
      
-----BEGIN PGP SIGNATURE-----

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7GkCYUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsNFHwf9HVRE1H7hHTibz6jtw+++CuVfYboe
Rf2A0Tdx8ifzfCPly9PxmC9O3fK29Smf9fC7QoNCcCJkKT9HhDH4tkUc2jJWJEBH
ZGc3eS7WY1FVDNqjAVp8C2PF8vsfLLbpl0Lk+l9RRh2aBHNFGVoL15bbTw3XZUY5
7TcmbWQKDKravrZuf05Qc6DQbeTYS6KtgrdVYM1rCh5IMxKJIU/qv1Ghnpk+yjq6
G8Z5pw3LHJyEo9GFzwNAUnrZF0BNfDnyT+95mpRIgW01miw0QWCkjgEEk8NCgmQd
OGx2udngdS/Fvbj9agOfyDu1eI64PrzTDcVWGd3qDFMZ7oqiiqfD7nCBuA==
=5gGZ
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-05-21 14:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-19 10:48 How to defint functions for other org link parameters like :face :display etc? stardiviner
2020-05-19 11:44 ` John Kitchin
2020-05-19 13:20   ` stardiviner
2020-05-19 13:36     ` John Kitchin
2020-05-19 22:53       ` stardiviner
2020-05-21 13:44         ` John Kitchin
2020-05-21 14:28           ` [SOLVED] " stardiviner
2020-05-19 13:27   ` stardiviner

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).