当前位置:网站首页>How to write plug-ins quickly with elisp
How to write plug-ins quickly with elisp
2022-07-26 17:22:00 【Flying watermelon】
I've been giving cider Contribute a new feature[1], But before, it was just a patchwork configuration , It doesn't work ELisp I have carefully written a complete function , Still a little frustrated .
The main source of frustration is right ELisp Unfamiliar with relevant concepts in , such as xref In order to open symbol Documents of definition , Need to provide a xref-location object , By default, there are two implementations ,xref-buffer-location And xref-file-location.
file This is more intuitive , Pass in file/line/column that will do , But I buffer This one needs to be passed in position, But I didn't position How to construct , I guess position It's a (line . column) Of cons? Later, I tested it, but it didn't work , Then go and see buffer location The definition of ,position The type is fixnum, Since it's a number , It should mean offset, Then another question , yes 0 At first it was 1 To start? ?
The story is almost finished here , In the end, I I found the answer on Li Sha's website , Call directly (point) You can get the current position position.
We can see from the example here ,ELisp Although the documents are complete , But a very important link is missing , namely demo. Need to know Lisp An important tool to improve production efficiency is REPL, No, demo Let me copy , Why am I REPL Li test ?
And programmers are lazy 、 Very busy , Go and look carefully manual Not reality , and Emacs Of manual I feel a little “ heavy ” 了 , There are too many words , Tired of watching , All I need is a very copy An example of , Then change it according to my needs , Just go clojuredocs like that , such as reduce[2] page :
Fortunately Emacs China TG Group communication “ Experience ” after , Found out elisp-demos[3] plug-in unit , Can be in helpful The usage of the function is shown in the page :
Last , Recommend another tutorial , For others Lisp Experienced programmers use it quickly ELisp.
• https://github.com/chrisdone/elisp-guide
Reference link
[1] feature: https://github.com/clojure-emacs/cider/pull/3026[2] reduce: https://clojuredocs.org/clojure.core/reduce[3] elisp-demos: https://github.com/xuchunyang/elisp-demos
边栏推荐
- 2022 年有哪些流行的技术?
- 限流对比:Sentinel vs Hystrix 到底怎么选?
- Definition and relationship of derivative, differential, partial derivative, total derivative, directional derivative and gradient
- MySQL foundation - basic database operation
- Machine learning - what are machine learning, supervised learning, and unsupervised learning
- Are CRM and ERP the same thing? What's the difference?
- Win11 auto delete file setting method
- 【飞控开发基础教程3】疯壳·开源编队无人机-串口(基础收发)
- PXE高效批量网络装机
- Crazy God redis notes 02
猜你喜欢
![Sharing of 40 completed projects of high-quality information management specialty [source code + Thesis] (VI)](/img/b9/629449d3c946b017075ed42eaa81bf.png)
Sharing of 40 completed projects of high-quality information management specialty [source code + Thesis] (VI)

Small application of C language using structure to simulate election

Speaker recruitment | AI time recruit icml/ijcai 2022 as a Chinese speaker!!!

Pyqt5 rapid development and practice 3.4 signal and slot correlation

How does win11 reinstall the system?

Chapter 1 Overview - Section 1 - 1.3 composition of the Internet

2022软件测试技能 Postman+newman+jenkins 持续集成 实战教程

Anaconda download and Spyder error reporting solution

Marketing guide | several common micro blog marketing methods
![[ctfshow web] deserialization](/img/cd/b76e148adfc4d61049ab2cf429d4d7.png)
[ctfshow web] deserialization
随机推荐
The latest interface of Taobao / tmall keyword search
Response object - response character data
Heavy! Zeng Xuezhong was promoted to vice chairman and CEO of zhanrui, and Chu Qingren was appointed as co CEO!
Add 5g and AI, oppo announced to invest 10billion R & D funds next year!
Pytorch中的tensor操作
Pyqt5 rapid development and practice 3.4 signal and slot correlation
E-week finance | postal Huiwanjia bank opened; Wechat public call to stop four types of financial marketing publicity
Shrimp Shope get commodity details according to ID API return value description
Realizing DDD based on ABP -- related concepts of DDD
JD Sanmian: I want to query a table with tens of millions of data. How can I operate it?
Win11怎么自动清理回收站?
What is a test case? How to design?
环境搭建-MongoDB
Alibaba cloud Toolkit - project one click deployment tool
“青出于蓝胜于蓝”,为何藏宝计划(TPC)是持币生息最后的一朵白莲花
[express receives get, post, and route request parameters]
Stop using xshell and try this more modern terminal connection tool
After Australia, New Zealand announced the ban on Huawei 5g! Huawei official response
Marketing guide | several common micro blog marketing methods
Crazy God redis notes 02