mfisher Posted February 14, 2021 Share Posted February 14, 2021 Hi! I install Emacs from Homebrew. For years, Alfred has been able to find it. On the new M1 Macs, the Homebrew (v3) location is in /opt/homebrew. Here's my Emacs.app: % ls -lA /opt/homebrew/Cellar/emacs-plus@28/28.0.50| grep Emacs drwxr-xr-x 3 mfisher staff 96 Feb 14 11:51 Emacs.app Per the recipe instructions, I did: To link the application to default Homebrew App location: ln -s /opt/homebrew/opt/emacs-plus@28/Emacs.app /Applications I added `/opt/homebrew/Cellar` into my Alfred search scope. But when I activate Alfred and type "emacs", Alfred doesn't find it. Alfred v4.3.2 [1220] macOS Version 11.3 Beta (20E5172i) Thanks! Link to comment Share on other sites More sharing options...
vitor Posted February 14, 2021 Share Posted February 14, 2021 I went to take a look and noticed /opt/homebrew-cask/Caskroom is part of the defaults. That no longer makes sense, @Andrew, as anyone with their Caskroom on that location has a really old and unsupported installation which I doubt even works. And I agree /opt/homebrew/Cellar makes sense to add. @mfisher Does Spotlight find that Emacs? Alfred depends on it. Link to comment Share on other sites More sharing options...
Andrew Posted February 15, 2021 Share Posted February 15, 2021 @vitor should /usr/local/Cellar remain, or be removed too? Link to comment Share on other sites More sharing options...
deanishe Posted February 15, 2021 Share Posted February 15, 2021 10 hours ago, vitor said: And I agree /opt/homebrew/Cellar makes sense to add. It’s in /opt, not /usr/local/opt? Link to comment Share on other sites More sharing options...
vitor Posted February 15, 2021 Share Posted February 15, 2021 3 hours ago, Andrew said: should /usr/local/Cellar remain, or be removed too? Remain. That continues to be the default location on Intel processors, the new location is for ARM. Both can be installed at the same time. 2 hours ago, deanishe said: It’s in /opt, not /usr/local/opt? Correct. deanishe and xilopaint 1 1 Link to comment Share on other sites More sharing options...
mfisher Posted February 20, 2021 Author Share Posted February 20, 2021 (edited) On 2/14/2021 at 6:52 PM, vitor said: @mfisher Does Spotlight find that Emacs? Alfred depends on it. @vitor It does not. Are there any clever ways to force indexing on a path? I tried Apple's procedure to rebuild a Spotlight index for /opt. For the time being, I made a workflow to launch Emacs, so I am content again. Thanks! Starting Diagnostics... File: 'Emacs.app' Path: '/Applications' ----------------------------------------------------------- Check file cache database... ✅ File cache integrity is ok ----------------------------------------------------------- Check if file is readable... ✅ Alfred has permissions to read this file. ----------------------------------------------------------- Check if volume '/' is indexed by macOS... ✅ Indexing is enabled on this drive ----------------------------------------------------------- Check direct file metadata... ✅ Direct metadata available Display Name: Emacs.app Other Names: Content Type: com.apple.application-bundle Last Used: 2021-02-14 16:51:11 +0000 ----------------------------------------------------------- Check mdls file metadata... ❌ macOS metadata missing essential items kMDItemFSContentChangeDate = 2021-02-14 16:51:11 +0000 kMDItemFSCreationDate = 2021-01-10 01:11:39 +0000 kMDItemFSCreatorCode = "" kMDItemFSFinderFlags = 0 kMDItemFSHasCustomIcon = 0 kMDItemFSInvisible = 0 kMDItemFSIsExtensionHidden = 0 kMDItemFSIsStationery = 0 kMDItemFSLabel = 0 kMDItemFSName = "Emacs.app" kMDItemFSNodeCount = 1 kMDItemFSOwnerGroupID = 20 kMDItemFSOwnerUserID = 501 kMDItemFSSize = 1 kMDItemFSTypeCode = "" ----------------------------------------------------------- ❌ Troubleshooting failed Edited February 21, 2021 by mfisher Link to comment Share on other sites More sharing options...
deanishe Posted February 20, 2021 Share Posted February 20, 2021 2 hours ago, mfisher said: Are there any clever ways to force indexing on a path? Have you tried mdimport? Link to comment Share on other sites More sharing options...
mfisher Posted February 21, 2021 Author Share Posted February 21, 2021 20 hours ago, deanishe said: Have you tried mdimport? I did: sudo chflags nohidden /opt mdimport /opt The Alfred troubleshooting output didn't change. Thanks! Link to comment Share on other sites More sharing options...
deanishe Posted February 21, 2021 Share Posted February 21, 2021 I'm out of ideas, I'm afraid Link to comment Share on other sites More sharing options...
mfisher Posted February 21, 2021 Author Share Posted February 21, 2021 56 minutes ago, deanishe said: I'm out of ideas, I'm afraid Thanks so much for sharing your ideas! Link to comment Share on other sites More sharing options...
devonzh Posted January 29, 2022 Share Posted January 29, 2022 I found a way to let Alfred open aliases to applications (that is, .app directories). Funny, my use case was also to get Homebrew-installed Emacs to show up. As a result, these instructions are for Emacs, but they should generalize to any .app alias. First, create a macOS alias, not a symlink: In Finder, press Cmd-Shift-g and use Tab auto-complete to enter the path of the directory containing Emacs.app (In my case, it is currently /opt/homebrew/Cellar/emacs-mac/emacs-27.2-mac-8.3) Press Cmd-n to open a new Finder window, then Cmd-Shift-a to go to /Applications Create an alias by Cmd-Option dragging Emacs.app from the homebrew window to the /Applications window. Now, let's make Alfred include macOS aliases in search results: Open Alfred's preferences, navigate to General > Default Results, and under Extras: click Advanced. A popup window will open that allows you to add file types that will be shown in search results. Drag the Emacs.app alias from the Finder /Applications window to the popup window. The new entry should read com.apple.alias-file | alias Close the popup and try searching for emacs. The result list should include the Emacs.app alias. Link to comment Share on other sites More sharing options...
Kent Bull Posted March 24, 2022 Share Posted March 24, 2022 I have this same issue, interestingly enough for accessing Emacs. @devonzh's solution worked for me. Thanks @mfisher! Link to comment Share on other sites More sharing options...
vitor Posted March 31, 2022 Share Posted March 31, 2022 (edited) Just released a Workflow for this: Edited March 31, 2022 by vitor Link to comment Share on other sites More sharing options...
fingon Posted April 11, 2022 Share Posted April 11, 2022 This still continues to be a problem. I'm not sure why even the Finder link is failing for me when I upgraded the app (I recreated the link with correct path, but it is not visible in the search results anymore). I wound up just creating custom workflow with the keyword I want + universal actions I want associated with the homebrew app (Emacs, in this case). This is somewhat unfortunate as this *used* to work fine. Would it be an option just to make some way to use non-spotlight search of specific paths possible or something? I don't really care if Alfred does it once when booting or once per day or something. Link to comment Share on other sites More sharing options...
vitor Posted April 11, 2022 Share Posted April 11, 2022 @fingon Have you seen the post right above yours? It’s a Workflow which addresses this directly. Link to comment Share on other sites More sharing options...
dixonge Posted May 2, 2022 Share Posted May 2, 2022 I'm running into this still. The workflow did not change anything. Neither Spotlight nor Alfred can see the emacs-plus alias in /Applications. It's the only time I've ever run into Alfred not being able to find something. Strange! Link to comment Share on other sites More sharing options...
vitor Posted May 2, 2022 Share Posted May 2, 2022 (edited) @dixonge What are your Workflow Environment Variable in the Workflow? And which tap did you install emacs-plus from? Edited May 2, 2022 by vitor Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now