emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] [feature request] org-capture-window-setup to stop capture windo


From: Alan Schmitt
Subject: Re: [O] [feature request] org-capture-window-setup to stop capture window taking up whole frame
Date: Tue, 09 Jun 2015 11:22:52 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin)

Hello Eric,

On 2015-06-08 17:23, Eric S Fraga <address@hidden> writes:

> as monitors get bigger and bigger, I tend to have lots of (emacs)
> windows in a frame.  No matter how many I have, org-capture takes over
> the whole frame which is kind of wasteful.

How about using several frames? For instance I have the following code
bound globally in my OS:

#+begin_src sh
/usr/local/bin/emacsclient -n -e '(make-orgcapture-frame)'
#+end_src

The function is defined as follows (with some supporting code to delete
the frame when I'm done):

#+begin_src emacs-lisp
(defun make-orgcapture-frame ()  
  "Create a new frame and run org-capture."  
  (interactive)  
  (make-frame '((name . "remember") (width . 80) (height . 16)
                (top . 400) (left . 300)
                (font . 
"-*-Consolas-normal-normal-normal-*-13-*-*-*-m-0-iso10646-1")
                ))
  (select-frame-by-name "remember")
  (delete-other-windows)
  (flet ((switch-to-buffer-other-window (buf) (switch-to-buffer buf)))
    (org-capture nil "t")))

;; delete the frame in that case
(add-hook 'org-capture-after-finalize-hook
          (lambda ()
            (when (equal
                   (cdr (assoc 'name (frame-parameters (selected-frame))))
                   "remember")
              (delete-frame))))
#+end_src

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Weekly CO₂ average (2015-05-30, Mauna Loa Observatory): 403.41 ppm

Attachment: signature.asc
Description: PGP signature


reply via email to

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