reddit / emacs

Emacs 29 will have precision scrolling using pixel-scroll-precision-mode

telotortium · 2022-03-01 23:14
https://www.emacswiki.org/emacs/SmoothScrolling says: > The next release of Emacs, Emacs 29, will come with built-in support for pixel-based scrolling. > > You can enable it using `pixel-scroll-precision-mode`. I hadn't heard of this. Has anyone used this? Are there any performance issues? In my 5-minute testing I haven't noticed any. EDIT: According to [Emacs' etc/NEWS](https://github.com/emacs-mirror/emacs/blob/ca3858563c7ba8ee3caa82fbd2b7c386ea60c0d3/etc/NEWS#L261-L266), this is what the new mode actually improves in comparison to `pixel-scroll-mode`: ``` ** New minor mode 'pixel-scroll-precision-mode'. When enabled, and if your mouse supports it, you can scroll the display up or down at pixel resolution, according to what your mouse wheel reports. Unlike 'pixel-scroll-mode', this mode scrolls the display pixel-by-pixel, as opposed to only animating line-by-line scrolls. ```
the_true_potato · 2022-03-01 23:55
Could we get this now by building from source? I haven't done it before but I would definitely do it for this.
crawsphi · 2022-03-02 00:02
I wonder whether this include horizontal scrolling, or if that is still column based?
[deleted] · 2022-03-02 00:32
I wonder, if I am on my deathbed, will by final thought's be.. "I wish I'd enabled Emacs Precision Scrolling". I'm not sure, but for now I think It's something I can probably live without.
jimehgeek · 2022-03-02 01:02
Yep, it’s been in the master branch for a couple a months now, so any recent nightly builds will have it, or if you just make your own build.
comfrey11 · 2022-03-02 01:03
Yeah, it is great. Smoother on the eyes. Emacs is becoming cool again.
Alan_Shutko · 2022-03-02 01:13
That is one of the features of the Mac port, and I like it a lot.
MoskitoHero · 2022-03-02 01:53
I tried this 3 weeks ago on Manjaro Linux with the AUR package. Scrolling turned out to be much worse - definitely not smooth AT ALL under X11. Did not try Wayland. I did not have time to investigate either, so I just reverted to the basic setting.
0lMon · 2022-03-02 02:13
Does someone know if this includes smooth scrolling over images?
00-11 · 2022-03-02 02:21
I was thinking the same thing. Admittedly out of ignorance. What's the point/advantage/use case? Googling for "precision scrolling" doesn't seem to find any explanation or point to any uses. The hits I get are only about precision-scrolling rodents. What you need/use such a beast for doesn't seem to be mentioned... I see that some here have mentioned that this scrolling is "smoother on the eyes". OK. That's it? I guess it's what I see with a web browser then, instead of Emacs's line-at-a-time scrolling. (Still don't see much utility, but OK, I guess I understand.)
404cn · 2022-03-02 02:25
Yes, I choose to use emacs 29 because of this, and he's writing new GC.
thetemp_ · 2022-03-02 02:45
Didn't know about this. Just enabled it. I'm not sure if I'm getting the full effect, cause it still stops at a line of text, just as before. In other words, it's not giving me the ability to stop at any pixel-row. (Not that I would want to do that anyway.) However, the scrolling itself feels much more smooth. With the mode off, my scrolling feels sluggish and delayed (as it has been). With it on, it feels more comfortable and fluid. Not sure exactly what's going on, but I like it. EDIT: I'm curious what the difference is between this and "pixel-scroll-mode", which has apparently been around since 26.1 but which I never noticed until now.
super-linux-nerd · 2022-03-02 03:02
It's actually pretty cool. It looks really nice and provides enjoyable feedback when scrolling with a touchpad or trackpoint.
dilawar_uchiha · 2022-03-02 03:13
You have to build it with '--with-xinput2'
ares623 · 2022-03-02 03:18
Wait, has Emacs 28 been released already?
J-ky · 2022-03-02 03:23
Really? I have heard of the scrolling feature and built it from source a few times, but the scrolling is even worse than the default one. I guess I missed this flag. Gonna try tonight.
by_wicker · 2022-03-02 03:30
I don't care for me - I know where I told it to scroll to and I don't need it to show me itself getting there. But when I'm showing someone around, it's very confusing when I page around or recenter the display but they of don't know what is going on. I see there's the setting `pixel-scroll-precision-interpolate-page` so `PgUp` `PgDn` give a visual slide too. I'm glad it's there for that. I may try making `C-v`/`M-v` do the visual thing, but I don't think I want it for myself.
telotortium · 2022-03-02 03:32
Yeah, it's mostly to make Emacs act more modern in its scrolling behavior, by allowing you to scroll within lines instead of locked to individual lines. I think the biggest improvement is with trackpad scrolling, where the lack of feedback without this mode is felt more.
telotortium · 2022-03-02 03:33
I've updated the post with a description of how this differs.
CAPSLOCK_BAD · 2022-03-02 03:34
Build with `--with-xinput2`
telotortium · 2022-03-02 03:34
No - this is a feature that isn't even slated for that release.
by_wicker · 2022-03-02 03:35
For me the most obvious is scrolling with a touchpad/trackpoint, where it's smooth, and if you set `pixel-scroll-precision-interpolate-page` it also works for `PgUp`/`PgDn`. I assume it could then be enabled for other movement like recentering or `C-v` etc.. I'm unsure if I'd appreciate it for myself, I suspect not, but very useful for showing people around and having them stand a chance of following you.
CAPSLOCK_BAD · 2022-03-02 03:38
2nd this
telotortium · 2022-03-02 03:38
From my limited testing, it does. However, above the function `pixel-scroll-precision` is currently the following disclaimer: ``` ;; FIXME: This doesn't _always_ work when there's an image above the ;; current line that is taller than the window, and scrolling can ;; sometimes be jumpy in that case. ```
Status-Detective-783 · 2022-03-02 03:39
I can already do smooth scrolling on my macbook/macport GNU emacs 27.2. Contains mac-mouse-wheel minor mode: "Toggle mouse wheel support with smooth scroll (Mac Mouse Wheel mode)." Does this do something that my current system doesn't do? It's nice for relaxed scanning when I want to put my fingers on the trackpad. ("Sometimes I just want to scroll, and that's how I roll.")
gruntbatch · 2022-03-02 03:41
I've been using it on macOS for 1-2 months now, with no noticeable problems. I can't say for sure how it feels on other operating systems, but on macOS, pixel scrolling is standard across all apps, and now Emacs fits right in with everything else.
yoreh · 2022-03-02 03:42
There's a bunch of interesting new features coming in Emacs 29: * support for sqlite3 * new function `pixel-fill-region`: This fills the region to be no wider than a specified pixel width. * faster `image-dired-display-image-mode` and other improvements for the mode * improvements to xwidgets * Emacs will (finally!) distinguish medium and normal weight fonts
RogueToad · 2022-03-02 03:53
As /u/super-linux-nerd mentioned, the best use case is probably fine-grained scrolling input methods like touchpads, since there's a much greater sense of control when the buffer position is exactly moving with my fingers. With per-line scrolling, it's more difficult (or at least feels like it) because you just have to guess how much finger movement is equivalent to a line and it's easy to end up under or over scrolling. This is especially apparent when zoomed in (and therefore tall lines) and you only want to scroll a small amount.
[deleted] · 2022-03-02 04:00
[deleted]
ThockiestBoard · 2022-03-02 04:06
[It appears to be column-based for horizontal scrolling](https://gfycat.com/lamehelplessiberianlynx). GNU Emacs 29.0.50 (build 1, x86_64-apple-darwin21.3.0, NS appkit-2113.30 Version 12.2.1 (Build 21D62)) of 2022-02-28
00-11 · 2022-03-02 04:32
I see, thank you; makes sense. (I hate using a trackpoint/touchpad - I always use a separate keyboard. That's probably part of why I wondered about this.
markasoftware · 2022-03-02 04:57
This will finally solve one of my big emacs pet peeves: Scrolling past large images in AucTeX previews.
markasoftware · 2022-03-02 04:58
Do you know if `pixel-fill-region` will work with LaTeX previews in org mode or AucTeX?
RogueToad · 2022-03-02 05:02
Fair enough!
slinchisl · 2022-03-02 06:14
I've been using it for a couple of weeks; it's pretty great, especially when scrolling over pictures with a mouse or touchpad (as one sometimes does when writing notes in `org-mode`). I haven't noticed any new performance issues (since I believe this just uses XInput 2.4 functionality). [Here is a short demonstration](https://i.imgur.com/H5sOTgx.mp4) of no smooth scrolling (i.e., Emacs's defaults) vs. smooth scrolling in a file with pictures and some LaTeX code
takutekato · 2022-03-02 06:41
In my experience it's still not as smooth as `good-scroll-mode`.
danderzei · 2022-03-02 07:03
I am still waiting for Emacs 28 to be released.
divinedominion · 2022-03-02 09:00
Yeah, this is just the worst: scrolling over large images
rucci99 · 2022-03-02 09:41
And pgtk!
benide · 2022-03-02 14:03
Are you sure it doesn't work with pgtk also?
deagle50 · 2022-03-02 15:31
I've been using this on MacOS for a couple of weeks and it's very smooth, smoother than Jetbrains IDEs at retina resolutions. My main gripe is how the cursor gets dragged with the viewport, it should stay put until the user selects another line.
deagle50 · 2022-03-02 16:08
It's much, much smoother on my M1 Macbook. I'm using d12frosted/emacs-plus/emacs-plus@29 from Homebrew. With 29 you also get native compilation.
WrinklyTidbits · 2022-03-02 16:27
That looks so good! Thank you
Mwakamune · 2022-03-02 17:09
Is there a fixed date ?
tav_stuff · 2022-03-02 17:45
What’s pgtk and why is it good?
Status-Detective-783 · 2022-03-02 18:02
Oh, I see now that my emacs scrolling is not as smooth as my Chrome scrolling. Ok, thanks again!
s-kostyaev · 2022-03-02 18:23
> he's writing new GC. Can you provide link, please? Sounds very interesting
arthurno1 · 2022-03-02 18:56
> pixel-fill-region This one is welcomed.
arthurno1 · 2022-03-02 19:03
No it is not. They talk about the current master, i.e. the branch where main development of new features is happening. 28.1 is in alpha testing, and the master is renamed to 29.050. That is how Emacs is developed in the repository. All new features go into the master, until someone (E.Z) decides it is enough with new features, time to stabilize and create a new release. When he freezes a stable branch, he renames the master to the new version. I can recommend master, it is the bleeding edge, but I have been using it for the several past years, somewhere since Emacs 26, without any bigger issues.
7890yuiop · 2022-03-02 19:06
IIUC the pgtk build provides the "well-behaved GTK+ program" alluded to in the infamous [Buttery Smooth Emacs](http://web.archive.org/web/20181227063018/https://www.facebook.com/notes/daniel-colascione/buttery-smooth-emacs/10155313440066102/). It's good (presumably) if you're using a GTK-based desktop environment, but I guess not relevant otherwise. It might also make a difference whether you're using "Wayland" or not? (Not sure about that -- but it seems to come up in the same conversations.) If you use the Lucid toolkit, or terminal-only, or MacOS, or Windows, then I don't believe pgtk is relevant to you at all.
7890yuiop · 2022-03-02 19:18
No. Emacs releases never have fixed dates -- they are based on testing and bug fixes, which take as long as they take. Once known blockers are resolved, there will be one or more release-candidate builds at which point, should no significant bugs be raised on account of a release-candidate, the release will follow shortly afterwards. E.g. https://lists.gnu.org/archive/html/info-gnu-emacs/2020-08/threads.html (you can subscribe to that mailing list to receive these, of course).
deagle50 · 2022-03-02 19:33
I was amazed how much smoother it was compared to the Mitsuharu version. Highly recommended if you use the trackpad a lot. I use: `brew install d12frosted/emacs-plus/emacs-plus@29 --with-native-comp --with-no-frame-refocus`
Status-Detective-783 · 2022-03-02 19:45
Oh cool I can have it right away, nice! Do I need to configure my init.el? I'm newbie.
deagle50 · 2022-03-02 19:57
I'm also a newbie but I did switch from 28 to 29 recently for the smooth scrolling and I didn't touch my .emacs.d folder. I'd back it up just in case.
Status-Detective-783 · 2022-03-02 20:13
You might also be interested in this! `C-h l` is `M-x view-lossage`, shows your last 300 inputs, which can be helpful to figure out what you just did by accident. You can now increase lossage (as of v28) https://www.reddit.com/r/emacs/comments/t57pld/viewlossage_shows_the_last_300_inputs_this_isnt/
xenodium · 2022-03-02 20:28
oooh, another soul using `--with-no-frame-refocus` other than me :) https://github.com/d12frosted/homebrew-emacs-plus/pull/122
ispinfx · 2022-03-02 23:19
Can we have emacs 29 in 2025?
_viz_ · 2022-03-03 00:59
Po Lu, who works a lot on GUI code, suggests to use the pgtk iff there's a need to i.e., you run Wayland or have a high DPI screen or something. Gtk and Wayland are too limiting for the pgtk port to be as good as the other ones.
_viz_ · 2022-03-03 01:01
It was mentioned casually in an emacs-devel thread. So there isnt a link for you try or anything AFAIK.
[deleted] · 2022-03-03 01:30
I'm four sheets to the wind at the moment but when I sober up, I'm sure your reply will make perfect sense and I'll try it. Thanks for the reply u/by_wickr. We are a despearate bunch... and well said bro!
nnreddit-user · 2022-03-03 02:03
[Mr. Colascione's concept implementation](https://lists.gnu.org/archive/html/emacs-devel/2021-06/msg00175.html) I recently spent a couple days looking into GC. I concluded the perennial yammering for something more modern than the current mark-and-sweep was largely cool factor. No one except the garbage collection nerds would appreciate the speed-up provided by a "moving" collector, one that compacts reclaimed memory chunks currently being appended to free lists. The generational aspect (don't check really old conses on every run) however might be appreciable given how many users futz with GC thresholds to avoid a stop-the-world cycle. My regards to Colascione (pdumper), a guy similar to Corallo, who will occasionally do a fly-by of emacs-devel and raise the IQ of the discourse a couple standard deviations.
yoreh · 2022-03-03 02:08
Yes, it's necessary if you're using Wayland with HIDPI screen. Otherwise Emacs runs under XWayland and everything is horribly blurry. The downside is that xwidgets don't work at all - at least last time I checked. I haven't noticed any other problems, I've been using it for several months now via [deathwish copr](https://copr.fedorainfracloud.org/coprs/deathwish/emacs-pgtk-nativecomp/). The previous GTK version only used the toolkit for toolbars, widget rendering, etc., but the main display code was still calling X API directly.
by_wicker · 2022-03-03 04:01
It made sense in my head anyway ;). As I jump the window around (`C-v`, `M-v`), and recenter (`C-l` & `C-M-l`) I don't use any scroll mode and it just instantly draws the page in the new position. If someone's watching, e.g. I'm showing them files, they can't keep track of where I'm jumping to so they instantly get lost. I find myself saying out loud what move I'm doing to give them a chance of following. This mode makes it visually slide moves, and so the watcher knows where you went to relative to where you started. For *me* I think it's non-functional eye-candy, but possibly harmless, and nice to be able to use for showing others. The default config doesn't seem to activate it for many movements anyway.
s-kostyaev · 2022-03-03 04:15
Could you provide link to this thread?
_viz_ · 2022-03-03 08:58
You're on your own, sorry.
crawsphi · 2022-03-03 19:36
Thanks!
Null-A · 2022-03-04 02:11
>Mac port I installed the railwaycat mac port and I still don't have smooth scrolling, is there an option I need to enable? I did `$ brew install emacs-mac --HEAD --with-native-comp --with-rsvg --with-starter --with-mac-metal`
Alan_Shutko · 2022-03-04 02:13
Not sure, I just installed it with `brew install --cask emacs`
Null-A · 2022-03-04 02:33
Disabled in doom by default, https://github.com/hlissner/doom-emacs/issues/2482
Alan_Shutko · 2022-03-04 02:36
Wow. I wonder what Doom is doing/enabling that makes it so slow. I've never had a problem on my homegrown config. (But I'm sure Doom has enabled a lot of things/packages I haven't.)
dakra · 2022-03-04 15:01
Just because it wasn't clear to me if I should use this feature when I'm still running X or not. Like you said, the official answer is to **not** use it then. From the latest NEWS file: ** Emacs now supports being built with pure GTK. [...] We do not recommend that you use this configuration, unless you are running a window system that's supported by GDK other than X. Running this configuration on X is known to have problems, such as undesirable frame positioning and various issues with keyboard input of sequences such as 'C-;' and 'C-S-u'.