emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: emacs-orgmode@gnu.org
Cc: Christoph Groth <cwg@falma.de>
Subject: Re: org-capture: keeping window visible during date entry
Date: Sat, 16 Jun 2012 15:14:35 +0800	[thread overview]
Message-ID: <87fw9vybhg.fsf@ericabrahamsen.net> (raw)
In-Reply-To: 874nqe8e0y.fsf@falma.de

[-- Attachment #1: Type: text/plain, Size: 1369 bytes --]

On Thu, Jun 14 2012, Christoph Groth wrote:

> Hello,
>
> I recently switched from remember to org's new capture facility which
> seems to work fine.  However, an issue I already had with remember is
> still bothering me, perhaps someone knows a good solution:
>
> I often call org-capture from within a buffer containing some relevant
> context, for example an e-mail message displayed by gnus.  The emacs
> window created by org-capture that allows to choose a template is
> created below the two Gnus windows showing the group and the message.
> My org-capture templates require entering a date.  During the subsequent
> date entry, the gnus windows are not visible anymore (I only see the
> nascent buffer with the entry to be captured and a window showing the
> emacs calendar).  This is impractical, because the e-mail message often
> contains the very date I would like to enter.
>
> How to ensure that the buffer which was active when org-capture was
> executed remains visible during date entry?
>
> Thanks,
> Christoph

I've had the same annoyance. The attached patch is *not* a real solution
to the problem, as it still produces some weird windowing, and I have no
idea if it will wreck other uses of capture, but it does preserve gnus
windows so you can see the information you're trying to capture. It's at
least a pointer in the right direction…

Eric


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: capture windows --]
[-- Type: text/x-patch, Size: 1077 bytes --]

diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index 0e6ab2c..e53b430 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -873,7 +873,7 @@ it.  When it is a variable, retrieve the value.  Return whatever we get."
 (defun org-capture-place-template ()
   "Insert the template at the target location, and display the buffer."
   (org-capture-put :return-to-wconf (current-window-configuration))
-  (delete-other-windows)
+;  (delete-other-windows)
   (org-switch-to-buffer-other-window
    (org-capture-get-indirect-buffer (org-capture-get :buffer) "CAPTURE"))
   (widen)
@@ -1347,8 +1347,8 @@ The template may still contain \"%?\" for cursor positioning."
     (unless template (setq template "") (message "No template") (ding)
 	    (sit-for 1))
     (save-window-excursion
-      (delete-other-windows)
-      (org-pop-to-buffer-same-window (get-buffer-create "*Capture*"))
+;      (delete-other-windows)
+      (org-switch-to-buffer-other-window (get-buffer-create "*Capture*"))
       (erase-buffer)
       (insert template)
       (goto-char (point-min))

[-- Attachment #3: Type: text/plain, Size: 100 bytes --]



-- 
GNU Emacs 24.1.50.1 (i686-pc-linux-gnu, GTK+ Version 2.24.10)
 of 2012-06-11 on pellet
7.8.10

  reply	other threads:[~2012-06-16  7:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-14  9:03 org-capture: keeping window visible during date entry Christoph Groth
2012-06-16  7:14 ` Eric Abrahamsen [this message]
2012-07-07 15:24   ` Christoph Groth
2012-07-07 16:40     ` Samuel Wales
2012-07-07 17:58       ` Christoph Groth
2012-07-07 18:48         ` Samuel Wales
2012-08-08 11:17     ` Bastien

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=87fw9vybhg.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=cwg@falma.de \
    --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).