emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Lluís <xscript@gmx.net>
To: emacs-orgmode@gnu.org
Subject: org-capture-other-frame
Date: Mon, 02 May 2011 20:07:41 +0200	[thread overview]
Message-ID: <877ha9nfgy.fsf@ginnungagap.bsc.es> (raw)

I've made a little function to launch org-capture on another frame,
which is very handy when plugged into a hotkey and working with other
applications.

It lacks some settings that I already have active system wide (like no
scrollbars, no toolbar and the like), so you should probably tune those
(a defcustom for the frame parameters should suffice).

In any case, tell me (directly, as I'm not not subscribed) if you're
going to install this into org-mode. Otherwise I'll upload the snippet
into emacs wiki:

#+begin_src lisp
(defun my-org-capture-other-frame ()
  "Create a new frame and run org-capture."
  (interactive)
  (make-frame '((name . "Org-Capture")
                (width  . 120)
                (height .  20)
                (menu-bar-lines . 0)
                (tool-bar-lines . 0)
                (auto-lower . nil)
                (auto-raise . t)))
  (select-frame-by-name "Org-Capture")
  (if (condition-case nil
          (progn (org-capture) t)
        (error nil))
      (delete-other-windows)
    (my-org-capture-other-frame-cleanup)))

(defun my-org-capture-other-frame-cleanup ()
  "Close the Org-Capture frame."
  (if (equal "Org-Capture" (frame-parameter nil 'name))
      (delete-frame)))
(add-hook 'org-capture-after-finalize-hook 'my-org-capture-other-frame-cleanup)
#+end_src


Thanks,
    Lluis

-- 
 "And it's much the same thing with knowledge, for whenever you learn
 something new, the whole world becomes that much richer."
 -- The Princess of Pure Reason, as told by Norton Juster in The Phantom
 Tollbooth

             reply	other threads:[~2011-05-02 18:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-02 18:07 Lluís [this message]
2011-05-02 21:14 ` org-capture-other-frame Marcelo de Moraes Serpa
2011-05-03 12:39   ` org-capture-other-frame Lluís
2011-05-07  8:14 ` org-capture-other-frame Radosław Grzanka
2011-05-10 13:18 ` org-capture-other-frame Radosław Grzanka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877ha9nfgy.fsf@ginnungagap.bsc.es \
    --to=xscript@gmx.net \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).