From a straight install Emacs won't tile with the rest of the windows, so I figured out that if I run
'yabai -m rule --add app=Emacs manage=on' after starting emacs it will tile with the other windows but I have 2 problems
1. How do I make this change permanent and consistent even after I restart yabai so I don't have to run the command every time
Just put the rule in your yabairc鈥攊t's just an executable shell script after all.
2. Although the Emacs window tiles, it when I navigate around the open windows (alt - h, alt - l) the Emacs window won't get selected, I must use the mouse to highlight it.
Assuming you installed via brew, do you have anything possibly relevant in your log files when doing this? stderr gets redirected to /usr/local/var/log/yabai/yabai.err.log (and similarly replace err with out for stdout). You can monitor this file using tail -f /usr/local/var/log/yabai/yabai.err.log.
An alternative would be to run yabai --verbose instead of the brew service to get a more detailed output, which should print why your windows cannot be selected.
Emacs has always been an issue, sadly.
Emacs has always been an issue, sadly.
Try using emacs-mac from the tap emacsmacport.
It has much more better GUI support than the original, and a few additional features you might appreciate.
All this is due to GNU Emacs's main role being an AXTextField instead of AXWindow mentioned https://github.com/koekeishiya/chunkwm/issues/105#issuecomment-312619814. :-(
Sent with GitHawk
Does Emacs not provide a good CLI alternative to its GUI version?
Assuming you installed via brew, do you have anything possibly relevant in your log files when doing this? stderr gets redirected to
/usr/local/var/log/yabai/yabai.err.log(and similarly replace err with out for stdout). You can monitor this file usingtail -f /usr/local/var/log/yabai/yabai.err.log.An alternative would be to run
yabai --verboseinstead of the brew service to get a more detailed output, which should print why your windows cannot be selected.
There was no log file in /usr/local/var/log/yabai/ and the --verbose didn't show anything unusual that I could notice
Try using emacs-mac from the tap emacsmacport.
It has much more better GUI support than the original, and a few additional features you might appreciate.
this will probably be my solution especially because there have always been some glitchiness with my emacs install with window resizing and what not, I'll give a try tomorrow.
Does _Emacs_ not provide a good CLI alternative to its GUI version?
It has a CLI alternative but I think it lacks things like following links to open files and URLs in orgmode files, which I use pretty heavily. I could be wrong about that though because I've only used CLI on a headless server in a pinch.
@karrot42 I'm using emacs-mac and still have the same problem. The simple fix is to add
(menu-bar-mode t)
to configuration file. Hope it help!
Closing this then.
I added this information to the tips and tricks section of the wiki: https://github.com/koekeishiya/yabai/wiki/Tips-and-tricks#tiling-emacs
I have not tested whether this works as I don't use Emacs myself, but maybe this will help some real programmers (xkcd).
I'm using emacs-mac with menu-bar-mode on. Yabai mostly works, but if I try to do cmd+tab to switch to emacs from another space, it moves emacs into the current space instead of switching. I haven't seen any other app do this.
On macOS I use an emacs config based on doom emacs with emacs-plus installed with these options:
brew install emacs-plus --with-no-titlebar --with-modern-icon --without-spacemacs-icon and this has (menu-bar-mode t) set
I use this rule to contain emacs windows: yabai -m rule --add app=Emacs manage=on space=2
With this setup emacs tiles just fine using yabai and seems well behaved.
@webframp your comment helped me tile emacs but I still can't get it to focus by using commands. I get could not locate a southward managed window. although I set
yabai -m rule --add app=Emacs manage=on
Hi, I have been a user of chunkwm and Emacs tiled just as all other programs. Today I installed yabai because a macOS update bricked my chunkwm installation. And everything works as before except Emacs.
Now i have installed a version of emacs called emacs-plus, which has a --with-no-titlebar option that removes the window decoration. The option (menu-bar-mode t) is stil set in emacs which means that what worked for everybody else have not worked for me.
I have also added a tiling rule for Emacs in .yabairc with no effect.
I digged a little bit and it seems like Emacs will tile when it is launched. It even reacts on resizing regardless which application is in focus. I can swap and move commands but only when Emacs is in focus, not when another application is in focus. The same applies for moving focus. I can use commands to move focus away from Emacs, but not to Emacs.
Below is my Emacs installation
brew tap d12frosted/emacs-plus
brew install emacs-plus --with-no-titlebar
@brorbw
Quoting the wiki... (emphasis mine)
Emacs is not a well-behaved citizen of macOS. Try using → emacs-mac from the Homebrew tap → emacsmacport.
If Emacs is still not recognized by yabai, try enabling menu-bar-mode.
If you're using emacs-plus, you should set up a custom rule for it (which actually creates lots of problems relating to tooltips).
@brorbw can you provide any more info on your emacs config? I use emacs-plus as I mentioned and have no tiling issues with it. It may be worth trying emacs-mac just to eliminate the cause of the issue
I realise that my poor english skills might have come across as unfamiliarity with chunkwm. For that i apologise.
@pcr910303 I appreciate your answer but all of the above mentioned methods does not work for me. I like having the --with-no-titlebar option and i have been using it for age with chunkwm and i have had no problem.
If Emacs is still not recognized by yabai, try enabling menu-bar-mode.
The(menu-bar-mode t)options is set and makes no difference.
I will add that the official Homebrew install of emacs and emacs-plus does not work either.
If you're using emacs-plus, you should set up a custom rule for it (which actually creates lots of problems relating to tooltips).
I had a custom rule for emacs before and i remember having a workaround for tooltips
chunkc tiling::rule --owner Emacs --except "^$" --state tile &
@webframp My emacs config is almost the dev branch of spacemacs with some minor changes.
@pcr910303 I appreciate your answer but all of the above mentioned methods does not work for me. I like having the
--with-no-titlebaroption and i have been using it for age with chunkwm and i have had no problem.
I had a custom rule for emacs before and i remember having a workaround for tooltips
Well, then I don't understand the question, why would you not add a custom rule for Emacs in your yabai init file?
I will add that the official Homebrew install of emacs and emacs-plus does not work either.
Yes, as said, the official emacs and emacs-plus don't work without custom rules.
Try something like this (this doesn't consider tooltips): have checked working on macOS 10.15 Catalina with Emacs built on master.
yabai -m rule --add label=emacs app=Emacs manage=on
Since emacs-plus is mentioned here several times, let me share a special option that should fix the window role:
$ brew install emacs-plus --with-window-role-fix
It's in 'experimental' state. And if it works reliably, I will make it on by default. Using it for several days (with yabai) and can confirm that doesn't require any special rules.
Does it also work with the --no-title-bar option?
Yes, it works with --with-no-titlebar (please make sure that you use the right option 馃樃 ).
Yeah, I just wrote what was on the top of my head. Of course it's --woth-no-titlebar.
Happy new year 馃帀
@pcr910303
Well, then I don't understand the question, why would you not add a custom rule for Emacs in your yabai init file?
For completeness I will answer your question. I tried adding a custom rule for emacs-plus but it simply wouldn't work hence why I kept asking.
That option was merged and is not required anymore. Have fun :)
That option was merged and is not required anymore. Have fun :)
Was it recently merged? Yesterday I still had to add it for brew install.
@picaschaf it was merged just minutes before I posted about it here. Here is relevant commit: https://github.com/d12frosted/homebrew-emacs-plus/commit/0017af1e7710ff833dfb2c061fe56660207ad0b7
I know this is closed, but I still have this issue. I installed the Emacs plus from @d12frosted above, and have the rule, yabai -m rule --add label=emacs app=Emacs manage=on. However, I yabai -m window --focus [direction] skips over Emacs as if it wasn't there. Thankfully, it is tiling, however.
I do not have lable=emacs in my rule and it works fine. Could it be the flavour of emacs? I have installed emacs-plus
That is the same Emacs I am using.
I installed the Emacs plus from @d12frosted above
@TomFaulkner I also use emacs-plus and I don't have any special rules for Emacs. And still it works well with --focus commands. AFAIR, it works regardless of Emacs version, but just for the sake of completeness, I am using Emacs 28. This is how I got my version:
$ brew install emacs-plus --without-spacemacs-icon --with-jansson --HEAD
I was on 26.3, then tried 28 with the --HEAD option, but it couldn't read the Spacemacs (up-to-date develop branch) init.el file for some reason. 27 works and Yabai treats it like other windows now. Thanks for the help.
Most helpful comment
On macOS I use an emacs config based on doom emacs with emacs-plus installed with these options:
brew install emacs-plus --with-no-titlebar --with-modern-icon --without-spacemacs-iconand this has(menu-bar-mode t)setI use this rule to contain emacs windows:
yabai -m rule --add app=Emacs manage=on space=2With this setup emacs tiles just fine using yabai and seems well behaved.