From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Abrahamsen Subject: Re: org-capture: keeping window visible during date entry Date: Sat, 16 Jun 2012 15:14:35 +0800 Message-ID: <87fw9vybhg.fsf@ericabrahamsen.net> References: <874nqe8e0y.fsf@falma.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:42271) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfnDk-0005oz-47 for emacs-orgmode@gnu.org; Sat, 16 Jun 2012 03:14:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SfnDi-0006v4-GR for emacs-orgmode@gnu.org; Sat, 16 Jun 2012 03:14:55 -0400 Received: from plane.gmane.org ([80.91.229.3]:48870) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfnDi-0006uq-8p for emacs-orgmode@gnu.org; Sat, 16 Jun 2012 03:14:54 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SfnDb-00077W-E2 for emacs-orgmode@gnu.org; Sat, 16 Jun 2012 09:14:47 +0200 Received: from 114.250.134.21 ([114.250.134.21]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 16 Jun 2012 09:14:47 +0200 Received: from eric by 114.250.134.21 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 16 Jun 2012 09:14:47 +0200 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 Cc: Christoph Groth --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=capwindows.diff Content-Description: capture windows 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)) --=-=-= Content-Type: text/plain -- GNU Emacs 24.1.50.1 (i686-pc-linux-gnu, GTK+ Version 2.24.10) of 2012-06-11 on pellet 7.8.10 --=-=-=--