00:06 welcome 00:07 to another episode of xl talk show 00:10 today is 2021 april 00:14 19th and today we are going to continue 00:18 uh uh the saga of exploring 00:22 emacs this helm source code 00:25 and i do source code so if you are 00:29 watching me live you can see in the 00:31 youtube description 00:32 uh that is what we are going to do today 00:35 uh and uh yeah and 00:38 if you have comments questions uh type 00:41 in the comment box okay 00:43 and today so we are going to do uh emac 00:45 this nothing else today we are just 00:47 going to focus on that topic 00:49 and uh so i'm going to do it quickly 00:52 good morning 00:53 uh nawaf uh so 00:56 we are going to first of all i'm going 00:59 to write a 01:00 uh emac list command that 01:04 will pop up a prompt asking you to type 01:07 some words 01:08 to choose among a thousand uh academic 01:11 phrases 01:12 so basically using first imagine 01:15 uh and i'm going to use uh the i do mod 01:18 you know i do 01:19 first first imagine for that then we are 01:22 going to start to continue 01:24 from yesterday look for uh look at the 01:26 source code of how 01:27 mod then if i if we are successful 01:32 that would that'll take most of the time 01:33 if we are successful then we are going 01:35 to modify our command 01:37 so that it um uses helms 01:40 uh uh fuzzy matching okay 01:43 okay so i'm going to turn my camera to 01:46 my keyboard 01:47 okay so because my 01:50 you know my wife is sleeping is she's 01:53 gonna 01:54 go to bed so i want to 01:58 just show you my keyboard then you are 02:01 looking at my keyboard this is kinesis 02:03 this is kinesis advantage 2 02:07 with linear red switches 02:10 and this is ultimate hacking keyboard 02:12 you can see 02:14 on my website i have reviews and videos 02:17 of it 02:18 kinesis advantage 2 and ultimate hacking 02:21 keyword 02:22 so go buy it if you like it 02:25 uh okay so let's begin coding i'm going 02:28 to do this 02:28 fast today hopefully we can complete 02:31 what we need so 02:32 for you emacs users the left side the 02:35 pink window 02:36 is my you can see all the commands i 02:39 call for example moving closer right 02:41 left up down or moving by paragraph 02:45 or moving up and also you can see the 02:48 keystrokes 02:49 on the pink window and i'm using 02:52 sapphire keys 02:53 and i'm using varia keyboard so the 02:56 letters are 02:57 uh not quoting okay so let's first of 03:00 all begin 03:01 so okay let's start to do this job 03:04 okay first of all uh create an empty 03:08 emac this 03:09 buffer then we're gonna define uh 03:12 select phrases okay we're gonna say 03:16 select phrases and docstring is gonna be 03:21 prompt to 03:24 let users select a accurate 03:30 academic phrase and insert it okay 03:35 version today's date so this is our 03:37 command so 03:38 we're gonna start to write this command 03:40 okay uh okay let's begin 03:42 okay so uh let's prevent our 03:46 arrow yeah let's do that there so 03:50 let's we don't care for let uh let 03:53 then okay so we need a bunch of academic 03:57 phrases 03:57 so let's look at yesterday we have 04:00 prepared 04:01 a bunch of academic phrases 04:04 ah i removed it 04:08 okay so we have to uh 04:12 yeah we have to search for okay let's 04:14 search for it 04:19 p h r a s yes academic phrases 04:22 least okay 04:26 uh 04:28 academic phrases 04:35 okay let me just quickly find it you you 04:40 wouldn't be interested in this 04:43 yeah analysis okay let's do that 04:47 okay academic phrases 04:56 now i remember 05:02 uh yesterday i have a collection of 05:05 search phrases 05:06 but and 05:09 this yeah oh okay wait 05:13 page not this 05:22 uh 05:29 okay let's let's try this okay these 05:32 are a bunch of academic phrases let's 05:35 just 05:36 use that okay then paste it here so we 05:40 have a bunch of academic phrases 05:42 now 05:46 we will let user choose among one of 05:48 these okay 05:49 now make them uh add quote quotation to 05:53 them 05:54 okay and make this a okay 05:57 phrases okay then 06:00 that add a parenthesis around them 06:04 and add a quote so this 06:08 is gonna cut we paste it here predefine 06:11 the code 06:13 okay so that's a code okay let's delete 06:15 a few of them 06:17 let's do the short ones okay 06:21 uh yeah because we are just 06:24 testing this anyway 06:28 okay so we we have a bunch of uh phrases 06:31 academic phrases now 06:33 now we want to insert we want to 06:36 uh oh we actually we need a parenthesis 06:42 there then we need uh to say user choice 06:46 okay cho 06:52 i uh 07:00 what 07:08 ah i'm not with myself i forgot how to 07:11 spell 07:11 choice choice okay i think that's it 07:15 yeah choice okay stupid english 07:19 spelling okay so now user choice is the 07:22 one user choose 07:23 chosen okay so now set 07:27 q user choice 07:30 i do completion 07:35 i do completion read 07:42 i do completing read okay 07:51 okay that is the command we want 07:57 and 08:01 so this function i do completely read 08:03 and given a list of faces 08:05 it will prompt user the faces okay 08:09 so about the buffer now let's call our 08:12 command select phrases 08:14 so meta x select phrases 08:18 enter wrong arguments 08:24 okay so wait uh i do completing 08:28 uh what's going on 08:32 oh the first argument should be a prompt 08:37 pick one okay evaluate the code 08:41 let's okay evaluate the code meta x 08:45 select phrases now we got the list of 08:47 phrases let's say 08:49 uh l a 08:52 okay l a c 08:56 so that contains the word lack okay so 08:58 enter oh 08:59 we do nothing we need to insert it so 09:01 now insert 09:04 uh insert user choice okay now try again 09:07 evaluate the code 09:09 meta x select phrases l a c 09:12 okay enter then it inserts that that's 09:15 what we want 09:16 now yesterday we found out that the i 09:19 do's first imagine 09:21 is based on is a character based first 09:24 imagine 09:24 that is if the sentence contains i mean 09:27 you type whatever 09:29 and and each character you type is 09:32 consent 09:33 considered a character if the sentence 09:36 contains all the characters you typed 09:38 doesn't matter where 09:40 and doesn't matter if there's something 09:41 in between i do will 09:43 consider that as part of your you know 09:45 as as the 09:47 choice until there's unique until if 09:50 you type more when it when it's unique 09:53 you'll just 09:54 you'll find it okay so now but now we 09:56 want a word-based 09:58 uh first imagine which is used in helm 10:01 so for example let's 10:02 try helm okay h-e-l-m 10:06 hell meta x okay so here's helm 10:09 so we can say 10:13 you know one of the commands we just 10:14 defined is select phrases right 10:17 now i can type phrases space 10:21 select it will also uh match 10:24 our command name for example let's try 10:27 p-h-r-a-s-e-s 10:29 space you see it's right here 10:32 now i say sel you see 10:35 now if i enter you know i'm calling 10:38 the command we just wrote so okay now 10:41 cancel now so 10:42 you see that you see that in hellmod 10:46 it's fuzzy base first imagine is based 10:49 on 10:50 word based first imagine and also order 10:52 that doesn't matter 10:54 okay so that's that's what we are going 10:57 to do that's uh 10:58 but now we are going to start to dive 11:02 into 11:02 the helm's uh emac this source code 11:06 and to see 11:09 to see to see 11:12 if we can understand it and eventually 11:16 what we need to do is that we want to 11:18 modify this code 11:19 so that it uses uh instead instead of i 11:22 do 11:23 it uses helm's word matching 11:27 first imagine engine thank you george 11:30 for twenty dollars 11:32 thank you okay so let's begin let's 11:35 begin the journey so how long have i 11:36 been talking 11:38 uh that can be it cannot be right i 11:42 already talked for 20 minutes what 11:47 uh 12 minutes okay i 11:51 i already talked for 12 minutes okay not 11:54 too bad 11:55 okay let's begin because this is gonna 11:56 be a long session today 11:58 so we want to start to look for helm 12:01 okay so 12:02 uh last time we made some progress but 12:04 let's continue okay 12:06 uh so first of all call help mx 12:09 and control hf describe function 12:15 so help so we start to look into helm's 12:18 source code okay 12:19 enter to look at the source code here's 12:21 the source code 12:22 and now meanwhile back here uh 12:25 wait what is this uh uh 12:29 what is this woody vlog okay that's my 12:31 word blog 12:35 go back to talk show uh today's talk 12:37 show wait 12:38 today's top show is here so let's write 12:41 it down okay 12:42 the first command the helm 12:45 core stack so first of all we look at 12:48 how 12:48 meta x 12:51 okay then yesterday we found 12:55 how meta x is actually calling 13:04 um 13:06 it's actually calling 13:16 there how many x read extended command 13:19 okay up up right so let's copy that 13:22 let's 13:22 make you know let's keep track 13:26 okay so how meta x is calling this 13:31 helm mx read extended command 13:34 now we look at the source code of that 13:37 okay 13:38 so here is the source code i mean let's 13:41 enter 13:42 so here is the source code 13:46 and this command is actually 13:49 again calling another command to do the 13:51 work 13:53 so let's see what it is there it is okay 13:57 so this command is actually the 14:00 you know the heart of this command is 14:01 actually just a wrapper 14:03 so it's calling this helm command okay 14:06 let's copy 14:07 go back and let's record it let's put it 14:10 here 14:12 actually actually let's go back to our 14:16 emac this 14:17 and put it there okay and 14:20 wait uh 14:26 yeah here so so we want so here 14:29 is the 14:35 helm called stack okay so now it's 14:38 actually 14:38 so it's actually calling help the 14:41 command the function help 14:43 so now let's describe function on helm 14:46 and go to the source code of helm 14:48 okay here's a code narrow to region 14:52 and it's 160 lines now if you remove the 14:55 comments it's just 14:57 50 lines okay and this command is 15:00 actually 15:01 again calls another command to do the 15:03 actual work 15:05 that's what we found out yesterday so it 15:08 is actually calling 15:10 um helm internal you see 15:13 you see here is a local variable fn fn 15:16 is a function 15:18 now and and and you know 15:21 it sets up what value should it be 15:24 so it's either one of helm nest 15:28 if helm is already called or it's just 15:31 called helm again 15:32 or it calls helm internal 15:35 so you know so first of all it says 15:39 set sets up a local variable fn then 15:41 eventually 15:42 here is a what call what it calls you 15:45 know fn 15:46 apply fm p list p list is a 15:51 property list so anyway so what we found 15:54 is that 15:56 essentially this command helm 15:59 it's actually not a command it's just a 16:01 function you cannot call 16:03 uh this interactively because you see 16:05 there's no interactive 16:07 line there so this this function helm 16:10 actually calls uh it calls 16:14 helm internal to do work okay so close 16:18 that 16:18 let's write it down okay open reopen 16:22 uh yeah copy that 16:25 and uh okay hold on 16:30 uh wait uh what 16:35 okay uh yeah so it actually says that 16:41 uh apply 16:44 helm internal to a p list now p list 16:48 is some sort of property list let's see 16:50 what it is 16:53 so far so good nice microphone yeah 16:56 yes 17:01 so let's see how i want to know what is 17:05 the 17:06 p list p is usually a property list okay 17:09 hold on a second 17:10 let's narrow to defend and let's search 17:14 for 17:14 p list okay hold on a second let's show 17:17 the 17:18 pink window search for p list okay 17:21 oh okay so it's an argument resp is at 17:24 least 17:24 like that okay property list okay 17:29 keyword supported okay okay so somewhat 17:33 okay keep that in mind so here is 17:36 actually a sample call 17:38 okay uh 17:47 okay let let's open a new emacs window 17:52 let's uh keep this window here 17:55 and actually uh let's see 18:01 now open last closed 18:04 uh keep this in mind okay uh 18:10 so we we i you know i 18:14 need to do this quickly i need to make 18:16 progress 18:18 so again we are trying to find how first 18:21 imagine 18:22 is implemented in helm 18:26 so here's those keywords 18:29 okay so okay let's let's continue on now 18:32 let's look at helm internal okay 18:35 let's look at helm internal yeah 18:38 describe function uh then 18:42 jump to the 18:45 okay actually helm internal this is how 18:48 you call it 18:49 let's write it down uh then jump to the 18:52 source code 18:55 okay so entry point helper okay 18:58 helm internal now narrow to defend 19:04 so this is again 100 lines okay 19:06 yesterday we have not 19:08 looked at we have not looked 19:11 at this command much so let's continue 19:15 so helm internal okay but before we do 19:17 that 19:18 how is it called again helm internal 19:21 optional 19:22 sources sources is a list for example a 19:25 list of academic phrases 19:28 then input is 19:33 okay input is whatever user has already 19:36 typed i think 19:38 wait and prompt resume pre-select 19:41 buffer key map default history okay 19:45 helm internal so let's look again 19:50 now there is no uh no documentation 19:55 for helm internally well there there is 19:57 there is 19:58 the internal helm function called by 20:00 helm 20:02 for sources input for for these 20:04 arguments and history arg 20:06 see helm okay so it seems 20:09 that the function helm 20:12 internal uses the same argument 20:15 as help now we want to be sure 20:19 let's let's let's check okay let's check 20:21 a little bit 20:25 uh okay here's helm internal 20:29 and let's let's describe function on 20:32 helm uh it jumped 20:36 okay no no it didn't jump so here's how 20:39 helm internal 20:40 and here is okay so let's move this here 20:46 actually 20:48 so here is helm 20:51 so helm calls helm internal okay 20:55 uh and the rest p lists 21:00 okay so helm internal documentation says 21:04 the internal helm function called by 21:05 helm 21:07 for this this this this this and this c 21:10 helm okay so it's sources 21:13 input prompt resume 21:20 ah wait okay so narrow to region at 21:25 okay now to region right 21:30 actually widen okay 21:37 yeah it moved you know we lost the 21:40 position for helm internal so let's 21:42 let's describe function let's see how 21:44 i'm internal 21:48 so helm internal is line 2 200 21:52 i mean 2 800 2800 21:56 and the function helm is 2600 22:00 okay 22:04 okay helm calls helm internal now we 22:06 want to make sure 22:07 they use this exact is their argument 22:10 exactly the same sources input prompt 22:14 resume okay sources input prompt 22:18 resume then pre-select yes 22:21 buffer check key map check default 22:24 check and history check okay so help 22:27 actually has one more thing allow nest 22:32 okay so 22:35 they they essentially use the same 22:37 argument okay helm and helm internal 22:41 now helm calls helm internal is that 22:44 right 22:44 uh let's go down 22:50 yeah helm calls helm internal okay so 22:53 now 22:54 now what does helm internal uh do let's 22:58 narrow to region and let's let's see 23:00 helm internal what does it 23:06 do 23:08 uh okay so how many lines hundred lines 23:12 okay so we need to i need to um focus on 23:15 this 23:16 uh so s so how i'm internal uh this 23:20 bunch of 23:20 options commonly assert 23:26 unless so if if helm nested 23:31 is not true then set helm 23:34 initial frame selected frame okay 23:37 a frame is kind of a 23:40 panel something okay then activate the 23:48 advices okay then 23:51 when so if advice add is 23:55 defined is is found the function is 23:58 defined 23:59 then advice add translate password okay 24:04 it's related to remote you know uh 24:07 ftp or you know remote ssh 24:12 advice ad so 24:15 when found advice add then do these 24:18 things ensure line of mod is disabled in 24:22 helm buffers to preserve performance 24:24 that's right 24:25 so when you have liner mod it makes 24:28 emacs very slow 24:30 okay then advice add line them on 24:33 blah blah blah then helm 24:36 log okay uh 24:39 okay kind of logs 24:42 okay then helm or pumped 24:46 pattern set q helm pumped pumped 24:50 pattern okay 24:53 so it looks like so far you know it's 24:55 calling it's setting helm pumped 24:58 so p pound prompt is not a local 25:01 variable you see 25:02 i'm trying to search for it it's failed 25:04 so helm prompt is a 25:06 some sort of global variable 25:10 and but it's internal to help mod 25:13 because you can 25:14 see usually 2-dash means it's internal 25:17 to help 25:19 so so so it's um 25:22 it's setting helm pump okay so now 25:25 then let none essential 25:28 true prevent mouse jumping to the upper 25:31 right 25:32 hand corner of the frame i don't know 25:35 what that 25:36 what bug is that what is non-essential 25:39 let's see describe function 25:42 non-essential oh 25:44 it's not even defined 25:48 okay so non-essential is not a field in 25:51 emac list function it must be 25:55 oh actually it's just a variable so 25:58 set the variable known essential a local 26:00 variable to 26:01 true but where is it used 26:07 that's that's kind of strange that so 26:09 it's not used 26:11 in this function so that must mean 26:15 either it's a mistake you know they 26:17 forgot to remove this 26:19 variable it's an unused variable or 26:23 it is actually some global variable 26:26 defined in 26:27 helm let's try okay copy that 26:30 describe variable non-essential yeah 26:33 okay so it's actually so it's a global 26:35 variable in emac lisp 26:37 no essential is a variable defined in 26:39 simple.el 26:41 documentation wherever the currently 26:43 executing code is performing 26:45 an essential task okay this variable 26:49 should be the neo only when running code 26:52 that should not disrupt 26:54 disturb the user okay 26:58 okay yeah it is some kind of uh 27:01 user interface related thing so if it's 27:05 non-essential 27:06 then okay blah blah blah i don't okay i 27:09 don't care about this 27:11 this uh code hell maybe use default as 27:15 input okay now i i think 27:18 now we are getting into the important 27:21 part 27:22 unwind protect conditional case unwind 27:25 protect is kind of 27:26 error handling it's like uh uh 27:30 you know throw and catch okay in 27:34 that's a list version of condition case 27:37 unless debug 27:40 you know i hate the word unless 27:43 okay so basically it means condition 27:45 case 27:46 if not debug okay if not debug 27:49 then so if it's not debugged then 27:55 helm source name current source uh helm 27:58 okay 27:59 i need to go faster help buffer helm 28:01 initialized 28:02 okay helm initialize 28:05 resume input default sources okay 28:08 then comment we don't display home 28:11 buffer here 28:12 to avoid popping up a window or frame 28:15 when 28:17 exiting immediately when 28:20 only one candidate disavowed having the 28:22 helm frame fashion 28:26 okay let's first compute candidates and 28:29 if more than one display held buffer 28:32 this is done later in helm read from 28:36 mini buffer okay 28:42 okay again remember our goal is to find 28:44 the fuzzy match 28:46 engine using helm so all these 28:49 are so far is just interface or wrappers 28:52 okay 28:53 uh post command hook okay helm read from 28:56 mini buffer okay so this part is 28:59 probably important okay 29:00 so let's copy that 29:04 because helm read from me mini buffer 29:06 you know in 29:07 in e max leaves in glue imax list 29:10 there's a read from minibuffer command 29:12 which is a general command to 29:15 prompt user and let user input something 29:18 so apparently helm defined its own 29:21 version 29:21 so that's you know and it's calling that 29:24 and that is important so let's write it 29:26 down 29:29 let's write it down 29:32 okay let's look at the source code 29:34 quickly helm 29:36 read from minibuffer okay 29:43 so how many lines of code again 100 29:45 lines of code 29:46 okay so anyway let's uh 29:49 let's put it here and let's go back to 29:52 read 29:55 uh read the source code of 29:59 wait yeah 30:02 what where are we yeah go back to read 30:06 the source code of 30:10 helm internal right so helm internal 30:14 calls helm read from mini buffer 30:18 so starting here you know before you 30:20 know the helm you know 30:22 helm mx cause helm mx read extended 30:25 command 30:26 that in turn calls helm to do the work 30:29 that in turns cause helm internal to do 30:32 its work 30:35 then at that point the helm internal 30:38 cause cause helm read from mini buffer 30:41 but i don't think that's all because 30:43 at this point it's like splitting into 30:47 two uh i think because 30:50 reach for mini buffer is just reading 30:52 for mini buffer 30:54 you up but but you also need to update 30:56 you know as user types so 30:59 so so there is probably um 31:05 okay let's go to okay help helm internal 31:08 narrow to region uh 31:12 okay read 31:15 read read from mini buffer 31:20 okay so now we are near at the end of 31:23 the code 31:26 helm meed for mini buffer okay go back 31:29 here 31:30 paste the actual core 31:35 okay now go back here 31:40 so here it calls helm read for mini 31:44 buffer 31:46 okay then 31:50 okay here may be a bit complex so 31:53 program one unless so if not helm quit 31:57 then helm execute selection action okay 32:03 okay so 32:04 [Music] 32:07 so i'm guessing you see when 32:12 okay you see this command 32:16 helm read from mini buffer does not seem 32:18 to return i mean whatever 32:20 it returns is not you know set into a 32:24 variable or captured 32:25 or fed into another function 32:29 so that means when helm read from 32:33 minibuffer is called 32:36 possibly it sets some other variable 32:40 then the code later on we'll read 32:43 that as input 32:48 okay so uh trump read 32:51 so okay let's press on okay 32:55 and see 32:59 yeah so you see basically now the 33:03 command finished 33:05 uh you know it's doing log and 33:12 log and update and the reset helm 33:15 pattern 33:19 and help ignore errors and yeah so it 33:22 finished 33:23 log save maybe so maybe it 33:27 so let's look at helm read from mini 33:30 buffer now 33:31 i don't get it because you know when you 33:34 make this call 33:35 it doesn't whatever it returns is not 33:38 captured or something 33:42 you know at least you should call you 33:44 know uh 33:46 you know apply a command 33:49 to the return value of helm read from 33:51 mini buffer so i don't know 33:53 so let's look at helm read from mini 33:55 buffer 33:56 describe function okay and go to it 34:01 here's a code narrow to region 34:05 uh and it's 100 lines okay 34:08 helm read from minibuffer 34:13 now what is the 34:18 what is the uh argument let's see 34:22 prompt input pre-select resume 34:25 keymap default history okay 34:29 so yeah like i said before at this point 34:32 it doesn't seem to be 34:35 you know pure functional programming 34:37 anymore because 34:40 it's okay let's continue reading the 34:42 code 34:43 read pattern with prompt prompt and 34:47 initial input input 34:49 for pre-select resume key map 34:52 default history c helm okay so it's 34:56 telling you to read about helm 34:57 with helm buffer 35:06 history time blinking matching parent 35:10 helm log helm resume 35:22 no i don't you see i don't get it where 35:25 is the code 35:26 for pattern matching you know when 35:30 helm presents you with lots of choices 35:34 where's the code that actually filter 35:36 them out 35:40 because that's what we are trying to 35:42 look for 35:44 of course we are actually in the very 35:47 early stage of looking at helm's source 35:49 code 35:51 uh so i'm not like trying to complain or 35:56 anything it's just that 35:58 we haven't found it yet so when help 36:01 execute action at once if one 36:05 okay uh select window helm mini buffer 36:08 with 36:09 set up hook helm 36:12 maybe update key map 36:16 so is there anyone like following along 36:18 with me do i make sense 36:21 only like five concurrent users 36:29 okay so key let's continue reading the 36:32 helm source code 36:35 okay so wait let's let's magnify 36:38 okay continue reading the helm source 36:42 code 36:50 uh helm quit if no candidate 36:53 helm empty buffer true okay 36:56 ensure false update with no candidates 37:00 okay help reset default pattern okay 37:04 so we might want to search for the word 37:07 pattern 37:08 because that's that's what helm uses 37:11 you know it's related to first imagine 37:14 so 37:14 here it is okay so we found this 37:20 set q helm input 37:24 then helm pattern okay 37:27 now where is helm pattern defined 37:31 okay there's just only three occurrences 37:34 in this function 37:38 so helm pattern is apparently again 37:41 another 37:43 globalish variable used by helm 37:46 so describe variable helm pattern 37:49 there it is the documentation helm 37:52 pattern 37:53 is a variable defined in helm lib okay 37:56 value is empty 37:57 documentation the input pattern used to 38:00 update the helm buffer yeah 38:03 okay so apparently when you call you 38:06 know one of the helm commands 38:07 so it's not doing things in a functional 38:10 in a pure functional way 38:12 uh probably because of reasons for 38:14 reasons because 38:15 when you call helm you know how meta x 38:19 it you know you have the mini buffer at 38:23 the bottom 38:24 where you type something 38:27 uh for example phra 38:30 but however it has another buffer 38:34 that updates as you type and 38:37 this buffer is not a mini buffer 38:41 so this is a user interface 38:44 that's different from gnu emacs because 38:47 in groom 38:48 in imax the update happens in the 38:53 mini buffer most of the time 38:56 i get yeah there are exceptions i guess 38:59 anyway so 39:01 what i'm saying is that so helm creates 39:03 a 39:04 this different buffer called candidates 39:08 that updates as you type 39:12 so that means you know so that means on 39:15 one hand 39:16 we have the helm you know read from 39:19 mini buffer that's taking uh 39:23 uh whatever user types on the other hand 39:26 so it it 39:30 probably you know it has to update the 39:32 other buffer 39:33 but how is that done uh how is that done 39:37 so it must be i don't know 39:40 i'm not sure how it is done it must be 39:42 some 39:46 some sort of like parallel 39:50 uh or concurrency uh going 39:53 maybe yeah i yeah i don't know so 39:58 so helm pattern helm pattern so you know 40:01 maybe it's updating some 40:04 variable and another command is actually 40:10 checking the variable whenever the 40:12 variable changes another command 40:14 is running in the background or 40:15 something that updates 40:18 the helm's candidate buffer 40:22 so possibly that's how it is 40:25 done you see uh helm quit 40:28 you know i don't know i'm just like kind 40:31 of guessing right now 40:34 uh so you know because we just only we 40:38 be 40:39 only we begin to look at the helm source 40:41 code 40:45 so run with timer and uh 40:48 yeah so i'm not actually seeing 40:52 any deeper level of function course 40:55 that you know that's kind of a core 40:58 of something so i'm not seeing that so 41:01 you can see 41:03 helm execute action at once if one 41:06 okay helm display buffer okay 41:11 uh helm display buffer when 41:15 this then help dispel display buffer 41:18 hand buffer 41:21 helm buffer is another 41:25 helm buffer is another local variable 41:31 here and because but 41:34 it's it's not declared local 41:37 in this function in this helm read for 41:40 mini buffer therefore 41:42 it must be another global variable 41:46 uh for help mod so let's look at that 41:50 describe variable helm buffer enter what 41:53 did it say 41:54 uh helm 41:57 buffer is a variable defining helm lib 42:00 okay its value is 42:02 uh asterisk helm 42:06 okay so documentation both for showing 42:08 completions 42:09 so that is the you know that that is the 42:13 candidate buffer i think 42:18 okay so let's look at the uh file helm 42:20 live 42:21 helm lib okay helm lib how many 42:24 lines of code seventeen hundred 42:27 let's look at the helm directory 42:31 so we have been looking at helm.el 42:38 and we saw the mention of helm lib so 42:42 just how far down we have to look so far 42:45 we have not 42:46 found the fuzzy matching code 42:50 like not at all so how big 42:53 is helm.el wait 42:57 uh widen helm.e.l 43:00 is 7 400 lines 43:03 okay now okay so 43:07 so now what we do so we 43:10 we we tried to track the function but 43:12 now we are at the point 43:14 there is no more to track and we still 43:17 haven't found 43:18 where is the code for 43:21 first imaging so so i'm just starting to 43:24 look random so now let's 43:31 list matching lines let's look at all 43:33 the functions 43:34 in in this file helm dot el 43:38 let's see get a sense what they are okay 43:41 helm log 43:43 helm get source held selection okay 43:48 okay so you can see you see i 43:52 i see the word here pass okay 43:55 pause keys okay that's past keys that's 43:59 not 44:00 passing user input 44:04 we are trying to find some kind of 44:08 a word for pattern or regular expression 44:11 or fuzzy matching 44:15 wow this huge number of functions 44:18 oh there it is okay so so here 44:22 okay here 44:25 helm fuzzy match candidate helm 44:28 fuzzy search pattern okay 44:31 now we actually we we have found 44:36 we have found uh the kind of functions 44:39 we are looking for i mean at least 44:40 closer we 44:41 you know help match functions let's 44:43 let's let's go there 44:45 okay matching candidates 44:49 yeah so we can see at this point that 44:52 helm 44:53 has a engine it implements its own 44:56 engine non-trivial 44:57 engine to to have the feature of 45:01 you know a fuzzy match uh 45:05 you know and then you have also helm 45:08 flex match 45:11 so quite a lot lines of code thousands 45:15 probably so here we have helm flex style 45:19 score 45:20 okay so it has a scoring system 45:24 uh flex scoring system scoring algorithm 45:27 of flex style in e-max 27 okay 45:32 so here we can see regular expression 45:34 mentioned 45:36 yeah so at least in part 45:39 it uses regular expression to do the 45:42 match 45:44 now another question i have is whether 45:46 it exclusively 45:48 rely on regular expression or not 45:52 no so what does that mean so if it 45:54 exclusively rely on regular expression 45:57 that means whatever helm does with first 46:00 imagine 46:01 it actually generate a regular 46:03 expression then 46:04 use the regular expression to do the 46:06 match 46:08 but if it does not rely on regular 46:10 expression 46:12 then that means hell must have written 46:14 its own 46:16 sort of passing and you know basically a 46:19 compiler 46:20 you know a a parser 46:24 and again that's not trivial 46:29 okay so so we so at least we have found 46:32 some of the 46:33 let's look at the command fuzzy match 46:35 okay 46:37 so let's see fuzzy match helm fuzzy 46:40 match 46:40 candidate okay check if helm pattern 46:46 fuzzy matches candidate oh 46:52 uh check if helm pattern for semantics 46:55 candidate 46:56 this function is used with sources field 46:59 with helm 47:00 so sync this function is used 47:04 with sources 47:09 okay build with home source sync 47:12 okay so by source it means like a bunch 47:16 of candidates 47:18 so i'm guessing this means for example 47:20 if you are 47:21 using helm mx then the candidates are 47:25 or emacs commands 47:30 so that's pretty much you know building 47:32 emacs 47:33 but sometimes you want to have let's say 47:35 completion of 47:37 a new language is words 47:40 so emacs do not have 47:43 you know them readily available so you 47:46 need to use you need to use helm 47:48 source sync kind of to create the 47:51 sources 47:51 so i suppose that's the case so 47:54 if that's the case then then you call 47:57 home fuzzy match 47:58 to to get a match something like that 48:03 okay and it is using um 48:08 okay so you see at least it you know at 48:11 least part of it is based on regular 48:13 expression because we see how fuzzy 48:16 regular expression cache 48:19 and okay so it's a bit complex it even 48:23 create cache okay so it does 48:27 create cache so another command 48:30 helm fuzzy search pattern okay 48:34 same as helm fuzzy match but four 48:36 sources built with helm sauce in buffer 48:39 okay 48:41 uh let's look at next one okay 48:45 and what's the next one home score 48:47 candidate for patent 48:49 assign score to candidate according to 48:52 patent 48:56 okay score is calculated okay 49:00 i think i got a taste of 49:03 them uh 49:06 now okay wait now 49:11 okay let's look at this one helm first 49:14 imagine default sort 49:16 function one the transformer 49:19 for sorting candidates in first imagine 49:23 okay it sorts on the display part 49:27 by default yeah so so helm 49:31 you know when you call one of the helm 49:33 function 49:34 command as you type 49:38 it shows you know the updated result in 49:40 the candidate buffer 49:42 but it also reorders them 49:46 yeah he also reorders them on the fly 49:51 so basically that's what this uh you 49:54 know that's why it's talking about 49:56 salt salting candidates okay it sorts 49:58 candidates by their scores as calculated 50:01 by 50:02 helm score candidate for pattern set 50:06 use real to the neo to sort on the real 50:09 part 50:10 okay okay yeah so we can see 50:14 the the fuzzy match 50:18 engine actually helm has an engine of it 50:22 and it's non-trivial oh my god it's 50:24 truly 50:30 yeah then you have helm fuzzy default 50:32 highlight match 50:33 so not only you need to match them 50:36 and show the result but you also have to 50:38 highlight them 50:40 on the fly so we have a giant 50:44 uh code base 50:48 here to do these things okay yeah so it 50:51 looks looks like 50:52 you see this 4 000 i mean 4 500 lines 50:58 they are all you know they are 51:02 almost all about matching how much 51:06 function 51:08 okay so 51:11 so then we have help match from 51:13 candidate 51:15 okay how much from candidate 51:20 okay 51:23 then we have helm compute matches helm 51:26 compute matches what does that mean 51:30 start computing candidate in source 51:35 okay so so so far as we can see 51:40 you know my um 51:45 you know what we found out before seems 51:47 to be true 51:49 that you know help me helm 51:53 you know when you call home read for 51:55 mini buffer 51:57 it sets a bunch of 52:00 values like patterns and 52:04 candidates and apparently this other 52:06 code must be checking it 52:08 on the fly in parallel 52:12 i don't know for sure yet but 52:16 you know um 52:20 okay then we also have helm 52:23 render source uh okay let me read the 52:27 comments 52:29 hello anime again 52:34 uh 52:40 okay let's uh hold on a second let's 52:42 let's let's take a break for a minute 52:48 so you can see me here 53:01 hold on 53:25 okay so 53:40 we i need a drink 53:43 okay i'm so like i'm super busy right 53:46 now 53:48 this uh coding is not done yet we 53:57 we spent almost an hour now looking at 54:08 it 54:15 and it's not trivial let's see would it 54:17 be better 54:22 if i do that 54:37 okay you cannot see much anyway 54:43 so hello you look great from that angle 54:48 good morning good morning float 54:51 p net morning sun i've enjoyed many of 54:55 your live streams 54:56 but for the first time i'm actually 54:58 watching you live 55:00 i live in umea sweden 55:03 great fantastic yeah i haven't been 55:06 doing 55:06 a live stream at over you know during 55:09 these hours 55:10 so so some of you guys will find it 55:14 uh i mean it's that's why you don't see 55:17 me live 55:19 now i have a little bit cross-eyed so 55:21 let me cover one of my eyes 55:25 so i can see better so now let's go back 55:29 to 55:29 uh helm shall we let's go back to 55:33 helm 55:38 so so far we we found 55:41 that you know we found that helm has 55:45 like so much code 55:48 that does the fuzzy matching 55:52 uh in helm and 55:55 let's look at the helms function one 55:58 more time okay 55:59 [Music] 56:01 let's list all matching lines different 56:06 so 290 functions essentially so you see 56:10 it's 56:10 long so let's have a overview 56:14 let's see what they are 56:17 so helm configuration helm 56:20 multi-key defend helm customize 56:24 group helm log helm action at 56:28 nth helm save 56:31 helm log save maybe helm debug 56:34 helm print helm default directory 56:39 helm add action to source if 56:42 okay help normalize filter okay let's 56:46 scroll down 56:49 uh help normalize filter help get 56:52 current source 56:55 okay how important keys helm resume helm 56:58 empty source helm apply function from 57:01 source 57:01 so these are all about you know lots of 57:05 them about 57:05 source and about setup 57:09 and about log helm log 57:12 login stuff now what exactly does 57:16 hemlock do 57:18 like where does it log utility login 57:21 log message help debug is 57:26 the neo okay so it uh 57:30 messages are written to the helm debug 57:33 buffer okay 57:34 so log is mostly from for debugging 57:37 purposes 57:38 okay so we can ignore helm log 57:41 you know so it turns out helm is a huge 57:45 package i mean non-trivial because 57:49 it even writes its own you know 57:52 debugging and logging 57:54 code yeah 57:57 uh 58:01 so so okay helm log we can kind of 58:03 ignore 58:04 then set sources uh 58:08 set source then uh 58:11 empty source okay then source blah blah 58:14 blah 58:15 then resume then 58:20 uh let's see then 58:24 let's do this the way uh current 58:27 position 58:29 other windows scrolling windowing 58:31 direction 58:32 initialize the initialize 58:35 toggle suspend update suspend update 58:39 d backward no update okay then clean up 58:42 then so on and blah blah 58:44 and let's go down uh process 58:48 candidate number limit candidate get 58:50 display process pattern transformer okay 58:54 so now get candidates 59:00 now okay so the part we are interested 59:04 the most is probably here fuzzy match 59:07 fuzzy search okay so keep that in mind 59:11 maybe that's the part i need to 59:14 dig deeper match function yeah 59:18 mostly it's over here 59:22 then okay then it says you know 59:26 uh render source collect matches uh 59:29 then helm update update the display 59:33 redisplay buffer remove candidate cache 59:37 insert header okay so then output filter 59:41 okay then 59:44 display my line then how 59:47 move whatever that is okay that's moving 59:49 cursor 59:50 a bunch of cruiser movement 59:53 uh helm previous page next page uh 59:56 okay okay okay so i 60:00 think yeah in large window then i think 60:03 we okay 60:06 now we have completed scanning 60:10 one of the source code file of helm 60:15 and that is helm.el 60:18 i believe that is the core or is it not 60:22 a call yes that's the call that's a 60:24 co-op helm package i mean meaning that 60:27 the 60:28 you know the the major features of helm 60:31 are 60:31 uh done by this file so we have looked 60:35 at all the functions defined in this 60:38 file and uh yeah we got a sense of it 60:41 and there are about 10 60:43 also functions that does 60:47 related to uh first imagine okay 60:51 now what about so at this point 60:54 you know there are many you know choices 60:56 where to go depending on your 60:58 style so for me so we can um 61:02 start to look there okay there are i 61:04 think three 61:05 things we can start to look one 61:09 is to start to look 61:12 at you know 61:16 to look in detail what are these 61:19 first imagine functions do and who is 61:22 calling them 61:24 you know i think that will get us to 61:27 actually start to understand how does 61:31 helm 61:33 uh match candidates 61:38 you know so we are seeing a lot of 61:39 regular expressions here 61:42 uh yeah so so that's one approach start 61:46 to dive 61:47 in depth start to look at the fuzzy 61:50 functions 61:51 in hell that's one approach 61:55 the other approach is actually 61:58 what we want to do the other approach 62:01 let me show you okay so 62:05 you know our eventual goal is to be able 62:08 to 62:09 modify our select phrases code 62:13 to use uh to use 62:16 helm to use helm's fuzzy match 62:20 matching system instead of using i do 62:22 completing read 62:24 so in that case 62:27 we can directly try to find you know try 62:30 to look for a function 62:32 that does that and just replace this 62:34 base essentially replace this 62:37 uh function code by something help 62:40 something like that 62:41 or maybe add two or more two or three 62:43 more lines 62:44 so that we we actually 62:48 complete our goal but this way 62:51 it will be without understanding 62:53 understanding exactly 62:55 how helm does the fuzzy match okay but 62:58 that's a good alternative 63:02 uh oh my god this is taking a long time 63:05 sit adi hello daddy 63:10 okay so we already spent an hour god 63:13 this 63:13 is taking uh 63:16 much longer than i thought 63:28 see 63:33 how many of you are watching that i 63:35 think maybe i go offline and 63:37 do it i don't think uh 63:41 this is uh interesting 63:44 so what what should we do so so this 63:48 fuzzy 63:49 match functions okay it's pretty deep 63:53 okay uh because 63:56 you know you for me to look at them 64:00 you have to understand a lot emac list 64:04 and regular expressions you know uh get 64:06 hash okay 64:09 yeah um 64:12 so that's something i have to do offline 64:15 probably 64:17 uh then so the other approach is just 64:22 try 64:22 is to just try to find a function in 64:25 helm 64:27 that does the equivalent of i do 64:30 complete read 64:32 okay so let's search for completing read 64:35 okay let's see if we can find that in 64:37 home source code 64:41 okay so 64:46 so there uh 64:50 maybe something similar i'm not sure 64:55 okay yeah let's let's just try random 64:57 okay so 64:58 actually 65:03 so i think this is what we need to call 65:06 helm sources source prompt 65:10 buffer okay why don't we do this 65:15 let's just call this command 65:18 okay so for example uh 65:21 let's see okay so for example let's 65:24 copy our function copy it paste it 65:28 so we have two version two versions 65:31 now in this version let's say helm 65:34 select 65:34 phrases with help okay 65:38 and in this version we are trying we are 65:40 just going to try to call 65:43 helms commands uh by 65:46 hack so right now i'm doing trial and 65:49 error 65:50 coding you know like not 65:53 having a good understanding but let's 65:55 just try 65:56 okay so so sources will be 66:01 of course sources will be phrases 66:04 and the prompt will be just the pick one 66:08 that's our prompt pick one 66:12 pick a phrase okay then 66:15 buffer let's say 66:20 okay let's say uh academic phrase buffer 66:24 okay so this 66:35 okay then history 66:38 we don't care for history 66:41 so let's say neo okay 66:49 so with that 66:53 i don't think that will work because the 66:55 helm function 66:56 actually does not return 67:00 like we talked about before it does not 67:03 actually 67:05 like return something for you instead of 67:09 instead of yeah it doesn't i don't think 67:12 it returns 67:13 let's see helm is autorelated compile 67:17 this function okay 67:18 so uh then uh did that that 67:21 that miniva to execute helm okay 67:24 main function to execute home sources 67:27 here is this 67:28 dislike that okay that keywords that 67:32 that that that extra local var 67:36 keywords are supported see other keyword 67:39 section below 67:40 basic keywords are the following 67:44 sources one of the following these of 67:46 sources symbols whose value is a list of 67:48 sources yeah 67:50 okay so let's see oh a symbol 67:54 so it actually needs a sim 68:00 a symbol or variable you know that's 68:02 that's a confusing part of emac this 68:05 it's not clear here whether it's a 68:07 symbol or 68:09 um i mean according to the documentation 68:12 it should be a symbol so 68:15 okay so let's say symbol let's let's put 68:18 symbol there 68:20 input initial input for mini buffer 68:24 prompts okay okay 68:27 okay okay okay okay 68:30 then obsolete 68:36 okay okay okay okay okay okay 68:40 so you see it does not mention anything 68:43 about return value 68:45 as we as presumed before it doesn't rely 68:49 on 68:50 you know returning something it relies 68:52 on some kind of 68:54 it updates something and some other 68:56 function is 68:57 you know uh looking with it looking into 69:00 it 69:01 so let's just try it okay so let's 69:03 remove that then 69:09 okay yeah but but then but then how do i 69:11 um 69:12 how do i get the value because i need to 69:14 get a value 69:16 you know the the user choosing the 69:18 phrase i don't know but 69:23 okay so so let's do set choices okay 69:33 okay let's just do that okay 69:37 uh evolve the buffer 69:41 then call it select face helm okay 69:45 call it select 69:49 phrases helm okay enter 69:55 it asks me to pick a phrase but i do not 69:57 see 69:58 my candidates let's say t 70:03 yeah t h e no candidate 70:06 let's say e okay enter 70:10 wrong type of argument ciao string 70:13 ciao string p neo 70:17 so let's 70:20 call toggle debug on arrow and now let's 70:24 call 70:25 that command again enter 70:28 pick a phrase e enter 70:31 so here is the arrow 70:36 the arrow is run type argument 70:40 child string okay insert neo okay 70:44 so the arrow actually came from 70:47 our own code this line 70:52 because apparently helm returns nothing 70:55 it just returned near 70:57 our user choice is new so when you 71:00 insert neo that's the error 71:04 yeah that's okay so again you know 71:07 i know this problem already the helm 71:13 is not returning anything so how do we 71:16 actually 71:16 get 71:21 i don't know how do you actually get you 71:23 know 71:24 let's try again you see it doesn't show 71:27 any candidates i 71:30 okay i'm i think i'm gonna stop 71:34 today is kind of 71:38 we looked at the helm source code for 71:43 for like close to 90 minutes and 71:47 we didn't go far 71:51 there is no tangible fruit 71:59 yeah so it's um yeah so at this point 72:03 there's another approach that is 72:06 now i need to actually start to 72:09 read carefully each one of each one of 72:13 these functions documentation i think 72:16 that would be the key so i'm gonna start 72:19 to read 72:21 in detail the documentation or the 72:23 source code of help 72:25 mx then help mx read extended command 72:29 you know 72:29 actually we should do that 72:32 you know but overall this is um 72:36 you know for those of you who do not 72:39 have 72:40 lots of coding experience you know if 72:42 you are 72:43 a student for example uh this 72:46 what we did today is actually very 72:49 typical 72:50 day of uh coding job 72:53 you know even though we spend one hour 72:56 19 you know we spend 90 minutes 72:58 it seems we don't have any tangible 73:02 result but that's normal because 73:04 you spend a lot of time to read code to 73:06 understand 73:07 and usually there's no documentation in 73:09 you know in real life coding 73:13 is you know most half of the time 73:15 there's no documentation you just 73:17 read the code and find uh and solve the 73:20 problem 73:20 so if you know so if this is a normal 73:24 day 73:25 job i only started you know 73:28 one you know every day has eight hours i 73:31 only 73:31 you know spend one hour on it 73:34 so given another two or three hours i'll 73:37 probably 73:38 started to understand and be able to 73:41 use uh some helm functions 73:45 to do the fussy matching we want it 73:50 okay so so now i think i'm going to stop 73:54 but let me 73:55 look a little bit more okay so let's see 73:58 let me wrap up let's see what else i 74:00 want to say 74:01 or do um 74:05 let's look chat okay let's see random 74:08 chat any 74:09 comments you guys and thank you george 74:11 again for 74:13 twenty dollars fantastic 74:16 and if you guys have not already joined 74:19 sar discord okay 74:25 uh join this discord uh 74:29 you know lots of interesting people 74:34 uh there um 74:38 so let's play with my camera let's see 74:40 if i can 74:43 okay let's see 74:45 [Music] 74:49 if we can get a better vantage point 74:56 this is night coding 75:00 uh oops okay so 75:06 for a change you know uh so let's see 75:08 hello 75:09 hello hello anyone still here five 75:12 people watching two likes 75:15 okay i think that's it for today so 75:20 i'm kind of annoyed a little bit annoyed 75:23 that 75:24 we you know i didn't 75:27 i did you know i didn't expect it to be 75:30 this complex you know helm has 75:34 you know like the entire you know that's 75:37 what helm is for it has 75:39 basically the whole thing is about uh 75:42 pattern matching 75:45 uh i want to put this on 76:00 yeah the whole thing 76:03 it's very interesting though because 76:05 fuzzy pattern matching 76:07 fuzzy pattern matching is one of the 76:10 very useful thing 76:12 that began to become 76:15 fairly popular about 10 years ago 76:19 because you started to see 76:22 lots of applications using that 76:25 and i presume there are 76:29 quite a lot libraries doing that first 76:32 imagine you know 76:33 there are several types i haven't 76:35 studied them in detail 76:37 for example there's flex matching 76:41 then helm sway i don't know if there's a 76:43 proper 76:44 word for helm's uh way of fuzzy matching 76:48 then there is i do you know i do use 76:51 this a different 76:52 uh way uh 76:56 you know a different form 77:00 so so if i 77:03 if our job if if you know my job 77:06 basically my job is to 77:08 you know i need to do this for a project 77:11 i need to write a basically a command 77:14 to you know academic phrases to 77:18 to choose the academic phase and i want 77:21 to be able to use 77:23 helm's way of fuzzy matching 77:27 so that's what i need to do 77:31 so like i said before you know one way 77:33 is just actually 77:35 you know since i'm a nerd i'm interested 77:37 about first imagine to dive into detail 77:40 see 77:41 exactly what type they are you know 77:43 actually we can actually let's look at 77:45 wikipedia okay 77:48 let's see what wikipedia say about fuzzy 77:52 matching 77:53 now uh is there an article 77:56 on wikipedia approximate string matching 77:59 okay that's uh 78:01 i suppose that's a term in computer 78:03 science approximate stream matching 78:06 often colloquially referred to as fuzzy 78:09 stream matching 78:10 fuzzy string searching is a is the 78:12 technique of finding strings that match 78:15 a pattern 78:16 approximately rather than exactly 78:19 the problem of approximate string 78:22 matching is typically divided into two 78:24 sub problems 78:26 finding approximate substring matches 78:28 inside a given string 78:30 and finding dictionary strings that 78:33 match 78:35 patterns approximately finding 78:38 dictionary strings 78:40 that 78:43 that match the pattern of sharks 78:45 approximately what does that mean 78:48 i don't know the okay the closest of a 78:51 match is mentioned in terms of the 78:53 number of primitive 78:54 operations necessary to convert the 78:56 string into 78:57 a an exact match 79:01 okay this this number is called the 79:03 added distance okay 79:05 so it's starting to get become technical 79:08 and precise 79:12 uh problems formulation and algorithms 79:15 okay okay and 79:18 one line versus online versus offline 79:22 okay so actually so this 79:25 is um yeah so this is actually 79:29 a pretty common problem you can see 79:32 there are quite a few 79:34 algorithms for example plagiarism 79:38 detection 79:39 needle hand wounds and algorithm okay so 79:42 you got 79:42 quite a few locally sensitive hashing 79:48 okay uh 79:50 okay then then you have this article 79:52 string metric 79:54 in mathematics and computer science a 79:56 string metric 79:59 is a metric that measures distance 80:02 between two text strings okay 80:04 okay so yeah so there are quite a few 80:07 different way 80:08 to measure to determine whether two 80:10 words 80:11 are you know uh it's a match or not 80:14 in in other words this is a kind of a 80:18 more formal way of of seeing 80:21 the difference of pattern you know first 80:24 imagine used in i do mod 80:26 and used in helmet they are different 80:29 why because they are using two different 80:31 string 80:32 metrics you know the way they measure uh 80:36 distance so 80:40 but i don't know if there is a name for 80:43 the 80:43 precise algorithm that that 80:47 helm uses or i do 80:51 and i don't necessarily expect one 80:54 because 80:55 you know that's real life coding you 80:57 don't necessarily 81:00 you know you just make it work okay so 81:04 okay that's it for today uh 81:07 do we have any more comments we do so 81:12 okay a keyboard question then we're 81:13 gonna shut down okay 81:15 uh i'm thinking about getting the foot 81:17 pedal for the kinesis advantage 81:20 okay i know it's pretty expensive but 81:23 would you recommend 81:24 it if cost was not an issue 81:30 okay i'm going to answer that then 81:32 kambal 81:33 hey hey ken bio canberra button 81:37 great to see you here camber button is a 81:40 emax this expert actually 81:44 canva barton is a blender developer 81:47 for for for quite a few for many years 81:51 right 81:51 yeah so campbell barton is a 81:56 you know one of the blender 81:59 uh country contributor uh which is 82:02 written in c 82:03 i think c or c plus plus so cam 82:07 can be a button so have you so canva 82:09 says by the way 82:10 for your information emacs 27 has new 82:13 functions string distance maybe 82:15 of interest okay that yes that would be 82:18 that would be 82:18 of interest let's let's see so finally 82:21 we have someone 82:27 let's check fantastic okay whoa 82:30 wow in c code look string distance is a 82:34 b only function in c 82:35 source code fantastic so string distance 82:39 string one string two uh 82:41 optional byte compare return okay return 82:45 the length 10 distance okay 82:49 so this is useful in case 82:52 if i end up you know if i end up not 82:55 wanting to use uh helm then i'm gonna 82:58 this will be useful also we haven't 83:02 looked at 83:02 i i do source code yet so again that's 83:06 gonna 83:07 i don't know how long that's gonna take 83:09 but 83:10 this is like real life coding that's uh 83:15 fantastic so camp and kanba is a c 83:18 and c plus plus in python expert great 83:22 okay now let me answer the keyboard the 83:25 question then that's it for today okay 83:27 so if you like my stuff 83:28 again you know you just go to my website 83:34 uh you know because uh emacs tutorial 83:38 or emacs you know today we're talking 83:40 about emac this 83:41 so i did a kind of tutorial i did i did 83:44 lots of 83:45 videos uh by now so you can patreon me 83:49 or buy my emacs tutorial practical 83:54 emacs tutorial okay uh 83:57 you know i teach you emac this from the 84:00 ground up 84:00 or the the most basic practical ones so 84:03 you can get up to speed very fast 84:07 in a week you'll learn all the essential 84:10 the most 84:11 essential commands and what they mean 84:14 okay thank you so let's let's go to 84:17 keyboard okay 84:18 let's talk about now keyboard is much 84:22 easier to talk about 84:24 than than code okay so 84:27 so uh the question is about the 84:30 the question is about the pedal okay 84:34 i don't use pedal myself for this one 84:37 okay 84:39 and this is fairly expensive and 84:42 let me okay so the first thing you want 84:44 to know is that so i have a review here 84:46 actually i did a video kind of long time 84:48 ago 84:49 so i did a review of this pedal so 84:53 the first thing you want to know is that 84:55 this is not 84:56 for you know most people will think okay 84:59 one of the pedal will be control 85:01 the other one is the old and the other 85:03 one can be shift something like that 85:05 so you are thinking the pedal is gonna 85:07 be modifier keys 85:09 no okay you cannot do that 85:12 the by default the kinesis around elite 85:15 2 85:15 foot pedal do not allow you to 85:18 do that you cannot set any of the pedal 85:22 keys to be modifier 85:23 okay so what does it do well they do 85:26 for example you can set them to any key 85:28 that's not modifier for example they can 85:31 be left click 85:32 you know mouse click left click right 85:35 click middle click or 85:36 or or pressing f1 f2 85:39 things like that okay or caps lock turn 85:42 on caps lock 85:43 things like that so you cannot you use 85:46 them for modifier keys 85:47 for the pedal why there's a good reason 85:50 for that too 85:51 so by default as far as i know you 85:53 cannot do that 85:55 uh possibly you can if you hack it i 85:58 don't know but by default you cannot use 85:59 the 86:01 the foot pedal for modifier keys why 86:04 it's a good thing because you know 86:06 there's a story where there's a kid 86:09 who set one of the foot pedal for 86:12 push to talk when you if you are a gamer 86:14 you know you press a key to 86:16 then you can your microphone is on you 86:18 can chat then when you are done you 86:20 you you leave it then you know your 86:23 microphone is shut 86:25 so he got used to that then one day he's 86:27 driving and talking 86:29 to his mom then he does a push to chat 86:33 hey mom we are you know you you know 86:36 what 86:36 happens next you know this crash 86:40 you know so so it's a so 86:43 be careful of that so i wouldn't 86:45 recognize you know in fact i 86:48 even if it can i wouldn't recommend it 86:51 because and and i don't think it's a 86:53 good uh efficiency in terms of 86:55 efficiency because imagine you you you 86:58 stamp on 86:59 on a pedal then you press a key then 87:03 you know it's not very efficient 87:06 as i said before i rather recommend like 87:08 you've seen my keyboard before 87:10 in this you know just have lots of 87:12 marker keys 87:13 but food pedal is still useful because i 87:15 have it i use it for example 87:18 i've set up so that one is a previous 87:21 application like like i can show you 87:24 um i don't have it 87:28 set up now but but if you can see my 87:32 keyboard 87:36 okay so one of the pedal is previous 87:39 uh previous window okay so previous 87:42 window so if i go here 87:44 previous window previous window you know 87:46 it can be some window 87:48 here previous window you see very useful 87:52 and the other is max screen okay like 87:55 that key 87:58 and the other one i forgot what the 88:00 other one is 88:03 but uh 88:11 yeah but that's what they are i mean so 88:14 that's what i use for 88:15 them for uh you know max window previous 88:18 window 88:19 toggle toggle max window and the other 88:21 one is meta x 88:22 oh yeah emacs meta x is very useful you 88:26 you 88:26 it's possible you can set them to be 88:28 codes so one of them 88:30 uh i think i had meta x so that's my 88:33 recommendation 88:34 you know whether you like that or not 88:36 it's up to you 88:38 okay thank you guys 88:42 uh thank you guys for watching bye 88:55 yeah okay bye