reddit / emacs

How do you click at the pointer?

Rapiz · 2022-08-23 12:05
I read that it's better to not leave the keyboard with emacs, so how do you click?
BobKoss · 2022-08-23 12:17
What is it that you need to click? I probably spend 99.99% of my emacs time with my fingers on the home keys.
Rapiz · 2022-08-23 12:32
I just need to click at where the pointer is, isn't there already a C- M- key combination to just click? I can literally search by C-s but it seems like we are supposed to bind Mouse1 because it's not predefined. Currently I'm in the documentation of the Python stuff and want to click More, but it feels wrong to use the mouse 😁 I want to set a conda venv as interpreter to compile python code.
ruscaire · 2022-08-23 12:40
Depends on the mode. Typically you’ll have a mapping from ‘click’ to a function that is also aliased with a regular keystroke combination. ‘C-h’ is a good place to start to find what actions are bound for a particular buffer.
[deleted] · 2022-08-23 12:51
[deleted]
artyhedgehog · 2022-08-23 12:55
Within org-mode or markdown "click on the link under cursor" is "C-c C-o". Probably in some other modes as well. Unfortunately it's separate commands for each mode.
jaw0 · 2022-08-23 14:11
if you need to click, just click. pay no attention to people telling you not to use your mouse.
ieure · 2022-08-23 15:44
Inside Emacs, you don't need to click much. But some things are easier that way, and there are non-Emacs programs that sometimes need to get used. If you have a laptop with a TrackPoint, those are great. You can move the pointer and click without taking your hands off home row. There are also a few external keyboards with solutions for moving the pointer. Another option is a keyboard that can run QMK, which you can configure "mouse keys" on — keys on the keyboard which move the pointer and send pointer click events. My order of preference is TrackPoint > mouse keys > moving my arm to a pointing device.
Rapiz · 2022-08-23 16:02
Would be great if the developers would set C-c C-o for every mode by default.
khleedril · 2022-08-23 17:08
`M-space` is what you use to mark the start of a region, if that's what you're asking.
00-11 · 2022-08-23 17:19
This'll get you started: (defun set-point-at-pointer () "Set point where mouse pointer is now." (interactive) (let (pos) (track-mouse (while (progn (setq event (read-event)) (or (mouse-movement-p event) (memq (car-safe event) '(switch-frame select-window)))) (unless (or (memq (car-safe event) '(switch-frame select-window)) (not (integer-or-marker-p (setq pos (posn-point (event-end event)))))) (goto-char pos)))))) (global-set-key "\C-o" 'set-point-at-pointer) ; Or another key.
Gangsir · 2022-08-23 17:28
>I read that it's better to not leave the keyboard with emacs Emacs is a tool, but even better than a typical tool - it has no "correct" way to use it (unlike a drill or saw). That advice gets parroted around mainly because yes, people who have experience navigating emacs with pure keyboard will be faster doing that than using their mouse - but the trick is, if you don't have that practice, it'll actually be slower than mouse use, as you try to remember the keybind you need to do what you want. If you need to click, and it's faster for you to just move your hand to your mouse and click than to try and figure out what the keybinding is, then you should just move your hand to the mouse. I'm a pure keyboard user, mainly because I use emacs most of the time on a laptop, so having a mouse is a pain - thus, if I need to learn something new, I look for the keyboard way to do it.
Rapiz · 2022-08-23 17:31
No no, if you open Emacs for example, there is \*GNU EMACS\* and there are clickable links, so usually we leftclick this stuff. So my question is basically how to leftclick by keyboard. How to leftclick without the mouse by a command like C-s for searching. Just C-key or M-key -> Leftclick
vaxdar · 2022-08-23 17:51
Just use the mouse. Don't follow "rules" from random strangers that don't make sense to you.
robotreader · 2022-08-23 18:15
enter key
xtifr · 2022-08-23 20:02
The advice you've been given is very silly! It's *perfectly* fine to use the mouse, *and* the arrow keys, and any other input tools you might have to hand! Some people like to pretend that being "old-school" somehow makes them superior to "the mundanes", but as someone who actually *is* old-school, and remembers when Emacs didn't *have* mouse support, I have nothing but contempt for these people! Mice are great! Yes, it's *also* nice to learn a lot of keyboard bindings, but that doesn't mean the mouse is inferior. It has *different* strengths! One thing that *is* good to learn is how to get back to the home row quickly. (And not just for Emacs--this is useful for all *sorts* of programs.) If you look at the 'f' and 'j' keys, you'll see they have little ridges on them which makes it easy to find them by feel. With just a little practice, you should lose all fear of moving your hands away from the home keys.
BigRiverBlues · 2022-08-23 21:51
Good question. Someone gave an org mode answer. In lots of other modes "Enter" will follow a link
alessandrobertulli · 2022-08-24 08:53
I wonder if simply binding `Mouse-1` to a key would do the trick
yigitemres · 2022-08-24 12:57
[`ace-link`](https://github.com/abo-abo/ace-link) is what you need.