sprig / org-capture-extension

A Chrome and firefox extension facilitating org-capture in emacs
MIT License
538 stars 56 forks source link

Frame visibility on top #46

Closed fleimgruber closed 6 years ago

fleimgruber commented 6 years ago

The Emacs capture frame opens but is hidden by the browser (Firefox) window. I am using macOS so went with the Applescript handler. Is there a way to display the capture frame on top of the other windows? Or switch to the frame directly?

dangom commented 6 years ago

I have the same problem, but I don't think this has to do with org-capture-extension. If I don't (require 'org-protocol), for example, then the Emacs frame will come to the front.

dangom commented 6 years ago

I couldn't work around the issue so I just hacked away with Hammerspoon.

Add the following to your init.lua:

function emacsclientWatcher(appName, eventType, appObject)
  if (eventType == hs.application.watcher.activated) then
    if (appName == "Emacsclient") then
      -- Bring Emacs to Front
      hs.osascript.applescript('tell application "Emacs" to activate')
    end
  end
end
appWatcher = hs.application.watcher.new(emacsclientWatcher)
appWatcher:start()
sprig commented 6 years ago

Nice workaround @dangom, thanks! @fleimgruber Did that work for you? If not, could you be more specific regarding which Applescript handler you are referring to?

fleimgruber commented 6 years ago

I ended up doing the capture in Org mode directly, so did not try this again. Feel free to close if the workaround is good enough for you

sprig commented 6 years ago

Just curious, what do you mean by "directly"?

fleimgruber commented 6 years ago

Sure, I use a variant of https://www.reddit.com/r/emacs/comments/83frxm/reading_managing_annotating_and_highlighting/dvhi9ba/

sprig commented 6 years ago

So basically copy-paste?

fleimgruber commented 6 years ago

Yes, it was the lowest common denominator across reading RSS, emails and browser.