From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tyler Smith Subject: org-capture quitting and make-capture-frame Date: Mon, 23 Oct 2017 10:59:37 -0400 Message-ID: <1508770777.115397.1148043056.71AE2BBC@webmail.messagingengine.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49076) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e6eCc-000136-PS for emacs-orgmode@gnu.org; Mon, 23 Oct 2017 10:59:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e6eCZ-0002Uk-Nf for emacs-orgmode@gnu.org; Mon, 23 Oct 2017 10:59:42 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:33823) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e6eCZ-0002Tn-Ad for emacs-orgmode@gnu.org; Mon, 23 Oct 2017 10:59:39 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 6E84C20BF6 for ; Mon, 23 Oct 2017 10:59:37 -0400 (EDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Emacs Org-Mode Help Hi, I use org-capture with a new frame, so I can call it quickly when from the OS (see http://www.windley.com/archives/2010/12/capture_mode_and_emacs.shtml). 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")) (source: http://orgmode.org/cgit.cgi/org-mode.git/tree/lisp/org-capture.el?h=emacs-sync#n632 ) with ((equal entry "q") (if (equal "capture" (frame-parameter nil 'name)) (delete-frame)) 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. Best, Tyler (defun make-capture-frame () "Create a new frame and run org-capture." (interactive) (select-frame-set-input-focus (make-frame '((name . "capture") (width . 120) (height . 15)))) (setq word-wrap 1) (setq truncate-lines nil) (org-capture)) (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)) (delete-other-windows))) (defadvice org-capture-destroy (after delete-capture-frame activate) "Advise capture-destroy to close the frame" (if (equal "capture" (frame-parameter nil 'name)) (delete-frame))) (defadvice org-capture-finalize (after delete-capture-frame activate) "Advise capture-finalize to close the frame" (if (equal "capture" (frame-parameter nil 'name)) (delete-frame))) -- plantarum.ca