diff options
| author | Sacha Chua <sacha@sachachua.com> | 2025-12-18 20:22:40 -0500 |
|---|---|---|
| committer | Sacha Chua <sacha@sachachua.com> | 2025-12-18 20:22:40 -0500 |
| commit | e9ff894e5be4c25d20a6c9df8b9b399280418293 (patch) | |
| tree | 2f2f56b6a8a753945bdbbed2064f570c7da99bd3 /2025/captions/emacsconf-2025-completion--corfuyasnippet-easier-than-i-thought--pedro-a-aranda-gutirrez--main.vtt | |
| parent | eec65463925fc48780f115e32e14f5cceebfeeee (diff) | |
| download | emacsconf-wiki-e9ff894e5be4c25d20a6c9df8b9b399280418293.tar.xz emacsconf-wiki-e9ff894e5be4c25d20a6c9df8b9b399280418293.zip | |
Diffstat (limited to '2025/captions/emacsconf-2025-completion--corfuyasnippet-easier-than-i-thought--pedro-a-aranda-gutirrez--main.vtt')
| -rw-r--r-- | 2025/captions/emacsconf-2025-completion--corfuyasnippet-easier-than-i-thought--pedro-a-aranda-gutirrez--main.vtt | 1426 |
1 files changed, 1426 insertions, 0 deletions
diff --git a/2025/captions/emacsconf-2025-completion--corfuyasnippet-easier-than-i-thought--pedro-a-aranda-gutirrez--main.vtt b/2025/captions/emacsconf-2025-completion--corfuyasnippet-easier-than-i-thought--pedro-a-aranda-gutirrez--main.vtt new file mode 100644 index 00000000..49bf10f3 --- /dev/null +++ b/2025/captions/emacsconf-2025-completion--corfuyasnippet-easier-than-i-thought--pedro-a-aranda-gutirrez--main.vtt @@ -0,0 +1,1426 @@ +WEBVTT + +00:00:00.000 --> 00:00:02.319 +Nice to have you here on this talk. + +00:00:02.320 --> 00:00:04.519 +This is my second talk this year. + +00:00:04.520 --> 00:00:09.919 +First one was on things that I've done to Org Mode. + +00:00:09.920 --> 00:00:13.799 +Just as a side note, this presentation + +00:00:13.800 --> 00:00:16.279 +that I'm going to share with you + +00:00:16.280 --> 00:00:19.879 +about my work on Corfu and Jasnipit. + +00:00:19.880 --> 00:00:21.839 +I've prepared that on Org Mode + +00:00:21.840 --> 00:00:25.079 +and exported that with a work I've been doing + +00:00:25.080 --> 00:00:26.839 +to the latest exporter. + +00:00:26.840 --> 00:00:31.959 +Anyhow, what is my talk going to be about? + +00:00:31.960 --> 00:00:34.599 +It's going to be about Corfu and Yasnippet, + +00:00:34.600 --> 00:00:36.599 +which I thought would be difficult to integrate, + +00:00:36.600 --> 00:00:42.799 +and it was much easier than I thought. + +00:00:42.800 --> 00:00:46.959 +So just a short outline, my motivation, + +00:00:46.960 --> 00:00:49.959 +step-by-step of the things that I've been investigating, + +00:00:49.960 --> 00:00:55.919 +and some takeaways. So my motivation, yeah, snippet is old. + +00:00:55.920 --> 00:00:59.599 +So I've tried another, I've tried Temple + +00:00:59.600 --> 00:01:02.519 +and other template management packages, + +00:01:02.520 --> 00:01:08.159 +but it was really not my cup of tea. So mainly why? + +00:01:08.160 --> 00:01:10.919 +Mainly because I have a nice base of VR snippets + +00:01:10.920 --> 00:01:14.479 +I have generated for my needs. + +00:01:14.480 --> 00:01:17.799 +So it's not that I've been importing snippets + +00:01:17.800 --> 00:01:20.359 +from packages which are out there. + +00:01:20.360 --> 00:01:23.599 +No, they are my snippets. I'm used to them. + +00:01:23.600 --> 00:01:26.559 +And of course, migration counts as a cost. + +00:01:26.560 --> 00:01:32.639 +I've been using Company as my completion point function GUI for years, + +00:01:32.640 --> 00:01:38.919 +but with the time coming in features and so on it + +00:01:38.920 --> 00:01:44.359 +was it's was not as easy to set up as I wanted for my needs + +00:01:44.360 --> 00:01:53.119 +so I had been working I've been playing with Eaglet already some time for a language server protocol + +00:01:53.120 --> 00:01:57.039 +I had read about how easy it was to integrate with Corfu + +00:01:57.040 --> 00:02:02.839 +which was really nice and I had given it a try, + +00:02:02.840 --> 00:02:06.439 +but I'm using both graphical user interface mode in Emacs + +00:02:06.440 --> 00:02:07.839 +and text mode, + +00:02:07.840 --> 00:02:10.319 +and for text mode you need a corporate terminal, + +00:02:10.320 --> 00:02:16.399 +which was yet another package that I don't download. + +00:02:16.400 --> 00:02:21.479 +Well, and I didn't really find a quick way + +00:02:21.480 --> 00:02:24.479 +to get rid of company to get just snippet. + +00:02:24.480 --> 00:02:26.679 +So at the end, when, at the beginning, + +00:02:26.680 --> 00:02:33.959 +when I was using Corfu and Eglot, I also needed to load a company + +00:02:33.960 --> 00:02:35.759 +to have a snippet support, + +00:02:35.760 --> 00:02:37.639 +which was really like sort of weird + +00:02:37.640 --> 00:02:40.559 +because I wanted to get rid of, of your snippet. + +00:02:40.560 --> 00:02:47.199 +Anyhow, while I try now, I'm following the mailing list, + +00:02:47.200 --> 00:02:48.559 +the development mailing list, + +00:02:48.560 --> 00:02:51.799 +and I got interested when I heard something about + +00:02:51.800 --> 00:02:57.119 +TTI charge frames being announced for master. + +00:02:57.120 --> 00:02:59.599 +That would mean less packages to download + +00:02:59.600 --> 00:03:04.159 +because I thought I could get rid of Corfu, + +00:03:04.160 --> 00:03:07.359 +and I wanted to try if I could get rid of Corfu terminal + +00:03:07.360 --> 00:03:11.199 +and run Corfu without that. + +00:03:11.200 --> 00:03:18.799 +So, there were some hints there in that mailing list + +00:03:18.800 --> 00:03:21.879 +that made it interesting for me. + +00:03:21.880 --> 00:03:26.639 +And at the end, I'm also like a why not trying man, + +00:03:26.640 --> 00:03:29.119 +so I said let's give it a try. + +00:03:29.120 --> 00:03:33.479 +My requirements, I'm working always on a new Emacs, + +00:03:33.480 --> 00:03:36.759 +a decently new Emacs, normally from Master Vanilla. + +00:03:36.760 --> 00:03:42.559 +completely Vanilla and I don't have any extras like Doom or things like that. + +00:03:42.560 --> 00:03:45.519 +So I'm only Vanilla. And one of the things + +00:03:45.520 --> 00:03:50.279 +that I don't want is that on this Vanilla recent Emacs, + +00:03:50.280 --> 00:03:55.719 +I don't want a Kung Fu Terminal. I need your snippet. + +00:03:55.720 --> 00:03:57.359 +I'm basically an old man. + +00:03:57.360 --> 00:04:02.479 +Old dog does new tricks and snippets must, + +00:04:02.480 --> 00:04:06.239 +in my way of working, must be easy and quick to configure + +00:04:06.240 --> 00:04:10.479 +and Tempo or others that I've seen are not. + +00:04:10.480 --> 00:04:13.919 +I don't want any reminiscence of a company in my setup. + +00:04:13.920 --> 00:04:18.679 +And of course, don't forget that I've embraced + +00:04:18.680 --> 00:04:24.119 +the language protocol implementations and basically Eglot. + +00:04:24.120 --> 00:04:28.159 +My main focus now is Python and LaTeX, + +00:04:28.160 --> 00:04:31.719 +and I have PyLSB and TechLab. + +00:04:31.720 --> 00:04:37.599 +And I don't want to have to stop using them. + +00:04:37.600 --> 00:04:40.479 +So basic setup for Corfu and Eglot. + +00:04:40.480 --> 00:04:43.439 +You can find it everywhere you look for it. + +00:04:43.440 --> 00:04:46.559 +It's really easy. + +00:04:46.560 --> 00:04:51.119 +And actually, I also do something somehow naughty, + +00:04:51.120 --> 00:04:53.079 +which is to set this variable, + +00:04:53.080 --> 00:04:55.519 +the Corfu auto variable to true, + +00:04:55.520 --> 00:04:58.399 +although I know it's not recommended, blah, blah, blah. + +00:04:58.400 --> 00:05:02.959 +But I use that because I'm a bit lazy in that. + +00:05:02.960 --> 00:05:07.239 +So next step was looking at completion at point functions. + +00:05:07.240 --> 00:05:10.479 +So the information there if you go through the scatter + +00:05:10.480 --> 00:05:13.999 +and sometimes a bit cryptic. + +00:05:14.000 --> 00:05:16.599 +At the end I came up with something like the thing + +00:05:16.600 --> 00:05:18.399 +that you see there on the screen. + +00:05:18.400 --> 00:05:21.879 +So it's a function for just completion point + +00:05:21.880 --> 00:05:24.639 +so I need my list of keywords + +00:05:24.640 --> 00:05:30.039 +so that I'm going to be talking later + +00:05:30.040 --> 00:05:34.399 +and I have my bounds which is normally a word + +00:05:34.400 --> 00:05:37.119 +and from that I get the start and the end + +00:05:37.120 --> 00:05:38.919 +of the of the thing that I want to + +00:05:38.920 --> 00:05:47.319 +that I want to be my seed for looking and bringing up Corfu + +00:05:47.320 --> 00:05:53.439 +and of course I need some completion properties here + +00:05:53.440 --> 00:05:55.719 +This looked like this is what you need to do, + +00:05:55.720 --> 00:05:57.519 +but I had to dig quite deep + +00:05:57.520 --> 00:06:01.319 +to create a JavaScript keyword test + +00:06:01.320 --> 00:06:04.759 +and to understand the completion props. + +00:06:04.760 --> 00:06:11.759 +And as an update of what I've been doing in the last weeks, + +00:06:11.760 --> 00:06:13.879 +I've created a bound of things + +00:06:13.880 --> 00:06:18.679 +that point for me with a different thing + +00:06:18.680 --> 00:06:22.039 +that doesn't skip over non-blank characters, + +00:06:22.040 --> 00:06:25.039 +that only skips over non-blank characters. + +00:06:25.040 --> 00:06:28.999 +Why? Because Word was confusingly tech, + +00:06:29.000 --> 00:06:30.759 +because the backslash, + +00:06:30.760 --> 00:06:34.999 +like in the example for the teletype text, + +00:06:35.000 --> 00:06:36.919 +was not taken into account by Word. + +00:06:36.920 --> 00:06:39.959 +So I had to create my own one, + +00:06:39.960 --> 00:06:42.119 +which was a bunch of thing at point, + +00:06:42.120 --> 00:06:44.879 +and then my thing is non-blanks. + +00:06:44.880 --> 00:06:53.239 +Completion at point properties, what are they? + +00:06:53.240 --> 00:06:56.039 +They allow Emacs to know how to handle the information + +00:06:56.040 --> 00:06:57.879 +for a specific completion time. + +00:06:57.880 --> 00:07:02.319 +So you normally will have an annotation, + +00:07:02.320 --> 00:07:08.519 +which then can disappear if you use NerdIconScoreFull. + +00:07:08.520 --> 00:07:11.839 +which is what I'm doing currently, + +00:07:11.840 --> 00:07:17.559 +but I keep it commented just in case I get tired of Corfu + +00:07:17.560 --> 00:07:20.079 +and I want to have my completion function. + +00:07:20.080 --> 00:07:26.759 +Then the company kind is actually not something + +00:07:26.760 --> 00:07:30.999 +that comes from the company package, but does not require. + +00:07:31.000 --> 00:07:39.439 +And that's going to allow NerdEye Conscorfu to identify + +00:07:39.440 --> 00:07:44.839 +and put the right icon there in the completion list, + +00:07:44.840 --> 00:07:47.159 +as you will see in a couple of minutes. + +00:07:47.160 --> 00:07:50.439 +So it's a snippet key. + +00:07:50.440 --> 00:07:52.599 +So basically what this is telling you + +00:07:52.600 --> 00:07:54.319 +is that this is a snippet keyword. + +00:07:54.320 --> 00:07:56.799 +These two lines, either line, + +00:07:56.800 --> 00:07:59.999 +tell you that this is a snippet keyword. + +00:08:00.000 --> 00:08:05.279 +And that it should be added to the other completions + +00:08:05.280 --> 00:08:08.079 +that you already have in your list. + +00:08:08.080 --> 00:08:15.479 +Problems looking now next step + +00:08:15.480 --> 00:08:19.079 +once I had the completion props + +00:08:19.080 --> 00:08:21.439 +which was relatively easy was to go + +00:08:21.440 --> 00:08:24.399 +and get the keyword list right. + +00:08:24.400 --> 00:08:27.199 +I've been looking at pre-existing solutions + +00:08:27.200 --> 00:08:29.319 +like for example how the menu + +00:08:29.320 --> 00:08:34.399 +is built in by your snippet and it looked a bit like Mission Impossible. + +00:08:34.400 --> 00:08:40.439 +because the approach by all the things + +00:08:40.440 --> 00:08:43.199 +that I have seen and I have examined + +00:08:43.200 --> 00:08:45.639 +is to get the keys and the names + +00:08:45.640 --> 00:08:50.799 +and then further process them. + +00:08:50.800 --> 00:08:55.279 +My take was, do I really need both? + +00:08:55.280 --> 00:08:58.159 +At the end, if I use my own snippets, + +00:08:58.160 --> 00:09:00.439 +I'm going to be using something + +00:09:00.440 --> 00:09:02.559 +I would call meaningful keys for them + +00:09:02.560 --> 00:09:06.359 +or at least meaningful for these keys are meaningful for me + +00:09:06.360 --> 00:09:07.679 +and I try not to repeat them + +00:09:07.680 --> 00:09:09.959 +because it makes little sense to repeat a keyword. + +00:09:09.960 --> 00:09:13.919 +So why not center everything around the keys only + +00:09:13.920 --> 00:09:18.879 +and can that help simplify my code? + +00:09:18.880 --> 00:09:23.639 +So I started to dive into your snippet + +00:09:23.640 --> 00:09:27.319 +and I found a lot of useful semi-hidden functions there. + +00:09:27.320 --> 00:09:30.679 +I discovered that getting the list + +00:09:30.680 --> 00:09:34.959 +the list of keys for a given mode was not that difficult. + +00:09:34.960 --> 00:09:40.079 +And at the end what I started doing + +00:09:40.080 --> 00:09:47.079 +is get all the snipple tables used by a major mode + +00:09:47.080 --> 00:09:52.399 +and get the lists of the keys that you have in each table. + +00:09:52.400 --> 00:09:55.839 +Sometimes the list is empty + +00:09:55.840 --> 00:10:01.959 +so it's going to return a nil and that you have to discard. + +00:10:01.960 --> 00:10:05.999 +When you're using structured snippets + +00:10:06.000 --> 00:10:08.919 +like snippets and submenus and so on + +00:10:08.920 --> 00:10:12.359 +to get a structured menu, + +00:10:12.360 --> 00:10:14.999 +you also get some non-strings that you need to filter out + +00:10:15.000 --> 00:10:18.999 +in order to get a workable keyword list. + +00:10:19.000 --> 00:10:24.879 +At the end of the day, what I had was something like this. + +00:10:24.880 --> 00:10:30.959 +I have, for a mode, I went through all modes. + +00:10:30.960 --> 00:10:37.159 +through all modes associated to that and then I went + +00:10:37.160 --> 00:10:42.519 +I got my results from all the tables that I had + +00:10:42.520 --> 00:10:45.279 +for a for a given time for a given table + +00:10:45.280 --> 00:10:48.079 +so what you do is you get your the tables + +00:10:48.080 --> 00:10:53.119 +that are associated to a mode because surprise surprise + +00:10:53.120 --> 00:10:55.958 +Some modes have more than one table, + +00:10:55.959 --> 00:11:00.917 +and then what you do is you filter out all non strings + +00:11:00.918 --> 00:11:07.719 +from each of the keys list that you have for each table. + +00:11:07.720 --> 00:11:12.679 +So as you see, it's a 1, 2, 3, 4, 5, 6, 7 liner, + +00:11:12.680 --> 00:11:14.319 +which was not too much. + +00:11:14.320 --> 00:11:20.039 +By the way, if someone from Yasnippet is around, + +00:11:20.040 --> 00:11:26.959 +I sent a pull request to include this + +00:11:26.960 --> 00:11:28.999 +as a public function in Yasnipit + +00:11:29.000 --> 00:11:32.319 +because it might be nice to have it in a packet + +00:11:32.320 --> 00:11:33.840 +in order to do this kind of things. + +00:11:33.840 --> 00:11:41.239 +So fine-tuning I just adding a yes completion + +00:11:41.240 --> 00:11:44.719 +to the completion point functions was not enough + +00:11:44.720 --> 00:11:46.799 +I don't really know + +00:11:46.800 --> 00:11:51.199 +but exclusive node didn't seem to work how I wanted + +00:11:51.200 --> 00:11:57.399 +so I needed to escape sorry yeah I was saying I was getting rid of packages + +00:11:57.400 --> 00:12:00.999 +and I had to add one package + +00:12:01.000 --> 00:12:04.479 +in order to get a function which is very very nice + +00:12:04.480 --> 00:12:08.919 +and which is part of the cape function of the cape package + +00:12:08.920 --> 00:12:12.799 +and that's cape cap super. + +00:12:12.800 --> 00:12:16.439 +So at the end using that you define an alias + +00:12:16.440 --> 00:12:23.199 +which for that where you use cape cap super + +00:12:23.200 --> 00:12:25.799 +to have a list of what you want + +00:12:25.800 --> 00:12:29.079 +so in this case for example for the demo + +00:12:29.080 --> 00:12:32.759 +I'm going to make I'm using yes completion + +00:12:32.760 --> 00:12:37.719 +and then the elisp completion point function provided by Emacs. + +00:12:37.720 --> 00:12:43.999 +I combine them using cape cap super + +00:12:44.000 --> 00:12:47.679 +and with that I create a completion point + +00:12:47.680 --> 00:12:53.159 +a new completion point function which I call cape list mode + +00:12:53.160 --> 00:12:58.480 +and then I add this alias to the completion functions list + +00:12:58.520 --> 00:13:05.719 +and with that it is enough snippet expansion + +00:13:05.720 --> 00:13:14.479 +if you want to have your snippets expanded automatically, + +00:13:14.480 --> 00:13:27.999 +you have to add an exit function to the, I'm sorry, + +00:13:28.000 --> 00:13:30.879 +to the completion properties + +00:13:30.880 --> 00:13:34.119 +yet another functionality you have to add + +00:13:34.120 --> 00:13:39.199 +and to avoid this automatic selection to be too eager + +00:13:39.200 --> 00:13:43.319 +you need to add this set corfu + +00:13:43.320 --> 00:13:48.599 +on exact match to nil because otherwise + +00:13:48.600 --> 00:13:51.839 +you will always get the snippet expanded + +00:13:51.840 --> 00:13:55.039 +even if you don't want it Basically why? + +00:13:55.040 --> 00:13:57.639 +Basically because this would be suboptimal + +00:13:57.640 --> 00:14:05.359 +because the key can appear as part of a variable name. + +00:14:05.360 --> 00:14:10.599 +Another nice thing, I'm also creating my own themes. + +00:14:10.600 --> 00:14:13.759 +I'm trying to have very sleek themes + +00:14:13.760 --> 00:14:16.839 +that only cover the modes that I use + +00:14:16.840 --> 00:14:22.959 +and for that I have my own theme creator fork + +00:14:22.960 --> 00:14:26.959 +from the original team creator. + +00:14:26.960 --> 00:14:31.719 +In my personal work that I'm running at home, + +00:14:31.720 --> 00:14:34.159 +I only have the faces for the modes I use. + +00:14:34.160 --> 00:14:38.159 +I don't want to overload the thing + +00:14:38.160 --> 00:14:41.839 +with too much different things. + +00:14:41.840 --> 00:14:45.999 +Looking at this, I really didn't need, as you will see now, + +00:14:46.000 --> 00:14:50.079 +I don't need to add anything to my themes + +00:14:50.080 --> 00:14:53.279 +because the default faces for Corfu + +00:14:53.280 --> 00:14:58.319 +adapt quite well to most of the themes. + +00:14:58.320 --> 00:15:02.839 +So if I go back to my checklist decently remax yes + +00:15:02.840 --> 00:15:06.559 +compiled the one you'll see + +00:15:06.560 --> 00:15:09.239 +for the for in the demo I'm doing is a master + +00:15:09.240 --> 00:15:11.999 +compiled the day before yesterday + +00:15:12.000 --> 00:15:15.199 +so and I don't need Corfu terminal there. + +00:15:15.200 --> 00:15:16.559 +I need your snippet, + +00:15:16.560 --> 00:15:20.159 +and you're going to see that in a second + +00:15:20.160 --> 00:15:24.439 +with a couple of snippets that I can expand here. + +00:15:24.440 --> 00:15:27.479 +I don't want any reminiscence of a company in my setup, + +00:15:27.480 --> 00:15:32.119 +and there's none. Well, actually, company kind is there + +00:15:32.120 --> 00:15:33.719 +you see the company there + +00:15:33.720 --> 00:15:39.559 +but it isn't if I buy companies strictly speaking + +00:15:39.560 --> 00:15:44.679 +and for I don't want I need Eglot integration + +00:15:44.680 --> 00:15:50.400 +which I will also be showing you. Takeaways from all this, + +00:15:50.440 --> 00:15:55.279 +if you accept the extra burden + +00:15:55.280 --> 00:16:02.239 +of Corfu terminal for Emacs 30 or earlier Emacs 30s, + +00:16:02.240 --> 00:16:07.559 +it's not too difficult to get this set up running. + +00:16:07.560 --> 00:16:11.759 +Corfu was easier to integrate and configure than Company, + +00:16:11.760 --> 00:16:13.799 +and it's much lighter in terms + +00:16:13.800 --> 00:16:20.039 +of number of lines, et cetera. I learned a lot. + +00:16:20.040 --> 00:16:25.159 +Well, actually, yes, with the help of Cape, + +00:16:25.160 --> 00:16:27.399 +but it is much lighter and much easier + +00:16:27.400 --> 00:16:30.119 +to integrate and configure. + +00:16:30.120 --> 00:16:34.879 +I've learned a lot about computational functions in the process, + +00:16:34.880 --> 00:16:40.439 +which is, something that is always nice to learn new things + +00:16:40.440 --> 00:16:45.039 +and the Nerd Icons Corfu makes the + +00:16:45.040 --> 00:16:48.319 +at least at this point in time I might get tired of it + +00:16:48.320 --> 00:16:50.399 +but at this point in time it makes + +00:16:50.400 --> 00:16:53.679 +a makes a very nice overall look + +00:16:53.680 --> 00:16:58.039 +and look and feel for for Emacs. + +00:16:58.040 --> 00:17:02.039 +requests to whom it may concern cape has nice features + +00:17:02.040 --> 00:17:06.279 +that maybe could make their way into emacs + +00:17:06.280 --> 00:17:09.159 +i'm thinking basically about this cape super fun + +00:17:09.160 --> 00:17:12.399 +uh super function super cape function functionality + +00:17:12.400 --> 00:17:18.799 +which is very nice and overcomes the problem of linking + +00:17:18.800 --> 00:17:22.239 +and this exclusive and all this kind of things + +00:17:22.240 --> 00:17:26.479 +that we have currently in Corfu + +00:17:26.480 --> 00:17:28.439 +with the computational point functions. + +00:17:28.440 --> 00:17:32.959 +Corfu is also really nice to have and it's not too big + +00:17:32.960 --> 00:17:35.559 +so is there any possibility + +00:17:35.560 --> 00:17:40.079 +that it makes its way into Emacs? + +00:17:40.080 --> 00:17:42.399 +Please keep Yarn Snippet alive. + +00:17:42.400 --> 00:17:48.559 +I'm not saying here that my pull request should be there, + +00:17:48.560 --> 00:17:51.559 +but it would be nice if someone took a look + +00:17:51.560 --> 00:17:57.399 +and made it part of Yarn Snippet. + +00:17:57.400 --> 00:18:01.799 +And PS, currently on master, + +00:18:01.800 --> 00:18:07.799 +there's a lot of semantic highlighting going on, + +00:18:07.800 --> 00:18:13.719 +which is very, very nice. No criticism on that. + +00:18:13.720 --> 00:18:19.639 +but you may need to add to your snippet hook + +00:18:19.640 --> 00:18:25.039 +this simple local value for ElixirFontify semantically + +00:18:25.040 --> 00:18:30.719 +because at least in my case I felt that + +00:18:30.720 --> 00:18:32.439 +the face were a bit too pushy + +00:18:32.440 --> 00:18:37.280 +so I had to make a snippet mode + +00:18:37.334 --> 00:18:41.279 +use the old Emacs Lisp fontification. + +00:18:41.280 --> 00:18:46.279 +That's what we want to talk about. + +00:18:46.280 --> 00:18:54.999 +Any initial reactions to this? There's a question here. + +00:18:55.000 --> 00:18:59.159 +Someone asked, did you try Jasnepet Cup? + +00:18:59.160 --> 00:19:05.959 +If so, what did you miss from this approach? I tried that. + +00:19:05.960 --> 00:19:11.239 +And it's not that I missed anything. + +00:19:11.240 --> 00:19:16.519 +It was more or less that I wanted to do it myself. + +00:19:16.520 --> 00:19:24.159 +So I wanted to see what was behind it. That's my answer. + +00:19:24.160 --> 00:19:26.679 +There are lots of packages there, + +00:19:26.680 --> 00:19:31.719 +but I try to keep learning. So, this was a nice objective + +00:19:31.720 --> 00:19:40.159 +to learn a bit more about Emacs. And now, just a second. + +00:19:40.160 --> 00:19:44.879 +Now, a small demo. This is the interaction. + +00:19:44.880 --> 00:19:47.199 +And as you see, I have the snippet there. + +00:19:47.200 --> 00:19:52.879 +and I have a couple of snippets. + +00:19:52.880 --> 00:19:55.839 +So, for example, if I would like to say + +00:19:55.840 --> 00:19:58.879 +I want to define a function, I can go like this. + +00:19:58.880 --> 00:20:00.519 +And what you see here is that + +00:20:00.520 --> 00:20:04.319 +I have two snippets appearing and then some variables. + +00:20:04.320 --> 00:20:09.879 +So, I could go for def one or if I want a key map, for def key map, + +00:20:09.880 --> 00:20:11.479 +which would be something like this. + +00:20:11.480 --> 00:20:18.319 +And then when I press enter, I get directly into the map + +00:20:18.320 --> 00:20:26.719 +and I could say like, Show off mob. + +00:20:26.720 --> 00:20:30.079 +Then it sets out directly a prefix T, + +00:20:30.080 --> 00:20:35.039 +which is something that I asked for in Emacs master. + +00:20:35.040 --> 00:20:39.479 +So with prefix T, for those who prefix it true, + +00:20:39.480 --> 00:20:41.399 +for those who don't know it, + +00:20:41.400 --> 00:20:46.799 +it makes integrating this into keymaps in use package much easier. + +00:20:46.800 --> 00:20:51.119 +So the next thing would be + +00:20:51.120 --> 00:20:55.999 +I would like to write a description + +00:20:56.000 --> 00:21:04.999 +like for example a cool show off team up + +00:21:05.000 --> 00:21:08.599 +and then my keys are my functions and that would be it + +00:21:08.600 --> 00:21:15.839 +but you also have like but also have like this define function + +00:21:15.840 --> 00:21:21.679 +and of course you can say that's nice but there's no + +00:21:21.680 --> 00:21:23.799 +but you're not showing the integration + +00:21:23.800 --> 00:21:25.439 +with Eglot and you're right. + +00:21:25.440 --> 00:21:30.279 +So I'm going just to open up a small program + +00:21:30.280 --> 00:21:33.319 +that I'm currently developing in Python. + +00:21:33.320 --> 00:21:38.239 +X is a tool to do things in MP3. + +00:21:38.240 --> 00:21:42.279 +And here I would have like all these things. + +00:21:42.280 --> 00:21:45.359 +As you see here in the bottom, + +00:21:45.360 --> 00:21:49.079 +service running, pilot is local, eglot is active. + +00:21:49.080 --> 00:21:57.919 +So I have my eglot stop and then I go down. + +00:21:57.920 --> 00:22:00.519 +And I want to add a new argument here. + +00:22:00.520 --> 00:22:08.799 +I would go like for it. I would go like add flag. + +00:22:08.800 --> 00:22:13.759 +For example, I would add a flag + +00:22:13.760 --> 00:22:21.759 +and I would get a new flag to add here. + +00:22:21.760 --> 00:22:33.119 +Oops. Of course, this is integrated into Eagle Lord. + +00:22:33.120 --> 00:22:42.759 +So I'm getting your information about what I have. + +00:22:42.760 --> 00:22:52.359 +I don't have OS, so I would need to import here, + +00:22:52.360 --> 00:22:59.279 +but I can go up just to see + +00:22:59.280 --> 00:23:01.759 +if I would like to, for example, + +00:23:01.760 --> 00:23:11.879 +create a new a regular expression + +00:23:11.880 --> 00:23:15.439 +I'm getting this information that you see right now on call + +00:23:15.440 --> 00:23:17.359 +for I'm getting that from Eglot + +00:23:17.360 --> 00:23:18.919 +so you see there's the integration + +00:23:18.920 --> 00:23:20.839 +with with Eglot too in Python + +00:23:20.840 --> 00:23:23.559 +I have Eglot and as you've seen + +00:23:23.560 --> 00:23:30.239 +I also have the and all these are snippets fine + +00:23:30.240 --> 00:23:38.199 +more reactions and questions + +00:23:38.200 --> 00:23:54.239 +Because that would be my show off here. + +00:23:54.240 --> 00:23:56.759 +Any questions? Any more questions on the pad? + +00:23:56.760 --> 00:24:11.479 +but anyhow i'm going to try + +00:24:11.480 --> 00:24:13.239 +i'm going to try your snippet too + +00:24:13.240 --> 00:24:16.279 +and i'm going to be answering this question more + +00:24:16.280 --> 00:24:21.079 +yeah time is good okay fine + +00:24:21.080 --> 00:24:30.039 +so I would be done if there's no more reactions + +00:24:30.040 --> 00:24:33.239 +thank you so much You're welcome. + +00:24:33.240 --> 00:24:34.919 +If you have any other questions, folks, + +00:24:34.920 --> 00:24:37.079 +you can always follow up on the pad. + +00:24:37.080 --> 00:24:39.639 +That was a great demonstration, and I'm sure lots of people + +00:24:39.640 --> 00:24:43.519 +are looking forward to trying it out. + +00:24:43.520 --> 00:24:45.239 +Oh, I see some questions coming in now. + +00:24:45.240 --> 00:24:46.199 +You may go ahead if you like. + +00:24:46.200 --> 00:24:51.879 +okay fine uh what uh there's someone asking + +00:24:51.880 --> 00:24:57.079 +what do special characters in your snippets work well too + +00:24:57.080 --> 00:25:02.479 +what kind of i don't use special characters in the key name + +00:25:02.480 --> 00:25:05.199 +so in this case everything works quite nicely + +00:25:05.200 --> 00:25:11.359 +and then i'm passing i'm passing the control to your snippets + +00:25:11.360 --> 00:25:13.679 +so if there's any problem in your snippets + +00:25:13.680 --> 00:25:15.359 +with uh special characters + +00:25:15.360 --> 00:25:24.399 +that i don't know I don't use that as a key. + +00:25:24.400 --> 00:25:30.519 +I'm just using for key names. + +00:25:30.520 --> 00:25:38.399 +I normally use a, I only use letters, but that should work. + +00:25:38.400 --> 00:25:43.959 +I mean, let's, uh, let's give it a trial. + +00:25:43.960 --> 00:25:58.039 +Let's kill here. Yes. I don't want, I don't want to touch this. + +00:25:58.040 --> 00:26:01.039 +Ugh. let's go into this one uh + +00:26:01.040 --> 00:26:06.920 +let's say I'm going to define this for example like this + +00:26:06.959 --> 00:26:10.919 +and I'm going to create a new snippet + +00:26:10.920 --> 00:26:15.359 +I'm going to create a new snippet + +00:26:15.360 --> 00:26:18.119 +and use this is for example when you look at this + +00:26:18.120 --> 00:26:20.599 +if you if you have the the venue uh the new + +00:26:20.600 --> 00:26:26.159 +sorry the new way of the the new emacs uh + +00:26:26.160 --> 00:26:31.639 +semantical highlighting working + +00:26:31.640 --> 00:26:39.199 +this would be quite cramped this is why i'm using + +00:26:39.200 --> 00:26:43.039 +this is why i said uh the snippet the + +00:26:43.040 --> 00:26:49.039 +so is this more or less what you're talking about + +00:26:49.040 --> 00:27:01.479 +This is what you're talking about. Snippet. Save the snippet. + +00:27:01.480 --> 00:27:15.479 +So I'm going to... Snippet, load and put window. + +00:27:15.480 --> 00:27:21.279 +Enable interaction mode. Yes, I'm going to save. + +00:27:21.280 --> 00:27:24.439 +And I'm going to save that as FD test. on the file. + +00:27:24.440 --> 00:27:41.479 +No, I'm going to save this. Load. Load input window. + +00:27:41.480 --> 00:27:53.679 +I'm going to put this in Emacs Lisp mode. I want to save it. No. + +00:27:53.680 --> 00:28:27.359 +I'm going to write that directly into Emacs Lisp mode. + +00:28:27.360 --> 00:28:30.639 +going to go back into scratch buffer + +00:28:30.640 --> 00:28:43.079 +and here I have it and we have it here but anyhow + +00:28:43.080 --> 00:28:52.079 +and I'm just going to try to see if I feel like empty of course + +00:28:52.080 --> 00:28:58.839 +there's only one it will not show in Corfu, + +00:28:58.840 --> 00:29:01.519 +but I mean, I don't have any problems + +00:29:01.520 --> 00:29:20.999 +with that, as you see. Was that what you were meaning? + +00:29:21.000 --> 00:29:24.839 +Yeah, I guess that works. Fine. + +00:29:24.840 --> 00:29:29.039 +All right, shall we wrap up here + +00:29:29.040 --> 00:29:31.279 +so that you can have supper + +00:29:31.280 --> 00:29:40.919 +and have lunch and other things? Okay, fine for me. + +00:29:40.920 --> 00:29:46.319 +I was hoping to see the drop down. Just a second. + +00:29:46.320 --> 00:29:49.959 +I think we can do that too. Two seconds. + +00:29:49.960 --> 00:29:52.559 +How can we do that with a drop down? + +00:29:52.560 --> 00:29:57.719 +Yeah, if I say something like this. + +00:29:57.720 --> 00:30:04.919 +And then I go and save it. + +00:30:04.920 --> 00:30:08.799 +And I'm going to go and write this + +00:30:08.800 --> 00:30:16.719 +into, with a second, fine. + +00:30:16.720 --> 00:30:19.919 +And now I need to quit here, sorry. + +00:30:19.920 --> 00:30:26.639 +And I'm going to come back in a second with another remark. + +00:30:26.640 --> 00:30:31.559 +Well, I'm bringing back and now let's see. + +00:30:31.560 --> 00:30:34.839 +Let's see what we have in your snippets. + +00:30:34.840 --> 00:30:44.159 +It's not there. Why not? Just a second. Let's see if I go. + +00:30:44.160 --> 00:30:47.839 +I don't know if it matters that the name was + +00:30:47.840 --> 00:30:52.599 +that didn't have the characters in the beginning. + +00:30:52.600 --> 00:31:03.159 +Just a second. I think I know what is happening here. + +00:31:03.160 --> 00:31:21.439 +Do I have here? I have them. I'm going to clean. + +00:31:21.440 --> 00:31:28.879 +Oh, you're back in your home directories. Why? + +00:31:28.880 --> 00:31:35.879 +CD dash to get back in. Yeah. That's right. + +00:31:35.880 --> 00:31:37.799 +So you see how the name also has + +00:31:37.800 --> 00:31:39.319 +it doesn't have the same as the keys. + +00:31:39.320 --> 00:31:41.039 +I don't know if that affects what shows up. + +00:31:41.040 --> 00:31:49.399 +Yeah, we we can try that. That's a quick one. This is my. + +00:31:49.400 --> 00:31:51.279 +Fine, now that I have this, + +00:31:51.280 --> 00:31:55.359 +which is going to be quicker, we check again. + +00:31:55.360 --> 00:31:57.919 +They both seem to be the same now + +00:31:57.920 --> 00:32:03.079 +and I don't know if that affects, but anyhow, let's try it. + +00:32:03.080 --> 00:32:07.679 +I go and then I look at the AR snippets, if it's there. + +00:32:07.680 --> 00:32:11.879 +Yes, it is. Yeah, it's there. + +00:32:11.880 --> 00:32:18.559 +And then if I say there, there you are. Oh, look at that. + +00:32:18.560 --> 00:32:24.159 +It doesn't seem to be affecting. Fantastic. + +00:32:24.160 --> 00:32:32.119 +And by the way, it is there. + +00:32:32.120 --> 00:32:33.999 +Yeah, I really should spend time + +00:32:34.000 --> 00:32:36.599 +getting more templates set up with Snippet. + +00:32:36.600 --> 00:32:37.639 +I really love the fact that + +00:32:37.640 --> 00:32:40.399 +you can evaluate Emacs Lisp in it too. + +00:32:40.400 --> 00:32:43.399 +Yeah, I mean, just to make it bigger, + +00:32:43.400 --> 00:32:51.359 +try that because if I go into my, for example, + +00:32:51.360 --> 00:32:55.679 +into my org mode stuff + +00:32:55.680 --> 00:32:59.439 +and in my org mode, I go to the article, + +00:32:59.440 --> 00:33:03.319 +which is one of the big ones. + +00:33:03.320 --> 00:33:06.199 +I have things like, for example, + +00:33:06.200 --> 00:33:10.719 +I defined a couple of functions here to do if it's empty, + +00:33:10.720 --> 00:33:16.399 +if that is empty, just add a white space. + +00:33:16.400 --> 00:33:19.599 +If one is empty, add a white space. + +00:33:19.600 --> 00:33:23.319 +add a white space here so it becomes a comment. + +00:33:23.320 --> 00:33:27.279 +I have functions for to do more things on that + +00:33:27.280 --> 00:33:29.799 +and I also have like menus to see + +00:33:29.800 --> 00:33:33.599 +what language I want to choose for + +00:33:33.600 --> 00:33:37.079 +for my spell checking and so on so + +00:33:37.080 --> 00:33:40.319 +and that's all that's as you see + +00:33:40.320 --> 00:33:41.959 +this is a Lisp being evaluated + +00:33:41.960 --> 00:33:45.119 +so yes do I really encourage you + +00:33:45.120 --> 00:33:46.519 +I've also heard people use it, + +00:33:46.520 --> 00:33:47.799 +like, especially if they're working + +00:33:47.800 --> 00:33:49.919 +in different programming languages, + +00:33:49.920 --> 00:33:52.399 +so they can just have the syntax + +00:33:52.400 --> 00:33:54.359 +for the different languages + +00:33:54.360 --> 00:33:58.239 +be condensed into a consistent abbreviation. Yeah. + +00:33:58.240 --> 00:34:01.319 +And look, this is my article. I have another. + +00:34:01.320 --> 00:34:07.799 +This is when I'm writing articles. I have another one. + +00:34:07.800 --> 00:34:10.279 +I have another one for writing letters + +00:34:10.280 --> 00:34:14.399 +in org mode and so on. So, it's like letter, block, + +00:34:14.400 --> 00:34:16.559 +and you have the complete infrastructure + +00:34:16.560 --> 00:34:20.159 +and you don't have to type it by hand. + +00:34:20.160 --> 00:34:22.879 +So, it's really, really nice. + +00:34:22.880 --> 00:34:25.959 +Hmm, I think it might be nice to have + +00:34:25.960 --> 00:34:28.079 +a future Emacs carnival, you know, + +00:34:28.080 --> 00:34:31.239 +shared blogging theme thing be around + +00:34:31.240 --> 00:34:33.359 +having people share their snippets. + +00:34:33.360 --> 00:34:39.359 +No snippets and other things like for example, + +00:34:39.360 --> 00:34:41.319 +this is something stupid. + +00:34:41.320 --> 00:34:44.519 +I'm switching my themes. All right. + +00:34:44.520 --> 00:34:48.639 +And of course, there you see, + +00:34:48.640 --> 00:34:51.439 +I have also, this is also with, + +00:34:51.440 --> 00:34:54.519 +this is my way of switching buffers, + +00:34:54.520 --> 00:34:58.159 +which is with the shift control and tab, + +00:34:58.160 --> 00:35:00.559 +I can switch different families + +00:35:00.560 --> 00:35:02.519 +and then when I'm in a family, + +00:35:02.520 --> 00:35:06.999 +I can go and switch with control tab between the different, + +00:35:07.000 --> 00:35:15.599 +I'm using tab line by the way. I'm not using the other one. + +00:35:15.600 --> 00:35:20.839 +I'm using the old plain tab line with my themes. + +00:35:20.840 --> 00:35:23.519 +So that's more or less everything. + +00:35:23.520 --> 00:35:26.519 +Thank you for the peek into your workflow. + +00:35:26.520 --> 00:35:30.759 +I will work on getting the recordings for the live talks + +00:35:30.760 --> 00:35:33.919 +sorted out at some point very soon. + +00:35:33.920 --> 00:35:37.839 +I might even be able to get them out next week. + +00:35:37.840 --> 00:35:44.920 +So thanks again. All right. Have a nice supper. Same to you. |
