reddit / emacs

The cursor always on screen is the biggest obstacle for me.

amasunbey · 2022-12-06 23:13
As a newcomer here I just wanted to share my point of view for the community and any maintainers. Emacs has already expanded my mind and I'm beginning to grok the power of having a Lisp system at my fingertips. Now I can get through the more research-intensive install (on macOS at least) to find the best build and install flags. And I can get through learning and customizing any historical quirks of software going on 50 years strong.. But one big obstacle to me, which isn't customizable, is that the cursor is always in view. Even in the GUI there is this trait which makes it feel like a terminal application (which it did start as). It fundamentally changes how one selects and navigates text (select text, scroll back up and select region disappears). In a world where every other GUI app doesn't behave this way, it is a big change. It feels like a constraint. This will force me deeper into keyboard centric navigation which is fine. I just think cursor flexibility should not be overlooked and for younger people who are switching from other editors and have used the mouse their whole lives, I can see it hurting adoption. This is probably very hard to implement, going against how it has always worked, but I think that would be good to at least have an option to let cursor scroll off screen. Let me know what you think. Kinda related: does anyone know of a package that makes the select region wrap around words instead of going edge to edge on screen?
emax-gomax · 2022-12-06 23:44
I don't see this as a massive issue. If you want to select something outside of the view of your current buffer and then paste it where you are either save a mark before you move (when using a vim like workflow) or create a split. I normally do the latter. Even if you could achieve this I question what you want to do with it that the current workflow cannot support.
7890yuiop · 2022-12-06 23:55
> does anyone know of a package that makes the select region wrap around words instead of going edge to edge on screen? Which version of Emacs are you using? 27.1 added a face attribute which controls this: ** New face attribute ':extend' to control face extension at EOL. The new face attribute ':extend' controls whether to use the face for displaying the empty space beyond end of line (EOL) till the edge of the window. By default, this attribute is non-nil only for a small number of faces, notably, 'region'; any other face that crosses end of line will not affect the display of the empty space at EOL. This is to make Emacs behave more like other GUI applications with respect to displaying faces that cross line boundaries. This attribute behaves specially when theme definitions are applied: if the theme doesn't specify an explicit value of this attribute for a face, the value from the original face definition is inherited. Consequently, a theme generally shouldn't specify this attribute unless it has a good reason to do so.
amasunbey · 2022-12-07 00:01
Not massive issue. I'll become accustom to the new workflow. But having the GUI be more accessible and in my view more flexible can't hurt.
amasunbey · 2022-12-07 00:07
>extend Thanks a ton! Works with `(set-face-attribute 'region nil :extend nil)`
ergonaught · 2022-12-07 00:35
"In a world where every other GUI app doesn't behave this way" Apparently I do not understand what you mean. I tried 3 other GUI apps that involve some form of text editing and every single one of them displayed the cursor. I'd go psychotic if they didn't.
amasunbey · 2022-12-07 00:38
I didn't explain it perfectly. In relation to scrolling.. when you scroll, the cursor always follows. In everything else, a cursor stays put and will go off screen when scrolling.
jmite · 2022-12-07 01:09
In emacs, cursor is always on screen. Scrolling can move the cursor. In every other editior the cursor has a fixed location in the file, and you can scroll away from it. Then typing jumps you back to the cursor.
mnp · 2022-12-07 01:42
> does anyone know of a package that makes the select region wrap around words instead of going edge to edge on screen? Region is not limited to lines. You set the mark anywhere you want, even in the middle of a line, with `Ctrl-space`, then move point (cursor) anywhere else. That's a region.
oantolin · 2022-12-07 03:37
Maybe I've been using Emacs for too long, but is there any use to being able to scroll without moving the cursor? What workflow takes advantage of that?
_viz_ · 2022-12-07 04:05
Dmitry Gutov gave one of the most compelling reasons for this when a patch to do what OP wants was posted to emacs-devel: it lets one scroll to anywhere they want to read quickly and start typing again to immediately jump back to where they were. I would rather type C-u C-SPC and call it a day as this cursor not on screen is a nuisance.
_viz_ · 2022-12-07 04:06
Do you even need to save your mark? I thought scrolling already pushed a mark for you.
Bodertz · 2022-12-07 04:47
I could probably find it if I looked for it, but do you happen to have a link to that thread/message handy?
_viz_ · 2022-12-07 05:51
No, sorry.
cat-head · 2022-12-07 06:00
I'd be interested in hearing from the devs whether this is a to difficult to implement feature. I agree with you that this is the expected behavior.
_viz_ · 2022-12-07 06:22
There was a thread on emacs-devel about this and there were definitely a lot of little things to consider so definitely not easy to implement.
emax-gomax · 2022-12-07 08:27
Maybe wuth regular emacs but u use evil.
TheKrister2 · 2022-12-07 09:35
Ah, yes. I agree, that *is* rather annoying.
Lucius_Martius · 2022-12-07 09:48
I used this constantly when I was still using kate and kdevelop. It's a valid use-case in my opinion and I still miss it today on emacs. My mind just doesn't parse marks well, same as other "invisible" things like modal editing (even if there's a small indicator somewhere in the UI). If I want to scroll the view, it's hard for me to remember that I have to set a mark in advance that I can return to later. And when I'm done scrolling, it's hard for me to remember whether I actually remembered to set a mark or not (or if the mark is stale and leaves me somewhere else entirely). What works with my brain is point staying where I left it and any movement or input returning me to where it is. It seems obvious to me that that is just the lowest mental load solution to this use-case. This leaves me with my current workflow of just quick-searching (ctrlf) from a->b and back from b->a again. Far from ideal.
artlogic · 2022-12-07 16:15
It's funny, I remember this annoying me years ago, but something like 10 years into using emacs and I had to think hard to recall being annoyed and to even understand what OP meant. I know it's little comfort now, but the emacs workflow will eventually make this a non-issue. At least that's how I've felt. That said, I do agree this is rather jarring when you first start out. I wonder what it would take to change this and what it would break?
thoomfish · 2022-12-07 18:49
I've been grumbling about this since the 1990's, so I hope it's difficult to implement.
Bodertz · 2022-12-07 21:44
>This leaves me with my current workflow of just quick-searching (ctrlf) from a->b and back from b->a again. Far from ideal. Isearch creates a mark for you, so that may be able to help with the b->a part. Just do `C-g` during the Isearch to jump back.
Bodertz · 2022-12-07 22:12
https://lists.gnu.org/archive/html/emacs-devel/2021-11/msg02084.html It looks like this is the message you were referring to.
adelrune · 2022-12-08 00:55
I felt the same way when I switched to emacs some years ago. I still miss the behaviour you are describing but the gradual move to keyboard-centric operation of emacs made it less painful.
Aminumbra · 2022-12-08 06:59
You might already know this, and still find it insufficient/cumbersome, but: - If you cancel an ongoing isearch session with C-g, you go back to where your search started. This means that if you just want to peek at something, you can start isearch, start typing, press C-s repeatedly to move where you want, read, and cancel with C-g to pop where you were initially. - If you need to do a bit more reading/writing somewhere else, note that isearch also automatically sets a mark where the search started. You can start isearch, move somewhere, press RET to validate, start editing/scrolling, and press C-u C-SPC to come back. - You can also scroll /without ever leaving isearch/, if you set `isearch-allow-scroll` to `t` or to `unlimited`. Of course, you can also decide which commands count as scrolling and do not cancel the isearch session. Therefore, you can start isearch, find a match, scroll around with "nice" commands and press C-g to immediately cancel and come back when you want. - Note that some options, such as `scroll-preserve-screen-position`, make it (at least for me) easier to scroll and come back, because the cursor won't "move on screen" when scrolling (which means that regardless of where the cursor is, if I press C-v C-v M-v M-v, it comes back exactly to where it was, and does not jump to the beginning/end of the window) - If you end up doing "many edits" before coming back to where you started, you will need to repeatedly pop the mark to jump back. As it often feels slow to press "C-u C-SPC C-u C-SPC ...", you can set `set-mark-command-repeat-pop` to `t` so that you only need to use the prefix argument once, and subsequent invocations of the command will continue to pop the mark (rather than setting a new one). I know that it takes a while to get used to, but remarks like "it's hard for me to remember that I have to set a mark in advance that I can return to later" are often a sign of something wrong elsewhere. That is: most commands that would make such a thing a problem *do* set a mark for you (isearch, `beginning/end-of-buffer` ...), and the ones who don't are either dealt with in another way (*e.g.* for `scroll-up/down-command`, with the aforementioned `scroll-preserve-screen-position` variable) or simply bad (scrolling for a non-negligible time with the mouse).
deafpolygon · 2022-12-11 00:43
I'm new to this- what's the difference between this, and using 'v' (visual mode) in Evil mode?
mnp · 2022-12-11 03:57
Sorry, don't use Evil mode, but [here's the manual on regions](https://www.gnu.org/software/emacs/manual/html_node/emacs/Setting-Mark.html) You can also jump into the built-in tutorial (default key is `Ctrl-h t`) and search forward in that buffer for "mark". Or just read from the beginning.