Skip to content
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

Spotlight bring-to-foreground feature broken in macOS Catalina #91

Closed
srcreigh opened this issue Mar 30, 2020 · 5 comments
Closed

Spotlight bring-to-foreground feature broken in macOS Catalina #91

srcreigh opened this issue Mar 30, 2020 · 5 comments

Comments

@srcreigh
Copy link

srcreigh commented Mar 30, 2020

THANK YOU for your efforts to bring emacs to macOS.

This issue is one of the first issues I ran into when upgrading to Catalina since I rely on emacs so heavily.

Someone named Chris Farber documented this problem + a workaround back in Dec 2019, so I won't rehash everything here. https://spin.atomicobject.com/2019/12/12/fixing-emacs-macos-catalina/

EDIT: I can confirm that following those steps fixed the issue for me. To reproduce:

  1. Install emacs via Homebrew brew cask install emacs this installs Emacs 26.3
  2. Upgrade to macOS Catalina. I am on version 10.15.3
  3. Open emacs via spotlight (Cmd+Space "ema" enter)
  4. Switch to a different window
  5. Fail to switch to emacs via spotlight: Cmd+Space "ema" enter but the focus does not change to Emacs window.
  6. Follow the steps in that post - give Emacs disk access, swap in the right binary, and remove the code signature
  7. Switch to emacs via spotlight: Cmd+Space "ema" enter this time the focus changes to emacs window
@dougharris
Copy link

This solution on the emacs StackExchange has a similar workaround https://emacs.stackexchange.com/a/54383/11315

@truthdoug
Copy link

I was reminded of this again today after installing the latest emacs 28 prerelease. The same steps fixed it.

As of today, I'm running MacOS 10.15.7 and installed GNU Emacs 28.0.92 (build 1, x86_64-apple-darwin18.7.0, NS appkit-1671.60 Version 10.14.6 (Build 18G95)) of 2022-03-13

@caldwell
Copy link
Owner

caldwell commented Apr 5, 2022

I believe this is the same issue as #84

@caldwell caldwell closed this as completed Apr 5, 2022
@dougharris
Copy link

This continues for me with the latest (28.1-1).

With the newly installed version, I start emacs. It loads fine. If I open a file using emacsclient that works fine.

But, if I use spotlight to switch to emacs (as described in the original post on this issue), a new instance of emacs launches.

I tried shuffling the symlinks as descrbied in the emacs.stackexhange.com link above and it doesn't work with this latest version. This works worse than the stock download now. I see the app in my dock but it shows as non-responding and I have to kill it.

@dougharris
Copy link

And it's still here in 28.1-4. If it helps, here's what I see in /Applications/Emacs.app/Contents/MacOS after first launch:

$ ls -l
total 147656
-rwxr-xr-x@ 1 dharris  admin   4085936 May 11 15:52 Emacs*
-rwxr-xr-x@ 1 dharris  admin   7271920 May 11 15:52 Emacs-arm64-11*
-rw-r--r--@ 1 dharris  admin  15866112 May 11 15:52 Emacs-arm64-11.pdmp
-rwxr-xr-x@ 1 dharris  admin   9191280 May 11 15:52 Emacs-x86_64-10_11*
-rw-r--r--@ 1 dharris  admin  15865720 May 11 15:52 Emacs-x86_64-10_11.pdmp
-rwxr-xr-x@ 1 dharris  admin   7427120 May 11 15:52 Emacs-x86_64-10_14*
-rw-r--r--@ 1 dharris  admin  15865960 May 11 15:52 Emacs-x86_64-10_14.pdmp
lrwxr-xr-x  1 dharris  admin        16 May 11 15:52 bin@ -> bin-x86_64-10_11
drwxr-xr-x@ 6 dharris  admin       192 May 11 15:52 bin-arm64-11/
drwxr-xr-x@ 6 dharris  admin       192 May 11 15:52 bin-x86_64-10_11/
drwxr-xr-x@ 6 dharris  admin       192 May 11 15:52 bin-x86_64-10_14/
-rwxr-xr-x@ 1 dharris  admin     11272 May 11 15:52 launch.rs*
drwxr-xr-x@ 8 dharris  admin       256 May 11 15:52 lib-arm64-11/
drwxr-xr-x@ 9 dharris  admin       288 May 11 15:52 lib-x86_64-10_11/
drwxr-xr-x@ 8 dharris  admin       256 May 11 15:52 lib-x86_64-10_14/
lrwxr-xr-x  1 dharris  admin        20 May 11 15:52 libexec@ -> libexec-x86_64-10_11
drwxr-xr-x@ 5 dharris  admin       160 May 11 15:52 libexec-arm64-11/
drwxr-xr-x@ 5 dharris  admin       160 May 11 15:52 libexec-x86_64-10_11/
drwxr-xr-x@ 5 dharris  admin       160 May 11 15:52 libexec-x86_64-10_14/

Note that the symlinks are pointing to the 10_11 and not to 10_14. The aforementioned stackexchange answer still fixes this for me.

The resulting directory listing has these lines changed:

lrwxr-xr-x  1 dharris  admin        18 May 12 09:55 Emacs@ -> Emacs-x86_64-10_14
lrwxr-xr-x  1 dharris  admin        16 May 12 09:55 bin@ -> bin-x86_64-10_14
lrwxr-xr-x  1 dharris  admin        20 May 12 09:55 libexec@ -> libexec-x86_64-10_14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants