Open pecastro opened 3 years ago
Same happens for me.
How to reproduce: Open emacs however you want.
Then try this:
What does NOT work and fails with above mentioned Error is:
open -a Emacs path/to/a/file.txt
What DOES work, but opens a completely new emacs instance and not a new buffer:
/Applications/Emacs.app/Contents/MacOS/Emacs path/to/a/file.txt
What I'd like to see is, when emacs is already open:
A small workaround AppleScript droplet:
on open (a_document)
tell application "Emacs"
activate
try
open a_document
end try
end tell
end open
on run
tell application "Emacs" to activate
end run
This will open a new window in a new or already the running instance of emacs containing the dropped document.
A small workaround AppleScript droplet:
on open (a_document) tell application "Emacs" activate try open a_document end try end tell end open on run tell application "Emacs" to activate end run
This will open a new window in a new or already the running instance of emacs containing the dropped document.
Couldn't seem to be able to make that work. Created an Automator app based on that script and associated the file type to it and still nothing.
I have no clue about automator. Never used it, or, t.b.h., tried once but found it rather complicated.
Maybe you simply open the Scripteditor, paste the source code in and save it as an App.
I tried it just now and it worked.
Wicked. Made my day! :+1:
The native emacs way of doing this is to M-x server-start
and then use emacsclient
(included in Emacs.app/Contents/MacOS/bin/emacsclient
).
That doesn't help @caldwell and is in no way a fix to the issue.
It's not really a build issue in the first place. If you feel it's an emacs bug, report it the Emacs maintainers with M-x report-emacs-bug
. And yes, it does help, it's how I interact with emacs all day and it works fine…
How do you double-click that second file which you configured to open with Emacs via your Finder ?!
That said my latest install of Emacs (GNU Emacs 27.1 (build 1, x86_64-apple-darwin18.7.0, NS appkit-1671.60 Version 10.14.6 (Build 18G95) of 2020-08-12 in a new Mac macOS Big Sur v11.6.4 doesn't seem to exhibit the same issue anymore.
How do you double-click that second file which you configured to open with Emacs via your Finder ?!
Hmm—that just works for me… Maybe I'm misunderstanding the issue here—the apple script work arounds made me think this was an issue of opening from the terminal and not double clicking documents in Finder. Apologies.
Looking closer at your error, it might actually be the same as #84 (and #94). That actually has a fix in the latest nightly 2022-04-05. Would you mind trying that version and seeing if it fixes this issue, too?
I gave the open
example in order to show how it's not working. The open
, afaik is the same thing Finder does when double clicking.
Would you mind trying that version and seeing if it fixes this issue, too?
It doesn't run on my Mac 10.15.7.
Sigh. I can reproduce that locally. I have no idea why it thinks it needs macOS 12.
I figured it out and have built a new middle of the day nightly. Would it be possible for you to try it?
I tried it. It runs. But the effect is the same. The first file I open with a double click opens a new *GNU Emacs*
window and an additional window with the clicked file. The second file opens nothing new.
When I open Emacs first and then double click a file, I get an additional *GNU Emacs*
window and the additional window with the file. So I have three windows now. For the second file I double click, no window opens.
I'm having trouble duplicating this—when I double click on files associated with Emacs it always opens a new window with a buffer visiting that file (same with open -a Emacs
)
Are you still getting that error from the initial bug report in the console?
Does it make a difference what directory the file you are opening is stored in? ~/Documents
vs ~/Downloads
vs ~/Desktop
vs ~/some-non-apple-create-dir
?
fehler 07:11:58.915808+0200 Finder LaunchedApplication: failed with error -13052 (null){ "ApplicationType"="Foreground", "BundleIdentifierLowerCase"="org.gnu.emacs", "CFBundleExecutablePath"="/Users/shk/Applications/Emacs.app/Contents/MacOS/Emacs", "CFBundleExecutablePathDeviceID"=16777221, "CFBundleExecutablePathINode"=85632700, "CFBundleIdentifier"="org.gnu.Emacs", "CFBundleName"="Emacs", "CFBundlePackageType"="APPL", "CFBundleSignature"="EMAx", "LSASN"=ASN:0x0-0x148f48e:, "LSBundlePath"="/Users/shk/Applications/Emacs.app", "LSBundlePathDeviceID"=16777221, "LSBundlePathINode"=85632672, "LSDisplayName"="Emacs", "LSExecutableFormat"="LSExecutableMachOFormat", "LSLaunchDLabel"="org.gnu.Emacs.40428", "LSLaunchedByLaunchServices"=true, "LSLaunchedWithLaunchD"=true, "LSLaunchEventRecordTime"=916954221476391, "LSLaunchTime"=now-ish 2022/04/06 07:11:58, "LSParentASN"=ASN:0x0-0x33033:, "LSWantsToComeForwardAtRegistrationTimeKey"=true, "pid"=77489 }
It makes no difference where the file is and it makes no difference where Emacs is. Note: I have it in ~/Applications
, not in /Applications
, but that doesn't change anything.
I'm wondering whether or not it could be an option to use AppleScript as the launcher instead of rust?
P.S. I'm willing to help in coding AppleScript. But I need to understand what exactly the launcher does. I don't know rust and so I only understand parts.
Opening the first file via finder works fine, but as soon as I try opening a second file nothing happens. Console log reports