-
-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Railwaycat emacs-mac support #10
Comments
Good idea. I think it should be separate formulae named |
@d12frosted I have switched to emacs-mac. Much more responsive. Less crashes. Nicer GUI. It's literally latest GNU Emacs + patches on top. So it is always as-up-to-date as the official repo. It has SVG built-in via WebKit. All you need to do is enable all these features (yes all of them, some packages require texinfo and xm2):
I also suggest updating the osx layer for Spacemacs to disable smooth scrolling in this Emacs fork by default (with an option to opt-in), because it's more like a tech-demo/hack. It probably emulates keyboard scrolling, draws a texture and tries to smoothly insert it. Sure, it "smoothly" scrolls a pixel at a time, but in reality is choppy as hell. ;; GUI Settings for YAMAMOTO Mitsuharu's Mac port of GNU Emacs.
;; https://github.com/railwaycat/homebrew-emacsmacport
(when (and (spacemacs/system-is-mac) (display-graphic-p))
;; Disable pixel-by-pixel scrolling, since it's extremely choppy.
(setq mac-mouse-wheel-smooth-scroll nil)) Instead of using pixel-scrolling, I set up my own smooth scrolling like this (this is the thing most people will want when they mean "smooth" scrolling; because the defaults jump fast as hell, so I understand why they would assume pixel-by-pixel scrolling is an improvement): ;; Keyboard smooth scrolling: Prevent the awkward "snap to re-center" when
;; the text cursor moves off-screen. Instead, only scroll the minimum amount
;; necessary to show the new line. (A number of 101+ disables re-centering.)
(setq scroll-conservatively 101)
;; Optimize mouse wheel scrolling for smooth-scrolling trackpad use.
;; Trackpads send a lot more scroll events than regular mouse wheels,
;; so the scroll amount and acceleration must be tuned to smooth it out.
(setq
;; If the frame contains multiple windows, scroll the one under the cursor
;; instead of the one that currently has keyboard focus.
mouse-wheel-follow-mouse 't
;; Completely disable mouse wheel acceleration to avoid speeding away.
mouse-wheel-progressive-speed nil
;; The most important setting of all! Make each scroll-event move 2 lines at
;; a time (instead of 5 at default). Simply hold down shift to move twice as
;; fast, or hold down control to move 3x as fast. Perfect for trackpads.
mouse-wheel-scroll-amount '(2 ((shift) . 4) ((control) . 6))) |
Oh and that fork also AWESOMELY bug-fixes sRGB rendering of XMP bitmaps, which means that Powerline no longer looks like trash. My config now looks like this: ;; Switch powerline separators to text, since the bitmaps look bad in sRGB.
;; It's possible to disable sRGB, but that makes Emacs colors too bright.
;; (setq powerline-default-separator 'utf-8) ;-) |
There is no reason to ever use the vanilla emacs/emacs-plus. They are garbage compared to railwaycat. He's had a reputation for years as the best port, and it's true. The vanilla one is made by emacsformacosx.com. It's terrible. Don't do yourself a disservice, install Yamamoto's Emacs fork now. |
@SteveJobzniak I am glad for you. Thanks for sharing your thoughts about GNU Emacs vs
Many people (including me) switched to GNU Emacs from
That's great. And the fix was there for a long time. For me powerline separator is even not an issue compared to performance. But as I said - I'll give it a try to see how it runs after switch to Emacs 25. |
@d12frosted The performance of emacs/emacs-plus has lots of random crashes (100% CPU) and brief freezes (for a few seconds) and those are totally gone with emacs-mac. Others have said the same. Railwaycat's changelogs make it seem like he has implemented better polling to avoid freezes. And just disable the silly pixel-by-pixel scrolling (which IS slow as hell and choppy). After that is disabled, I notice only improvements compared to vanilla. I am never going back. In 2015, the offical vanilla maintainer said that he wants to merge railwaycat's work, but nothing came of that so far. |
I don't know anyone except for you saying this. But welp, we are word-comparing different versions of software. And just in case you didn't see it - syl20bnr/spacemacs#4955.
Only after I check it myself I can say anything about latest |
http://emacs.stackexchange.com/a/3952/14218
Just one of many comments I found like that. Reddit was also full of comments like that when I did research. And yeah try it out. Either way, I am running it now and will never go back. So far I haven't had a single freeze or crash anymore. |
Well, I just had a 5 hour session without any hangs, slowdowns or crashes. That's in comparison to the emacs/emacs-plus vanilla version which micro-froze constantly and crashed/perma-froze at 100% CPU about once per hour. On the exact same dotspacemacs file and same develop branch of Spacemacs. |
Well. I am using it for 5 minutes and already run into some lags / slowdowns. I know that it's not the best way to navigate, but sometimes I hold But lets see how it goes with other tasks 😸 |
@d12frosted I opened my init.el (~900 lines) and held down C-n and then C-p for about 2 minutes, not even a single missing cursor or freeze. It just kept going non-stop. Could it be a hardware issue on your machine? A bug that only affects yours? The vanilla Emacs didn't run anywhere near as well as this one does for me. I will keep my eye on it though. |
@d12frosted ;; GUI Settings for YAMAMOTO Mitsuharu's Mac port of GNU Emacs.
;; https://github.com/railwaycat/homebrew-emacsmacport
(when (and (spacemacs/system-is-mac) (display-graphic-p))
;; Disable pixel-by-pixel scrolling, since it's extremely choppy.
(setq mac-mouse-wheel-smooth-scroll nil)) See if that improves your I run with it off because I hate how choppy and syrupy and stuttery it makes mousewheel scrolling (I suspect that hack is using an off-screen buffer which is rendering more lines of the document than just what's on-screen, and then constantly refreshing that buffer every time you scroll a pixel. Perhaps having it on is choppy for keyboard too. It may be affecting the entire rendering of the text-pane, "just in case" the user wants to scroll with the mouse suddenly. |
It's the same with |
@d12frosted Hmm okay. That's weird. I've now spent all day coding in emacs-mac. Not a single crash or slowdown yet. Even the small "stutters" I used to get when using the space-menu are gone. With emacs (the vanilla one via your emacs-plus formula) which I've used for the prior 9 days, I had about one total hang every 1-2 hours with the menus sometimes making Emacs use 100% CPU and not being rescuable with Ctrl-g. All of that was fixed when I changed to Yamamoto's enhanced Mac fork. Before that, I just assumed that Emacs was a buggy, crashy editor due to all the Spacemacs packages. But now it's stable as hell after I switched Emacs port. That really shows how different experiences can be. I have no idea why this one works worse for you but much better for me. Very weird. I am using the latest emacs-mac plus this exact dotfile: You are maintaining the official brew recipe for Spacemacs and may want to research this further for the sake of users, since I noticed people in the chat asking how to stop Spacemacs from freezing. Maybe they are Mac users with the official Emacs too. If you are ever curious to see if my config fixes it, then you can hide your own .spacemacs.d folder, and follow those clone and port install instructions above (ignore my external utilities of course) to see if your machine's results have something to do with your config file. I wouldn't think our physical hardware has any effect on this, so I bet it's the config or the source code size you are looking at. |
@SteveJobzniak I build emacs from source (git HEAD) and I never experience a hang. it's my main editor for everything except java. |
@d12frosted @SteveJobzniak I've tried both emacs vanilla and emacs-mac. The problem of emacs-mac for me is: when you use the native fullscreen on mac and you want to switch using touchpad between different fullscreen apps, say, emacs-mac and safari, there is a significant lag. Vanilla Emacs do not have that problem. |
@SteveJobzniak You're right. The default smooth scrolling in @railwaycat's |
@ninrod I have now used railwaycat's Emacs for a month and have zero hangs. I haven't tried regular Emacs HEAD, maybe that would also have solved the hangs I was having. @fuxialexander Yes railwaycat uses native fullscreen which has an entry/exit animation and disables all input (Apple does) while it animates. But I never use fullscreen. @bassu Yeah it blows my mind why anyone likes the choppy default pixel-scrolling mess in railwaycat, but it's probably because they used regular Emacs scroll before that which scrolls way too fast. Hence why I simply tweaked that regular scrolling to jump less lines at a time, and now it feels great. Glad my tweaks helped you! :-) |
Ok, I have played with What I am going to do is to update Spacemacs installation guide for macOS users with a note about Thanks everyone for a good discussion on this topic. I really appreciate your effort. And thanks for the hints about scrolling (for some reasons I like line-by-line scrolling even if I use touchpad 😸 ). To be honest I am not sure if there is a point in having Just as a history notice, So as you can see, That being said, I am closing this issue. Thanks again everyone for the input and feel free to continue your discussion here. |
In my experience, railwaycat emacs-mac is the best emacs to use in a mac. It has smooth scrolling and touchpad gesture support among other things. It would be awesome if there's an option that would install the railwaycat version instead of the cocoa version.
The text was updated successfully, but these errors were encountered: