From: Bernard D. <bde...@or...> - 2020-08-14 18:12:43
|
Hi César, thank you for your message. I can answer some of your questions now. For the others I’ll have to look in the code and will answer later. > Le 14 août 2020 à 18:10, Ces VLC <ces...@gm...> a écrit : > > Hi! > > First of all, thanks a lot for the development of this editor!! It seems to be very powerful, but however it's mostly unknown... I encourage you to announce it more, so that more users are aware of it! > > My interest is for C programming (the vast majority of files I edit are C files). After trying how to do some things in Alpha, I got some questions that either are not documented, or I wasn't able to find the proper place at the documentation: > > - If you indent using spaces instead of tabs (as usually recommended when writing C code), can I use the cursor keys in a way that they detect contiguous spaces as tabs, for easier navigation? I mean, can I make the cursor keys behave like if I was using tabs instead of spaces? This is not supported at the moment but should be easy to implement. I’ll try to assemble something and will post the code. If I undestand correctly, when you press the right arrow for instance and there are four spaces, you want the cursor to immediately jump four positions to the right. > - Is it possible to jump to the previous/next mark in the file, from where the cursor is located? When I edit C files, it's very convenient to jump to the next function/struct/definition/etc, or to the previous one. When using the C mode, there are two little buttons that let me navigate to marks by their name, but I found no option for jumping to the next or to the previous one. There is support for this in Alpha using the function::next and function::prev procs. This is used by many modes (like R and TeX modes, etc) but surprisingly this is not exposed in the C mode (the main reason is that they do not have a menu of their own). This is easy to implement though by creating menu shortcuts for this. For instance if you want to bind function::next to Opt-Ctrl-N and function::prev to Opt-Ctrl-P, put the following instructions in your file CPrefs.tcl (select Alpha ↣ C Mode Setup ↣ Edit Prefs File to open it) binding create -tag C {oz 'N'} function::next binding create -tag C {oz 'P'} function::prev Then after relaunching Alpha, the key combos will work as expected when you are in C mode. > > - Is it possible to jump to the mark of a function definition if you click on a call to such function? For example, I tried to select the function name, and I right-clicked hoping I would get an option for jumping to the mark where the function is defined, but however the contextual menu didn't have that option. > Usually in Alpha, this kind of thing is achieved by Shift-Command-Double-Click but I think this is not implemented in the C modes. I’ll see if it is feasible. > - This seems to be a dumb question, but I couldn't find any documentation: The tab key doesn't work even in plain text mode (I assume that in the C mode this is done to enforce the indentation style, but, however, in plain text mode I'd expect to be able to indent freely... why is the tab key disabled? Is there some preference for enabling it? This is a famous Alpha idiosyncrasy : to obtain an actual tabulation (in any mode), you have to press Opt-Tab (and not just Tab). The Tab key alone is reserved for navigation in templates. For instance if you type ‘ifelse’ in C mode and then press the completion key (which Ctrl-Tab), Alpha inserts a template like this if (•) { • } else { • } • and the Tab key lets you fill jump to the next bullet as you fill the template. So again, for an actual tabulation, press Opt-Tab. This can be modified in Alpha ↣ Global Setup ↣ Keyboard Shortcuts ↣ Special Keys > - Also, the automatic indentation in the C mode favours one style, but you'll know that there are different styles for C indentation and brace locations... for this reason I found it difficult to get used to the automatic indentation of the C mode... can I disable it? (I tried, but there are several options in the C mode that are not documented and also have a weird setting -such as code0, fixed0, etc-, and I didn't know how to proceed). As a coincidence, I’m currently working on improving indentation in the C modes, so I’ll have a look. > - Can I put a Fileset combobox in the window toolbar, for easily moving from one file to another one? There's the windows menu and the fileset menu, but it's not as convenient as having a quick combo for quickly choosing files… If you Option-Click in the toolbar or titlebar of a document window, you’ll see a popover with the list of all the sibling files. Double-click in the popover on the file you want to edit. > > - Ah, finally something that looks like a bug: It seems the Matlab mode robbed the ".m" suffix :-D so when you open the help for the Objective-C mode and you click on the example file, it's opened in Matlab mode, and you are told to be in the Matlab example (but it's actually the Objective-C example file= There is a notion a preferred mapping to solve this problem (I also work a lot with ObjC and C files). Go to Alpha ↣ Global Setup ↣ Preferred Mapping then enter the *.m pattern in the next dialog, then select ObjC in the following dialog press OK Now any file with .m extension will automatically open in ObjC mode instead of Matlab. I hope this helps a little, Bernard |