-
Notifications
You must be signed in to change notification settings - Fork 127
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
emacsclient not functioning correctly #52
Comments
It's a known issue that multi-tty not supported in mac port. As developers words
|
@railwaycat can you clarify here? I'm confused because a vanilla build for OS X does seem to allow this functionality - I've confirmed that I can have a GUI frame and a tty attachment open to the very same Emacs process. @jdtsmith have you had any success getting this to work? |
I'm also interested in this. |
@railwaycat I am also confused as to why this is an issue at all. Why does the Mac Port not include functionality from the more basic GNUStep port? In other words, it works in vanilla Emacs just fine; why not on the Mac Port? |
@ylluminarious Because Mac port and Nextstep/GNUStep port are different implementations, they does not share (most of) the code base. As I know there are people working on merging these two ports, but so far they are still separated. For questions about technical details, I suggest you get answer from the developer: [email protected] |
In case anyone is interested, emacs-plus solves this issue for me. I can |
Yes, but emacs-plus doesn't have all the nice features that bring people to this port (tab handling and tab-overview, swipe to change buffers, smooth scroll, etc.). |
Ahh, I wasn't really aware of which features come with each of the many available emacs versions for Mac. Working well with the WM and having the server work as expected with a variety of clients in either gui or tty are the only things I really care about (trying to match my Linux setup with i3). Hopefully, when others stumble upon this they can decide which features they prefer and have a potential solution. Who knows if this ever gets fixed I might give this a try! |
I forgot that I wrote an article about this some months ago, documenting how I fixed this issue. Perhaps it will fix this problem for others too. |
Thanks @ylluminarious, tried it and your patches fix the multiple TTY support for me, but I'm still SOL on the GUI client. Without that, I'm still stuck with Btw, for anyone wanting to try this, it's easy to add to the formula with:
|
Excellent thanks @ylluminarious! @aiguofer I edited the brew as you suggested and it works well. The referenced bug is definitely present though: I'm allowed to close the last GUI window, and when I do, it immediately hangs with a beachball. The original emacs process and TTY window is just fine, though, so I can save work. But I can't create new GUI windows, and must Force-Quit the hung GUI process. Is this the behavior that the daemon you mentions solves? |
@aiguofer @jdtsmith Yes, sorry about that. The way I've worked around this issue is by using the mac-pseudo-daemon package which I mentioned in the article. |
This works for me! Command-Q doesn't quit but I can use the menu or dock icon. Thanks! |
@jdtsmith Perhaps you can bind Cmd-Q to |
@ylluminarious I explicitly don't do that because I use option for Meta, and Cmd is right next door, and Meta-Q is refill paragraph, so called very often... I should just learn to leave Emacs running with a hidden frame and not worry about it. BTW, another awesome feature of emacs-mac is its tab support. I use ;; If in a tab in this (mac) window, don't prompt for frame jump
(advice-add 'ido-visit-buffer :around
(lambda (func buffer method &rest args)
(when (eq method 'maybe-frame)
(if (bufferp buffer)
(setq buffer (buffer-name buffer)))
(let* ((frames (mac-frame-tab-group-property nil :frames))
(win (ido-buffer-window-other-frame buffer))
(frame (window-frame win)))
(if (memq frame frames)
(setq method 'raise-frame))))
(apply func buffer method args))
'((name . "ido-raise-tab-unprompted"))) |
@jdtsmith Ah, I see. Got it. No worries, everyone has their own preferences. Personally I don't bind Cmd-Q to Also you're right about tabs being a nifty feature. I don't use them enough. Your little snippet there might help me to start using them more often. Thanks! |
@ylluminarious your fix only solved multiple terminal frames but not the "--create-frame" bug, right? Not even starting GUI emacs -> "server-start" -> close GUI frame -> emacsclient -c works. Any idea how to work around this? |
@Cumol I have no problems with |
I have compiled emacs on Catalina but I am unable to start emacs in a GUI mode. |
@hisnawi it is probably unrelated. I suspect that you are trying to use the in-built emacs and not the one installed by homebrew. If you have linked emacs to your application folder, you can try to run that directly or use the executable in the package contents in the terminal. Probably something like this: |
@Cumol Thanks for your response. I used this to install: |
Try running emacs through the |
I reinstalled it and now it works fine. Thanks. |
暂时保存可能问题的解决方案,看后续需求再决定。 railwaycat/homebrew-emacsmacport#52 解决mac下的emacs-mac包 lacks multi-tty support 的问题.
@ylluminarious You patch was recently merged to the formula in this repo so I tried it out. I am able to open X/tty frames using |
@ywwry66 Sorry for the delayed response. I never run |
Could I check that this is still not working even with multi-tty support when running |
It does not work even with the patch. If you do not use |
I installed emacs-mac like "brew install emacs-mac --formula --with-native-comp --with-no-title-bars". "emacsclient -t" opens in terminal but "emacsclient -c" also opens in terminal. my Emacs.app is in /opt/homebrew/opt/emacs-mac/Emacs.app/contents/MacOs/Emacs. I created a symlink to Application folder. What should I do to fix this issue? |
For anyone interested, I am using macOS Sonoma with Emacs 29.3. From the macOS terminal shell, I am able to launch the Emacs daemon and then start Emacs GUI or text-based clients. I described the problem and the solution and wrote shell scripts that can be used to start Emacs in various ways (including starting the daemon if it's not already running). You can find the information here: https://github.com/pierre-rouleau/pel/blob/master/doc/emacs-daemon.rst.txt |
@pierre-rouleau Your doc seems to refer to https://emacsformacosx.com/ and not this repo (emacs-mac), did I miss something? |
@vleonbonnet I should have mentionned it in my message; I'm not using emacs-mac based Emacs. But I noticed that I needed to run a graphics-capable emacs as the daemon if I wanted to be able to open a client in graphics mode or text mode. That might also be the case here. |
I have linked:
The command:
(or --tty or -nw) should open a frame in the current tty. Instead, if
Emacs.app
is open and the server is running, it opens a new frame in the GUI, whether or not -t is passed. If, on the other hand,emacsclient
is invoked first (running emacs in--daemon
mode), as:(which in the background launches
/Applications/Emacs.app/Contents/MacOS/Emacs --daemon=^J5,6^J
) further calls toemacsclient
to open a GUI frame do not function:(opens a tty frame)
(hangs, no window opens)
It also seems to be impossible to have
emacsclient
openEmacs.app
if the latter is not already running. I have had this setup (usingemacsclient
to go back and forth between GUI and TTY frames) working with vanilla CarbonEmacs.app
(but it's been some time).The text was updated successfully, but these errors were encountered: