editWithEmacs.spoon
editWithEmacs.spoon copied to clipboard
Delete new frame after ending edit.
As the default config creates a new frame
obj.openEditorShellCommand = "emacsclient -e '(hammerspoon-edit-begin)' --create-frame -n" after doing the changes I think it is best to delete the frame again. This change is proposed in the PR.
In Doom Emacs, I tested the configuration, as follows:
;; config.el
(load! "~/.hammerspoon/Spoons/editWithEmacs.spoon/hammerspoon.el")
(after! hammerspoon
(defun hammerspoon-edit-end ()
"Send, via Hammerspoon, contents of buffer back to originating window."
(interactive)
(mark-whole-buffer)
(call-interactively 'kill-ring-save)
(hammerspoon-do (concat "spoon.editWithEmacs:endEditing(False)"))
(delete-frame (selected-frame)))
)