I have a weird problem. When I launch emacs GUI by double clicking the icon, or using open -a emacs in the terminal, or calling the application from alfred/spotlight it takes 4-8 seconds to launch. But when I launch GUI emacs from the terminal by calling /Applications/Emacs.app/Contents/MacOS/emacs it starts in about 1 second or a bit less. I haven't noticed this discrepancy before and I think it must be related to the way I'm building emacs but I can't see how.

So why would emacs start more quickly when calling /Applications/Emacs.app/Contents/MacOS/emacs than it does when calling /Applications/Emacs.app?

I'm running emacs 27.0.5, but the same problem occurs with emacs 26.2.

I'm on macOS running Mojave 10.14.5. The build config is:

./configure \
    --build=x86_64-apple-darwin \
    --without-dbus \
    --with-ns \
    --with-imagemagick \
    --with-modules \
    --with-gnutls \
    --with-json \
    --disable-silent-rules \ 

make install
mv nextstep/Emacs.app /Applications 
  • This sounds like a MacOS problem to me: maybe something in the layers between clicking the button and running the program has slowed down. Once running, does emacs behave "normally"? Disclaimer: I know nothing about MacOS. – NickD Jul 19 '19 at 14:58
  • Yeah - it could definitely be a macOS issue. But I don’t have any idea of why the application bundle would be slower to launch than the executable all of a sudden. Especially since i don’t think I’ve made any system updates recently. – mclear Jul 19 '19 at 15:15
  • I keep a copy of Emacs from emacsformacosx.com for troubleshooting, but do not use it for my daily workflow. E.g., whenever I want to know how Emacs behaves without any user configuration, I break out the above-mentioned copy to do my testing. I would suggest downloading a copy and trying it to see if something in your build is at issue, or whether it affects other builds of Emacs too. If the same problem is present with the build mentioned in this comment, then it is probably time to M-x report-emacs-bug. – lawlist Jul 20 '19 at 15:26
  • Thanks @lawlist -- that was a good idea. the standard build of 26.2 from emacsformacosx doesn't show the delay. I've compared this with my builds of 26.2, 26.2.9, and 27, which all are slow to start when the app bundle rather than the exec is called, so it must be something fishy with my build. If you have any ideas as to how to track down that problem they'd be much appreciated! – mclear Jul 20 '19 at 17:19
  • The next step might be to build a stripped down version of Emacs and see if the problem is present with that barebones installation. If the problem is not present with a barebones installation, then begin adding stuff one by one and build, test, repeat, ... When building Emacs, it will automatically install stuff available in your $PATH -- e.g., certain image support, makeinfo, etc. Thus, it may be necessary to explicitly exclude certain components in the ./config ... command line. After the ./config is finished, look at the options Emacs intends to install as a helpful guide. – lawlist Jul 20 '19 at 18:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.