From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marco Wahl Subject: Re: org-capture/remember in Emacs 24.4.1? Date: Mon, 27 Oct 2014 10:27:07 +0100 Message-ID: <84bnoxlv6c.fsf@tm6592.fritz.box> References: <87vbn6p0p1.fsf@jnanam.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59031) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XigaC-0002Iu-Ea for emacs-orgmode@gnu.org; Mon, 27 Oct 2014 05:27:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xiga8-0008GK-14 for emacs-orgmode@gnu.org; Mon, 27 Oct 2014 05:27:24 -0400 Received: from plane.gmane.org ([80.91.229.3]:58743) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xiga7-0008GE-Qc for emacs-orgmode@gnu.org; Mon, 27 Oct 2014 05:27:19 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Xiga5-0005mG-Uy for emacs-orgmode@gnu.org; Mon, 27 Oct 2014 10:27:17 +0100 Received: from stgt-5f72bd1e.pool.mediaways.net ([95.114.189.30]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 27 Oct 2014 10:27:17 +0100 Received: from marcowahlsoft by stgt-5f72bd1e.pool.mediaways.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 27 Oct 2014 10:27:17 +0100 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi Benjamin, Benjamin Slade writes: > I had the following snippets in my .emacs which allowed me to call up a > mini-emacsclient frame to quickly add notes and TODOs etc. It doesn't > seem to work anymore (it comes up, but as soon as I choose [t], [n] > etc. it disappears). Is there an updated recommendation on how to do > this? > > ################################### > (defcustom remember-frame-alist nil > "Additional frame parameters for dedicated remember frame." > :type 'alist > :group 'remember) > > (defadvice remember (around remember-frame-parameters activate) > "Set some frame parameters for the remember frame." > (let ((default-frame-alist (append remember-frame-alist default-frame-alist))) > ad-do-it)) > > ;;; > > (defun make-remember-frame () > "turn the current frame into a small popup frame for remember mode; > this is meant to be called with > emacsclient -c -e '(make-remember-frame)'" > (modify-frame-parameters nil > '( (name . "*Remember*") ;; must be same as in mode-hook below > (width . 80) > (height . 20) > (vertical-scroll-bars . nil) > (menu-bar-lines . nil) > (tool-bar-lines . nil))) > (set-frame-parameter (selected-frame) 'alpha '(85 50)) > (org-capture) > (when (fboundp 'x-focus-frame) (x-focus-frame nil)) ;; X only.... > (delete-other-windows) > ) > > ;; when we're in such a remember-frame, close it when done. (doesn't work when cancelled...) > (add-hook 'org-capture-mode-hook > (lambda() > (define-key org-capture-mode-map (kbd "C-c C-c") > '(lambda()(interactive) > (let ((capture-frame-p > (string= (frame-parameter nil 'name) "*Remember*"))) > (when capture-frame-p (make-frame-invisible)) ;; hide quickly > (org-capture-finalize) > (when capture-frame-p (delete-frame))))))) > > > (setq org-capture-templates > '(("t" "Todo" entry (file+headline "~/Documents/Org/ToDo.org" "Captured Tasks") > "* TODO %?\n %i\n %a") > ("n" "Notes" entry (file+headline "~/Documents/Org/Notes.org" "Captured Notes") > "* %?\nEntered on %U\n %i\n %a") > ("m" "Meetings" entry (file "~/Documents/Org/Meetings.org" ) > "* %?\n %i\n %a") > ("c" "Clipboard" entry (file+headline "~/Documents/Org/Notes.org" "Captured Notes") > "* %x %?\nEntered on %U\n %i\n %a"))) Your code works for me (Emacs 25 with a current Org from the git repo). Just guessing: Do you have installed a further hook for deleting frames in certain situations which might be the wrongdoer? HTH, Marco -- http://www.wahlzone.de GPG: 0x0A3AE6F2