by daptaq · 4y ago · 0 comments
The main intention is to demonstrate how context-menu-mode works, how to extend it yourself and call for people to test it before Emacs 28 is released. Having written a few forgettable articles, I ended up forgetting that intentional provocation attracts unintentional attention.
> The denunciation of the mouse usually involves invoking concepts such as the “home row”, or the cumbersome migration of the hand between keyboard and mouse. These might all be well and good, if I were a typist and as such all I did was to type. But this isn’t the case, I ponder and perceive, more than I write.
This resonated so much with me :-) I still cannot believe how many people seem to think that the ability to type really fast is important to be a good coder, when we spend the vast majority of our time reading, re-reading and podering code instead of writing it.
When I'm in this state, I'm probably writing pseudo-code fairly close to the real language I'm working in, and not worrying too much about errors I'm not seeing, and just trying to quickly correct the errors I do see, such that I can express my intent on screen. Finding missed typos and other errors is for a second pass and with the help of a compiler/interpreter, for code I write in that manner. It may require some additional passes to tweak things that just don't work, as well, but that's fine. The point was to get what was very clearly in my mind transferred to another medium before something caused a corruption of my mental state.
That's not to say that's the only way I write. I also often devote time to carefully pondering what's on the screen and how to best interact with it to change it in the way I want, or whether there is a better way to do it entirely and that code should be rewritten. But when I'm trying to get what's in my mind onto the screen, little things like auto-indent and being able to accomplish something while keeping my hands doing what they've been doing all add up to help in small ways.
This is how tiny bacteria with flagella operate; they whip their hairs furiously when they want to zoom towards or away from a particular stimulus, but tumble idly in intermediate zones. Having only one mode of operation isn't adaptive.
In that respect it's not whether keyboard binding or mouse context menues are better, it's about providing tools to support both contexts, so the appropriate one can be chosen at the appropriate time.
I have no idea where this notion of "shunning the mouse" came from. The simple fact is that when you're "in the zone", the mouse gets in the way. After having read and re-read other peoples code, and occasionally also having read half a dozen research papers, you are finally ready to dump all the code that has been brewing in your head. At that point, you are a typist. All the for-loops and switch-cases and function calls are jostling around in your head, and you want to serialize them into source code as fast as you can. When you're doing that, forget the mouse even the arrow keys are too far away. All you want is "do what I mean" with "the thing at point". Everything else just disappears outside your region of focus.
So yeah, the mouse is awesome when you're browsing and reading code. But when you're typing code, the home row is the fastest way to get it all out.
EDIT: s/two/too/ far away
On the other hand, I use the mouse a lot while coding and I would say you’re wrong here, for me. I prefer the ability to not have to think about memorized keys when coding.
I go into a state of flow based on what I believe is a combo between visualizing and imagining the code in an object form or something similar, so using a mouse is more natural since I’m still visualizing the mouse menu and the areas I have to click on instead of context switching into the mode where I try to remember keys I often look at the keyboard when typing, too, due to my way of flowing. I personally think it’s because my brain works a bit more visually and my imagination is pretty good, so I am able to map the imaginary code flow in my mind to the text version, so using a mouse to me is like navigating between the two. My mind takes the logic and is able to translate that to mouse movements easily to reach the part of the code I’m thinking about abstractly.
Personally, I’ve tried to be a better typist and tried to use emacs or vim, but I always go back to the way I do things and I’ve just decided my brain works a bit differently than many coders.
To each their own, I say; so do whatever works for you and I’ll keep using my way.
It does both. And much faster than keyboard navigation if you're moving to a text at some distance away from where your cursor currently is. Mouse is literally a pointing device. If you need to go to a point in text 10 lines above your current cursor, moving the cursor there with a mouse is definitely faster than figuring out which of the ten arcane commands will get you there.
There are other shortcuts like Ctrl+Direction to skip chunks of text. Ctrl+Left or Ctrl+Right skips words and symbols, Ctrl+Up and Ctrl+Down, in some of my language configurations, skips to the next starting point of a code block in the same branch.
Movement is very straightforward with the keyboard, and depending on the editor, does not take long to get used to. If the mouse works for you, great. It did for me too, up to a point.
A mouse can afford spacial exploration. Moving text from there to here, style thinking. Versus the keyboard of jump to there, copy text, jump back, paste.
Hard to see either as superior for text. Hard to see how to use the symbolic for spatial data. (Images and such)
But after experimenting with home row mods and (split) keyboards with multiple thumb keys, regular keyboard layout usage just feels terribly inefficient.
While fast typing is not a bad thing it is definitely not necessary skill of good coder. But coding and using the terminal requires frequently using special keys and combinations, which on regular keyboard require constantly moving hands to access hard to reach keys.
Using home row mods (with a special keyboard) the hands are almost resting.
I still look at the keyboard to type. (Glances to ensure focus has not moved... Love emacs' case changing commands for when the caps-lock pressed)
I have thought about learning to touch type - yes, one day.
I have tried clisubg my eyues (that is "closing my eyes") to type....
What is the use, really? I spend so much time thinking about and reflecting on code and so little actually writing it
When I'm writing prose, the speed I can type is the speed I can write. There are no downsides to being a competent touch typist. It's a bit much to say it makes me a better "coder" but there's no question it makes me better at my job.
As a non-native speaker, I looked it up because my intuition didn't align with your statement.
Those who downvoted probably should have done so, too, or explained why they think otherwise.
https://en.wikipedia.org/wiki/Apostrophe#Singular_nouns_endi...
Watching the graphic and motion graphics designers at work, they're dominant hand rarely leaves their mouse, while the other hand hammers at shortcut keys to switch tools. They don't care about the home row, just using the fewest actions to complete a task.
When I'm using a piece software maybe a few times a month, I'm grateful for icons and menus to help me remember how to do anything. When I use a piece of software on a daily basis, then I learn the shortcuts until it's muscle memory, an keep my hand away from the mouse as much as possible.
This is one of the reasons I love the TrackPoint and use it exclusively. There is no physical context switching between mouse and keyboard. If you are a touch typist, it is always right there on the home row.
I am such a TrackPoint nut that on the rare occasions when I've had to work on a computer that is not a ThinkPad (a desktop or a different laptop), I use a ThinkPad wireless keyboard to give it a TrackPoint:
https://www.lenovo.com/us/en/p/accessories-and-software/keyb...
One job I had issued Dell laptops, and I found that I could put the ThinkPad keyboard right on top of the laptop keyboard. It even left the Dell's touchpad accessible. I do use two-finger touchpad scrolling once in a while.
Something I don't like about modern ThinkPad keyboards is that they took away the Menu key and replaced it with a PrtSc (screenshot) key. The Menu key is such a nice way to bring up a context menu based on the current keyboard cursor location (rather than the mouse position). These AutoHotkey rules fix that:
; Remap the PrtSc key:
; PrtSc -> Menu (like an old ThinkPad keyboard)
; Windows+PrtSc -> Screenshot of all monitors
; Windows+Alt+PrtSc -> Screenshot of current window
PrintScreen:: AppsKey
#PrintScreen:: PrintScreen
#!PrintScreen:: Send {Alt Down}{PrintScreen}{Alt Up}
This is for Windows, of course. I imagine there must be a way to do something similar on Linux.Another tip for Windows users: if you have a keyboard with a numeric pad that you don't use much, enable MouseKeys in the Windows accessibility settings. This lets you use the numpad as a "keyboard mouse" for precise mouse movement. Or if you have a ThinkPad keyboard, try my JKLmouse program (another AutoHotkey script) which gives you MouseKeys-style mouse control using the IJKL or HJKL keys (and neighboring keys for diagonal movement). It will work on other laptop keyboards too, but you really want physical mouse buttons like a ThinkPad for it to be useful.
(There is an installer, but I recommend downloading AutoHotkey and the jklmouse.ahk script from GitHub for the most flexibility.)
On the contrary, the simplicity of the styling and layout is honestly beautiful.
It's simply about pointing devices hurting my hand, wrist, and arm.
Keyboard use does not.
Is that so hard to understand?
This is what makes it an accessibility issue for me, not a preference.
For _some_ people, the mouse is easier to use, so increases accessibility for _them_. I think the OP was implying that better mouse accessibility could be added on-top of the existing keyboard support.
But then there's this whole subculture in Unix that basically claims that keyboard should be the only device used for interaction. The software that they make makes it deliberately hard, or outright impossible, to use the mouse. And there's a cult following around this, based solely on the notion that it's somehow better in general.
(A stark example of this approach is https://www.nongnu.org/ratpoison/, where it's readily obvious from the name and the logo.)
I use many different keyboards and pointing devices (not just mice) and the general trend I described holds true.