[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] org-capture quitting and make-capture-frame

From: Tyler Smith
Subject: [O] org-capture quitting and make-capture-frame
Date: Mon, 23 Oct 2017 10:59:37 -0400


I use org-capture with a new frame, so I can call it quickly when from
the OS (see

This works well, except that if I quit a capture, the frame is left
hanging. I looked through the code, and this is due to org-capture
calling `(user-error "Abort")` in response to my entering 'q' to
indicate I want to cancel my capture. 

It would be nice to allow for some configuration here. In my case, I
have replaced this line:

    ((equal entry "q")
            (user-error "Abort"))



    ((equal entry "q")
       (if (equal "capture" (frame-parameter nil 'name))  

That will work for my use case, until org-mode is updated at least.
Would it be possible to do something like this instead:

    ((equal entry "q")
      (funcall org-capture-quite-function))

That would allow you to provide a sensible default, such as '(user-error
"Abort")', while allowing users to tweak this behaviour, as needed for
cleaning up capture frames.

I've pasted the additional functions I'm using below, FYI.



(defun make-capture-frame ()  
  "Create a new frame and run org-capture."  
   (make-frame '((name . "capture") 
                 (width . 120) 
                 (height . 15))))  
  (setq word-wrap 1)
  (setq truncate-lines nil)

(defadvice org-switch-to-buffer-other-window 
  (after supress-window-splitting activate)  
  "Delete the extra window if we're in a capture frame"  
  (if (equal "capture" (frame-parameter nil 'name))  

(defadvice org-capture-destroy 
    (after delete-capture-frame activate)  
  "Advise capture-destroy to close the frame"  
  (if (equal "capture" (frame-parameter nil 'name))  

(defadvice org-capture-finalize 
    (after delete-capture-frame activate)  
  "Advise capture-finalize to close the frame"  
  (if (equal "capture" (frame-parameter nil 'name))  


reply via email to

[Prev in Thread] Current Thread [Next in Thread]