Jump to content
evan

Upgrade macOS catalina and Alfred 4, Alfred couldn't switch the window to emacs

Recommended Posts

Welcome @evan,

 

That’s not enough information for us to debug the issue. Per your description, this seems to be related solely to macOS and not Alfred. What do you mean when you say you “couldn't switch the window to emacs”? What exactly was your setup and what were your steps?

Share this post


Link to post

The same thing happens to me.

 

I have a workflow to open Emacs, it previously working well. But after upgrading to Catalina, it can open the app initially, but I cannot go back to the app while using other apps.

Share this post


Link to post

I have the same problem. I have a workflow that used to launch Emacs if it wasn't open, and switch focus to it if it was open:

 

image.png.636b73a4d08ee6576df320627d8524d8.png

 

This worked on Mojave. On Catalina, the shortcut launches the app if Emacs isn't yet running. But if Emacs is running, the shortcut doesn't do anything.

Edited by patbl

Share this post


Link to post

Could you please test what happens if you try launching Emacs from Finder by double clicking the app? I suspect you won't get focus in this situation either (i.e. a little Emacs / Catalina bug).

 

If so, perhaps instead of a Launch Apps / Files, you could use a Run AppleScript in Alfred with something like:

 

tell applications "Emacs" to activate

 

Share this post


Link to post

I have the same problem with MacVim. MacVim is installed using homebrew but there is no icon/.app in Applications. Therefor you cannot drag MacVim into the Launch Apps object. When adding it manually Alfred tries to launch a new instance of MacVim.

Share this post


Link to post
6 hours ago, Andrew said:

Could you please test what happens if you try launching Emacs from Finder by double clicking the app? I suspect you won't get focus in this situation either (i.e. a little Emacs / Catalina bug).

 

In fact, that works as expected. Clicking it the first time launches Emacs, and clicking it subsequent times switches focus to Emacs.

 

6 hours ago, Andrew said:

If so, perhaps instead of a Launch Apps / Files, you could use a Run AppleScript in Alfred with something like:

 


tell applications "Emacs" to activate

 

 

Thanks, that works! That's good enough for me.

Share this post


Link to post
4 hours ago, Toontje said:

MacVim is installed using homebrew but there is no icon/.app in Applications. Therefor you cannot drag MacVim into the Launch Apps object.

 

There's still a MacVim.app bundle somewhere. On my machine, it's in /usr/local/Cellar/macvim/…. And if Alfred or Spotlight can find it, you can also drag it from their results lists.

Share this post


Link to post

I've noticed that

tell applications "Emacs" to activate

is a bit laggy compared to the normal "Launch Apps / Files" action. Sometimes it takes a couple of seconds to change focus.

Share this post


Link to post
16 hours ago, patbl said:

In fact, that works as expected. Clicking it the first time launches Emacs, and clicking it subsequent times switches focus to Emacs.

 

Is that in Finder (i.e. Finder window in /Applications/, or the Dock?)

Share this post


Link to post

Was still was suffering from the inability to find/raise emacs from Alfred and found this solution:

% cd /Applications/Emacs.app/Contents/MacOS
% mv Emacs Emacs-launcher
% mv Emacs-x86_64-10_14 Emacs
% cd /Applications/Emacs.app/Contents/
% rm -rf _CodeSignature

This worked on my install from https://emacsformacosx.com/ and according to the blog post, should also work emacs installed from brew.

 

Thanks Chris Farber!  -->  https://spin.atomicobject.com/2019/12/12/fixing-emacs-macos-catalina/

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...