From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 0CMHBUqQxl7CHgAA0tVLHw (envelope-from ) for ; Thu, 21 May 2020 14:29:30 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id +K35AEqQxl47KgAAB5/wlQ (envelope-from ) for ; Thu, 21 May 2020 14:29:30 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 0A2A79404D1 for ; Thu, 21 May 2020 14:29:28 +0000 (UTC) Received: from localhost ([::1]:39906 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbmCM-0007pL-Uh for larch@yhetil.org; Thu, 21 May 2020 10:29:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34020) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jbmC2-0007nw-2T for emacs-orgmode@gnu.org; Thu, 21 May 2020 10:29:06 -0400 Received: from [183.249.132.153] (port=1904 helo=dark.localdomain) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbmC0-0007Li-QE for emacs-orgmode@gnu.org; Thu, 21 May 2020 10:29:05 -0400 Received: by dark.localdomain (Postfix, from userid 1000) id A43AD241752; Thu, 21 May 2020 22:28:54 +0800 (HKT) References: <87zha4jj3q.fsf@gmail.com> <87tv0cjc24.fsf@gmail.com> <87imgrcz9r.fsf@gmail.com> User-agent: mu4e 1.4; emacs 28.0.50 From: stardiviner To: John Kitchin Subject: [SOLVED] Re: How to defint functions for other org link parameters like :face :display etc? In-reply-to: Date: Thu, 21 May 2020 22:28:54 +0800 Message-ID: <878shlgy55.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 183.249.132.153 (deferred) Received-SPF: softfail client-ip=183.249.132.153; envelope-from=numbchild@gmail.com; helo=dark.localdomain X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/21 08:17:46 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: 15 X-Spam_score: 1.5 X-Spam_bar: + X-Spam_report: (1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FROM=0.001, NML_ADSP_CUSTOM_MED=0.9, RDNS_NONE=0.793, SPF_SOFTFAIL=0.665, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: numbchild@gmail.com Cc: Org Mode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: 2.59 X-TUID: ImYkHq2SfT7V =2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 John Kitchin 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 wi= ll > be tricky to get just right. Yes, I added simile mechanism code. I already finished this extension. Than= k 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 wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA256 >> >> >> John Kitchin 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 ch= eck >> > 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 wrot= e: >> > >> >> -----BEGIN PGP SIGNED MESSAGE----- >> >> Hash: SHA256 >> >> >> >> >> >> John Kitchin 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 defi= ne >> 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 >> 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=3D=3D >> >> >> =3DHMJr >> >> >> -----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 expre= ss. >> >> >> >> 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=3D=3D >> >> =3DSVJD >> >> -----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=3D=3D >> =3D4JMm >> -----END PGP SIGNATURE----- >> >> =2D --=20 [ 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 =20=20=20=20=20=20 =2D----BEGIN PGP SIGNATURE----- iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7GkCYUHG51bWJjaGls ZEBnbWFpbC5jb20ACgkQG13xyVromsNFHwf9HVRE1H7hHTibz6jtw+++CuVfYboe Rf2A0Tdx8ifzfCPly9PxmC9O3fK29Smf9fC7QoNCcCJkKT9HhDH4tkUc2jJWJEBH ZGc3eS7WY1FVDNqjAVp8C2PF8vsfLLbpl0Lk+l9RRh2aBHNFGVoL15bbTw3XZUY5 7TcmbWQKDKravrZuf05Qc6DQbeTYS6KtgrdVYM1rCh5IMxKJIU/qv1Ghnpk+yjq6 G8Z5pw3LHJyEo9GFzwNAUnrZF0BNfDnyT+95mpRIgW01miw0QWCkjgEEk8NCgmQd OGx2udngdS/Fvbj9agOfyDu1eI64PrzTDcVWGd3qDFMZ7oqiiqfD7nCBuA=3D=3D =3D5gGZ =2D----END PGP SIGNATURE-----