emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to display overlay or propertize text on file: link type about t


From: John Kitchin
Subject: Re: How to display overlay or propertize text on file: link type about the file?
Date: Sat, 22 Feb 2020 16:52:00 -0500
User-agent: mu4e 1.3.6; emacs 26.3

I think you are looking for the :activate-func property of a link. What
you want is somewhat tricky though, how would you edit the link?

There is an example at
https://kitchingroup.cheme.cmu.edu/blog/2016/11/04/New-link-features-in-org-9/#org069cbfa

that might give you some ideas. You can use a 'display text property to
change the appearance, but you need some way to remove this if you want
to edit or see the original version.

stardiviner <address@hidden> writes:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
>
> I have a requirement, I want to display file: link's file type info on the 
> link.
>
> For example, an Org file: link
>
> #+begin_src org
> [[file:~/Org/logo.png][logo]]
> [[file:~/Org/document.pdf][document]]
> [[file:~/Org/book.epub][book]]
> #+end_src
>
> I want to display link as:
>
> #+begin_src org
> logo (image: png)
> document (document: pdf)
> book (ebook: epub)
> #+end_src
>
> I'm inspired by this code snippet:
>
> #+begin_src emacs-lisp
> (org-link-set-parameters
>  "file+sys"
>  :complete 'org-file-complete-link
>  :face (lambda (path) (if (file-exists-p path) 'org-link 'org-warning)))
> #+end_src
>
> Is it possible to display those info between parentheses with an overlay or
> propertied text?
>
> If someone have any idea or how to implement this, please help me. Thanks in 
> advanced.
>
> - --
> [ stardiviner ]
>        I try to make every word tell the meaning what I want to express.
>
>        Blog: https://stardiviner.github.io/
>        IRC(freenode): stardiviner, Matrix: stardiviner
>        GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
>
> -----BEGIN PGP SIGNATURE-----
>
> iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl5OrLYUHG51bWJjaGls
> ZEBnbWFpbC5jb20ACgkQG13xyVromsPElQf/W71U1JQ9ZeFjCWCxICs0q87016Iq
> 8FQ5Fr3lSmRb6NRLqzqAAbY6b14roxtixxmllvArJgd7bz280xTZs3NGgYMm/HMf
> sZ+vtkpiHgJk31KXxAk/LT1OcgzYOrSv7g6c8Y3Gg8G5eSDmKGu+tMwqFzYtVmk2
> 6G0/wz9ezsdYAFLlNrX/FhcVaxCUSSdG08z0Ip/Op1I4iqh3Y86N7LalPVZWNa9H
> eZSFsf3Z8NqfVnCmTvmyJon4x1SGvJ8Iaf4QUiE7huNeizJK2+CSIhjSu8yDBGr4
> 2oMPrkAm1XkJDLMQh0FLjIrIJUoTLzLonEYtlmg3thvFEMqFuF8ziYaGdw==
> =sZhk
> -----END PGP SIGNATURE-----


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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]