editWithEmacs.spoon icon indicating copy to clipboard operation
editWithEmacs.spoon copied to clipboard

Delete new frame after ending edit.

Open AlessandroW opened this issue 2 years ago • 0 comments

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)))
)

AlessandroW avatar Oct 09 '23 11:10 AlessandroW