tumashu / org-capture-pop-frame

Pop a new frame, then run org-capture
31 stars 9 forks source link

Handle `q` #4

Closed malb closed 1 year ago

malb commented 6 years ago

I've patched org-capture-pop-frame so it handles q as well, i.e. the frame is also killed in that case:

(condition-case nil
    (funcall orig-fun goto keys)
  ((debug error) (ocpf--delete-frame)))
tumashu commented 6 years ago

sorry, I do not use this package long time ago, suggest a PR :-)

nico202 commented 6 years ago

@malb I've added this to kill the frame, don't know if yours' better

(defun nx/is-pop-frame ()
  (eq (cdr (assoc 'name (frame-parameters)))
        (cdr (assoc 'name ocpf-frame-parameters))))

(defun nx/close-pop-frame-after-capture (&rest r)
  (when (nx/is-pop-frame)
    (delete-frame)))

(advice-add 'org-capture-finalize :after 'nx/close-pop-frame-after-capture)
malb commented 6 years ago

I like yours better as it doesn't require patching, but I couldn't make it work for me (I didn't try very hard, though)

sheijk commented 5 years ago

The code by @nico202 handle the use case where a capture template has been selected and either saved or aborted. But it does not address pressing q. @malb if you provide a complete file/function I can create a PR for it

malb commented 5 years ago

Hi, thanks. The function that works for me is here: https://github.com/malb/emacs.d/blob/197be098ad50d8d7aca4513d63db8705b30017e4/malb.org#L3181-L3215

GreenRecycleBin commented 1 year ago

The functionality proposed in https://github.com/tumashu/org-capture-pop-frame/issues/4#issuecomment-417366277 has been supported since the beginning. That implementation reimplements ocpf--delete-frame and the corresponding :after hook.

GreenRecycleBin commented 1 year ago

I've created https://github.com/tumashu/org-capture-pop-frame/pull/8 based on https://github.com/tumashu/org-capture-pop-frame/issues/4#issuecomment-552093385. Thank you @malb :)

tumashu commented 1 year ago

merged