* [feature request] org-capture-window-setup to stop capture window taking up whole frame
@ 2015-06-08 15:23 Eric S Fraga
2015-06-08 16:37 ` Charles Millar
` (3 more replies)
0 siblings, 4 replies; 19+ messages in thread
From: Eric S Fraga @ 2015-06-08 15:23 UTC (permalink / raw)
To: emacs-orgmode
Hello,
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. Obviously, I can bring up
any buffer I want while in the capture buffer but it would be nice to
have control over where and how the capture window is created and
placed, along the lines of org-src-window-setup and
org-agenda-window-setup.
Would such a feature be possible, assuming it is not there already. I
have not found the correct variable should it already be there...
Thanks,
eric
--
Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D)
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [feature request] org-capture-window-setup to stop capture window taking up whole frame
2015-06-08 15:23 [feature request] org-capture-window-setup to stop capture window taking up whole frame Eric S Fraga
@ 2015-06-08 16:37 ` Charles Millar
2015-06-08 16:46 ` Kaushal
2015-06-08 20:28 ` Thierry Banel
` (2 subsequent siblings)
3 siblings, 1 reply; 19+ messages in thread
From: Charles Millar @ 2015-06-08 16:37 UTC (permalink / raw)
To: emacs-orgmode
Hi,
On 06/08/2015 11:23 AM, Eric S Fraga wrote:
> Hello,
>
> 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. Obviously, I can bring up
> any buffer I want while in the capture buffer but it would be nice to
> have control over where and how the capture window is created and
> placed, along the lines of org-src-window-setup and
> org-agenda-window-setup.
That would be nice! Eric, thanks for bringing this up.
>
> Would such a feature be possible, assuming it is not there already. I
> have not found the correct variable should it already be there...
>
> Thanks,
> eric
Charlie Millar
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [feature request] org-capture-window-setup to stop capture window taking up whole frame
2015-06-08 16:37 ` Charles Millar
@ 2015-06-08 16:46 ` Kaushal
2015-06-09 7:31 ` e.fraga
2015-06-17 8:24 ` Eric S Fraga
0 siblings, 2 replies; 19+ messages in thread
From: Kaushal @ 2015-06-08 16:46 UTC (permalink / raw)
To: Charles Millar, emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 1297 bytes --]
`org-capture` does not take up the full frame for me by default; I just
tried that in an emacs -Q session.
Look into `display-buffer-alist` (emacs inbuilt variable) or packages like
shackle or popwin for fine control on how you want to create windows when
opening buffers.
I do not use shackle for customizing the opening of capture buffers (as it
splits windows for me by default) but I do use it to do similar thing for
other kinds of buffers.
On Mon, Jun 8, 2015 at 12:38 PM Charles Millar <millarc@verizon.net> wrote:
> Hi,
>
> On 06/08/2015 11:23 AM, Eric S Fraga wrote:
> > Hello,
> >
> > 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. Obviously, I can bring up
> > any buffer I want while in the capture buffer but it would be nice to
> > have control over where and how the capture window is created and
> > placed, along the lines of org-src-window-setup and
> > org-agenda-window-setup.
> That would be nice! Eric, thanks for bringing this up.
> >
> > Would such a feature be possible, assuming it is not there already. I
> > have not found the correct variable should it already be there...
> >
> > Thanks,
> > eric
>
> Charlie Millar
>
>
[-- Attachment #2: Type: text/html, Size: 1690 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [feature request] org-capture-window-setup to stop capture window taking up whole frame
2015-06-08 15:23 [feature request] org-capture-window-setup to stop capture window taking up whole frame Eric S Fraga
2015-06-08 16:37 ` Charles Millar
@ 2015-06-08 20:28 ` Thierry Banel
2015-06-09 9:22 ` Alan Schmitt
[not found] ` <871thlw193.fsf@gmail.com>
3 siblings, 0 replies; 19+ messages in thread
From: Thierry Banel @ 2015-06-08 20:28 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/html, Size: 1725 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [feature request] org-capture-window-setup to stop capture window taking up whole frame
2015-06-08 16:46 ` Kaushal
@ 2015-06-09 7:31 ` e.fraga
2015-06-17 8:24 ` Eric S Fraga
1 sibling, 0 replies; 19+ messages in thread
From: e.fraga @ 2015-06-09 7:31 UTC (permalink / raw)
To: Kaushal; +Cc: emacs-orgmode
On Monday, 8 Jun 2015 at 16:46, Kaushal wrote:
> `org-capture` does not take up the full frame for me by default; I
> just tried that in an emacs -Q session.
You're right: it does not take up the full frame with -Q. Strange: I
cannot find anything in my configuration that would change this
behaviour. I don't set display-buffer-alist and it is nil. I don't use
any of the other packages you and Thierry have mentioned.
I'll keep looking!
Thanks for your input.
--
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.1, Org release_8.3beta-790-gb719c1.dirty
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [feature request] org-capture-window-setup to stop capture window taking up whole frame
2015-06-08 15:23 [feature request] org-capture-window-setup to stop capture window taking up whole frame Eric S Fraga
2015-06-08 16:37 ` Charles Millar
2015-06-08 20:28 ` Thierry Banel
@ 2015-06-09 9:22 ` Alan Schmitt
2015-06-09 9:43 ` Eric S Fraga
2015-06-18 11:16 ` Xebar Saram
[not found] ` <871thlw193.fsf@gmail.com>
3 siblings, 2 replies; 19+ messages in thread
From: Alan Schmitt @ 2015-06-09 9:22 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 1464 bytes --]
Hello Eric,
On 2015-06-08 17:23, Eric S Fraga <e.fraga@ucl.ac.uk> 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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [feature request] org-capture-window-setup to stop capture window taking up whole frame
2015-06-09 9:22 ` Alan Schmitt
@ 2015-06-09 9:43 ` Eric S Fraga
2015-06-18 11:16 ` Xebar Saram
1 sibling, 0 replies; 19+ messages in thread
From: Eric S Fraga @ 2015-06-09 9:43 UTC (permalink / raw)
To: Alan Schmitt; +Cc: emacs-orgmode
On Tuesday, 9 Jun 2015 at 11:22, Alan Schmitt wrote:
> Hello Eric,
>
> On 2015-06-08 17:23, Eric S Fraga <e.fraga@ucl.ac.uk> 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:
Thanks for the suggestion. However, I use ratpoison as my window
manager and, by default, all of my emacs frames are full
screen. Essentially, I use emacs as a window manager given that I spend
all of my time in Emacs... :) I have one emacs frame on each monitor (3
of them) and up to 4 windows in each frame depending on what I am doing.
--
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.1, Org release_8.3beta-1154-g6ba251
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [feature request] org-capture-window-setup to stop capture window taking up whole frame
[not found] ` <871thlw193.fsf@gmail.com>
@ 2015-06-09 12:35 ` Bernhard Pröll
2015-06-12 9:27 ` Eric S Fraga
0 siblings, 1 reply; 19+ messages in thread
From: Bernhard Pröll @ 2015-06-09 12:35 UTC (permalink / raw)
To: emacs-orgmode
With a lot of windows open the annoying part of =org-capture= is
=switch-to-buffer-other-window= for me. My approach is using the current
window for the capture buffer:
#+BEGIN_SRC elisp
(defadvice org-capture (around bp/org-capture--around)
(flet ((switch-to-buffer-other-window (buf) (switch-to-buffer buf)))
ad-do-it))
(ad-activate 'org-capture)
#+END_SRC
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [feature request] org-capture-window-setup to stop capture window taking up whole frame
2015-06-09 12:35 ` Bernhard Pröll
@ 2015-06-12 9:27 ` Eric S Fraga
0 siblings, 0 replies; 19+ messages in thread
From: Eric S Fraga @ 2015-06-12 9:27 UTC (permalink / raw)
To: emacs-orgmode
On Tuesday, 9 Jun 2015 at 14:35, Bernhard Pröll wrote:
> With a lot of windows open the annoying part of =org-capture= is
> =switch-to-buffer-other-window= for me. My approach is using the current
> window for the capture buffer:
>
> #+BEGIN_SRC elisp
> (defadvice org-capture (around bp/org-capture--around)
> (flet ((switch-to-buffer-other-window (buf) (switch-to-buffer buf)))
> ad-do-it))
> (ad-activate 'org-capture)
> #+END_SRC
Thanks. I want to switch-to-buffer-other-window because I often want to
see the original buffer when writing down my capture information, in
cases were there isn't a particular region to select etc. So I've got
the opposite use case than yours. I obviously need to figure out why
the behaviour I see is not the default behaviour...
Thanks again,
eric
--
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.1, Org release_8.3beta-1154-g6ba251
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [feature request] org-capture-window-setup to stop capture window taking up whole frame
2015-06-08 16:46 ` Kaushal
2015-06-09 7:31 ` e.fraga
@ 2015-06-17 8:24 ` Eric S Fraga
2015-06-17 16:41 ` Subhan Michael Tindall
1 sibling, 1 reply; 19+ messages in thread
From: Eric S Fraga @ 2015-06-17 8:24 UTC (permalink / raw)
To: Kaushal; +Cc: emacs-orgmode, Charles Millar
On Monday, 8 Jun 2015 at 16:46, Kaushal wrote:
> `org-capture` does not take up the full frame for me by default; I just
> tried that in an emacs -Q session.
Okay, I have finally found some time to get back to this (been marking
exam scripts, for my sins... ;-).
If the capture template prompts for information, the whole frame is
cleared and only the bare capture buffer is shown in the frame while the
prompts are processed. This is my main problem: I often want to include
some information from the existing buffers in my org capture and all the
information is hidden just when I want it.
Once the prompts have been answered, the windows shown in the frame
change with the original window present as well as the capture
window. This is too late.
All of the above confirmed with emacs -Q.
The question, I guess, is why does org-capture need to take over the
whole frame while processing the prompts in the capture template? If it
needs to display the capture buffer while handling the prompts, why not
display it as it will once the prompts have been processed?
Thanks,
eric
--
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.1, Org release_8.3beta-1216-gb856f6
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [feature request] org-capture-window-setup to stop capture window taking up whole frame
2015-06-17 8:24 ` Eric S Fraga
@ 2015-06-17 16:41 ` Subhan Michael Tindall
2015-06-18 7:57 ` Eric S Fraga
0 siblings, 1 reply; 19+ messages in thread
From: Subhan Michael Tindall @ 2015-06-17 16:41 UTC (permalink / raw)
To: Eric S Fraga, Kaushal; +Cc: emacs-orgmode@gnu.org, Charles Millar
Quickie patch, maybe I'll work it up as per comments later & submit but this will fix things for you (no guarantees, not widely tested)
Modify:
,org-cpature.el
In org-capture-fill-template
**********
(save-window-excursion
;; simplistic modification to avoid the capture-fill-template from
;; taking over the whole frame. It just moves to next window in cycling
;; order and uses that
;; proper patch would want configuration variable, more intelligent window choice,
;; and option to pop up new frame and destroy after capture-flll-template
;; (or use with template as well?
;; (delete-other-windows) don't delete other windows SMT 2015-06-17
(other-window 1) ;;stupid version, just go to next window in cycling order
(org-pop-to-buffer-same-window (get-buffer-create "*Capture*"))
*********
> -----Original Message-----
> From: emacs-orgmode-bounces+subhant=familycareinc.org@gnu.org
> [mailto:emacs-orgmode-bounces+subhant=familycareinc.org@gnu.org] On
> Behalf Of Eric S Fraga
> Sent: Wednesday, June 17, 2015 1:25 AM
> To: Kaushal
> Cc: emacs-orgmode@gnu.org; Charles Millar
> Subject: Re: [O] [feature request] org-capture-window-setup to stop
> capture window taking up whole frame
>
> On Monday, 8 Jun 2015 at 16:46, Kaushal wrote:
> > `org-capture` does not take up the full frame for me by default; I
> > just tried that in an emacs -Q session.
>
> Okay, I have finally found some time to get back to this (been marking exam
> scripts, for my sins... ;-).
>
> If the capture template prompts for information, the whole frame is cleared
> and only the bare capture buffer is shown in the frame while the prompts
> are processed. This is my main problem: I often want to include some
> information from the existing buffers in my org capture and all the
> information is hidden just when I want it.
>
> Once the prompts have been answered, the windows shown in the frame
> change with the original window present as well as the capture window. This
> is too late.
>
> All of the above confirmed with emacs -Q.
>
> The question, I guess, is why does org-capture need to take over the whole
> frame while processing the prompts in the capture template? If it needs to
> display the capture buffer while handling the prompts, why not display it as it
> will once the prompts have been processed?
>
> Thanks,
> eric
> --
> : Eric S Fraga (0xFFFCF67D), Emacs 24.4.1, Org release_8.3beta-1216-gb856f6
This message is intended for the sole use of the individual and entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message. Thank you.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [feature request] org-capture-window-setup to stop capture window taking up whole frame
2015-06-17 16:41 ` Subhan Michael Tindall
@ 2015-06-18 7:57 ` Eric S Fraga
2015-06-23 20:31 ` Nicolas Goaziou
0 siblings, 1 reply; 19+ messages in thread
From: Eric S Fraga @ 2015-06-18 7:57 UTC (permalink / raw)
To: Subhan Michael Tindall; +Cc: Charles Millar, emacs-orgmode@gnu.org, Kaushal
On Wednesday, 17 Jun 2015 at 16:41, Subhan Michael Tindall wrote:
> Quickie patch, maybe I'll work it up as per comments later & submit
> but this will fix things for you (no guarantees, not widely tested)
Thanks for this. Works okay if there is more than one window which is a
step in the right direction. In any case, you've pointed me in the
right direction and the following seems to work fine (with very limited
testing):
--8<---------------cut here---------------start------------->8---
diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index eeb05ca..ac0ed6f 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -1590,8 +1590,7 @@ 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*"))
+ (org-switch-to-buffer-other-window (get-buffer-create "*Capture*"))
(erase-buffer)
(insert template)
(goto-char (point-min))
--8<---------------cut here---------------end--------------->8---
Feedback from real emacs lisp people welcome...
thanks again,
eric
--
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.1, Org release_8.3beta-1216-gb856f6
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [feature request] org-capture-window-setup to stop capture window taking up whole frame
2015-06-09 9:22 ` Alan Schmitt
2015-06-09 9:43 ` Eric S Fraga
@ 2015-06-18 11:16 ` Xebar Saram
2015-06-18 11:45 ` Alan Schmitt
1 sibling, 1 reply; 19+ messages in thread
From: Xebar Saram @ 2015-06-18 11:16 UTC (permalink / raw)
To: Alan Schmitt; +Cc: org mode
[-- Attachment #1: Type: text/plain, Size: 2781 bytes --]
Hi Alan
your code seems very intersting and i have been looking for something like
this for a while. yet for me it opens a new frame without org capture. i
use linux (arch) and put in the following code. please note that when i
evaled your code it said:
`flet' is an obsolete macro (as of 24.3); use either `cl-flet' or `cl-letf'.
so i changed flet to cl-flet and it still didnt work :)
here is the code
(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 . "Pragmata Pro-16")
))
(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))))
any ideas?
thx
z
On Tue, Jun 9, 2015 at 12:22 PM, Alan Schmitt <
alan.schmitt@polytechnique.org> wrote:
> Hello Eric,
>
> On 2015-06-08 17:23, Eric S Fraga <e.fraga@ucl.ac.uk> 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 #2: Type: text/html, Size: 3956 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [feature request] org-capture-window-setup to stop capture window taking up whole frame
2015-06-18 11:16 ` Xebar Saram
@ 2015-06-18 11:45 ` Alan Schmitt
2015-06-18 11:52 ` Xebar Saram
0 siblings, 1 reply; 19+ messages in thread
From: Alan Schmitt @ 2015-06-18 11:45 UTC (permalink / raw)
To: Xebar Saram; +Cc: org mode
[-- Attachment #1: Type: text/plain, Size: 1666 bytes --]
On 2015-06-18 13:16, Xebar Saram <zeltakc@gmail.com> writes:
> Hi Alan
>
> your code seems very intersting and i have been looking for something like
> this for a while. yet for me it opens a new frame without org capture. i use
> linux (arch) and put in the following code. please note that when i evaled
> your code it said:
> `flet' is an obsolete macro (as of 24.3); use either `cl-flet' or `cl-letf'.
> so i changed flet to cl-flet and it still didnt work :)
I don't know how to change this code to not use flet, so I live with the
warning.
>
> here is the code
>
> (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 . "Pragmata Pro-16")
> ))
> (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))))
>
> any ideas?
- if you evaluate ( M-: ) "(org-capture nil "t")", does it start
a capture?
- if yes, can you get rid of the flet and just have (org-capture nil
"t") instead (it should create a frame a split the window in two with
a capture buffer)
- if it still works like this, then the problem is in the flet, and
I don't know what to do.
Alan
--
OpenPGP Key ID : 040D0A3B4ED2E5C7
Weekly CO₂ average (2015-05-30, Mauna Loa Observatory): 403.41 ppm
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [feature request] org-capture-window-setup to stop capture window taking up whole frame
2015-06-18 11:45 ` Alan Schmitt
@ 2015-06-18 11:52 ` Xebar Saram
2015-06-18 14:42 ` Alan Schmitt
0 siblings, 1 reply; 19+ messages in thread
From: Xebar Saram @ 2015-06-18 11:52 UTC (permalink / raw)
To: Alan Schmitt, org mode
[-- Attachment #1: Type: text/plain, Size: 2427 bytes --]
thx again Alan
i do get an error if i eval (org-capture nil "t")
the error is:
Debugger entered--Lisp error: (error "No capture template referred to by
\"t\" keys")
signal(error ("No capture template referred to by \"t\" keys"))
error("No capture template referred to by \"%s\" keys" "t")
org-capture-select-template("t")
org-capture(nil "t")
eval((org-capture nil "t") nil)
eval-expression((org-capture nil "t") nil)
call-interactively(eval-expression nil nil)
command-execute(eval-expression)
any ideas?
thx
Z
On Thu, Jun 18, 2015 at 2:45 PM, Alan Schmitt <
alan.schmitt@polytechnique.org> wrote:
> On 2015-06-18 13:16, Xebar Saram <zeltakc@gmail.com> writes:
>
> > Hi Alan
> >
> > your code seems very intersting and i have been looking for something
> like
> > this for a while. yet for me it opens a new frame without org capture. i
> use
> > linux (arch) and put in the following code. please note that when i
> evaled
> > your code it said:
> > `flet' is an obsolete macro (as of 24.3); use either `cl-flet' or
> `cl-letf'.
> > so i changed flet to cl-flet and it still didnt work :)
>
> I don't know how to change this code to not use flet, so I live with the
> warning.
>
> >
> > here is the code
> >
> > (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 . "Pragmata Pro-16")
> > ))
> > (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))))
> >
> > any ideas?
>
> - if you evaluate ( M-: ) "(org-capture nil "t")", does it start
> a capture?
> - if yes, can you get rid of the flet and just have (org-capture nil
> "t") instead (it should create a frame a split the window in two with
> a capture buffer)
> - if it still works like this, then the problem is in the flet, and
> I don't know what to do.
>
> Alan
>
> --
> OpenPGP Key ID : 040D0A3B4ED2E5C7
> Weekly CO₂ average (2015-05-30, Mauna Loa Observatory): 403.41 ppm
>
[-- Attachment #2: Type: text/html, Size: 3578 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [feature request] org-capture-window-setup to stop capture window taking up whole frame
2015-06-18 11:52 ` Xebar Saram
@ 2015-06-18 14:42 ` Alan Schmitt
0 siblings, 0 replies; 19+ messages in thread
From: Alan Schmitt @ 2015-06-18 14:42 UTC (permalink / raw)
To: Xebar Saram; +Cc: org mode
[-- Attachment #1: Type: text/plain, Size: 1623 bytes --]
On 2015-06-18 13:52, Xebar Saram <zeltakc@gmail.com> writes:
> thx again Alan
>
> i do get an error if i eval (org-capture nil "t")
> the error is:
>
> Debugger entered--Lisp error: (error "No capture template referred to by \"t\"
> keys")
Yes: you need to define a capture template with that key. Here are my
capture templates, for instance
#+begin_src emacs-lisp
(setq org-capture-templates
(quote
(("t" "todo" entry (file "refile-orgx.org")
"* TODO %?\n %U")
("T" "todo with link" entry (file "refile-orgx.org")
"* TODO %?\n %U\n\n%a")
("r" "Reply" entry (file "refile-orgx.org")
"* TODO Reply to %:fromname about %:subject\n%?Received on %:date-timestamp-inactive, link: %a")
("w" "Wait for reply" entry (file "refile-orgx.org")
"* WAITING reply from %:to about %:subject\n%?Sent on %:date-timestamp-inactive, link: %a")
("o" "Old Journal" entry (file+datetree+prompt "diary-runx.org")
"* %i%?\n%u\n")
("O" "Old Journal with link" entry (file+datetree+prompt "diary-runx.org")
"* %i%?\n%u\n%a\n")
("j" "Journal" entry (file+datetree "diary-runx.org")
"* %i%?\nEntered on %U\n")
("J" "Journal with link" entry (file+datetree "diary-runx.org")
"* %i%?\nEntered on %U\n%a\n")
("i" "Store link in offline" plain (file "urls-offline.org")
"%l"))))
#+end_src
You need to adapt this to your needs, of course.
Alan
--
OpenPGP Key ID : 040D0A3B4ED2E5C7
Weekly CO₂ average (2015-05-30, Mauna Loa Observatory): 403.41 ppm
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [feature request] org-capture-window-setup to stop capture window taking up whole frame
2015-06-18 7:57 ` Eric S Fraga
@ 2015-06-23 20:31 ` Nicolas Goaziou
2015-06-25 8:00 ` Eric S Fraga
0 siblings, 1 reply; 19+ messages in thread
From: Nicolas Goaziou @ 2015-06-23 20:31 UTC (permalink / raw)
To: Subhan Michael Tindall; +Cc: Charles Millar, emacs-orgmode@gnu.org, Kaushal
Hello,
Eric S Fraga <e.fraga@ucl.ac.uk> writes:
> Thanks for this. Works okay if there is more than one window which is a
> step in the right direction. In any case, you've pointed me in the
> right direction and the following seems to work fine (with very limited
> testing):
>
> diff --git a/lisp/org-capture.el b/lisp/org-capture.el
> index eeb05ca..ac0ed6f 100644
> --- a/lisp/org-capture.el
> +++ b/lisp/org-capture.el
> @@ -1590,8 +1590,7 @@ 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*"))
> + (org-switch-to-buffer-other-window (get-buffer-create "*Capture*"))
> (erase-buffer)
> (insert template)
> (goto-char (point-min))
>
> Feedback from real emacs lisp people welcome...
It looks good. Could you turn it into a proper patch with a commit
message?
Thank you.
Regards,
--
Nicolas Goaziou
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [feature request] org-capture-window-setup to stop capture window taking up whole frame
2015-06-23 20:31 ` Nicolas Goaziou
@ 2015-06-25 8:00 ` Eric S Fraga
2015-06-25 12:22 ` Nicolas Goaziou
0 siblings, 1 reply; 19+ messages in thread
From: Eric S Fraga @ 2015-06-25 8:00 UTC (permalink / raw)
To: emacs-orgmode@gnu.org
[-- Attachment #1: Type: text/plain, Size: 250 bytes --]
On Tuesday, 23 Jun 2015 at 22:31, Nicolas Goaziou wrote:
[...]
> It looks good. Could you turn it into a proper patch with a commit
> message?
Attached. Thanks!
--
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.1, Org release_8.3beta-1231-ga0a883
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-place-capture-buffer-in-other-window.patch --]
[-- Type: text/x-diff, Size: 1054 bytes --]
From 9256af03530bcd34914f32fc1b7fbbba9cb0d80a Mon Sep 17 00:00:00 2001
From: Eric S Fraga <e.fraga@ucl.ac.uk>
Date: Thu, 25 Jun 2015 08:58:34 +0100
Subject: [PATCH] place capture buffer in other window
* org-capture.el (org-capture-fill-template): the capture template
buffer will be displayed in another window, keeping original window
visible if appropriate.
---
lisp/org-capture.el | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index eeb05ca..ac0ed6f 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -1590,8 +1590,7 @@ 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*"))
+ (org-switch-to-buffer-other-window (get-buffer-create "*Capture*"))
(erase-buffer)
(insert template)
(goto-char (point-min))
--
1.9.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [feature request] org-capture-window-setup to stop capture window taking up whole frame
2015-06-25 8:00 ` Eric S Fraga
@ 2015-06-25 12:22 ` Nicolas Goaziou
0 siblings, 0 replies; 19+ messages in thread
From: Nicolas Goaziou @ 2015-06-25 12:22 UTC (permalink / raw)
To: emacs-orgmode@gnu.org
Eric S Fraga <e.fraga@ucl.ac.uk> writes:
> Attached. Thanks!
Applied. Thank you.
Regards,
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2015-06-25 12:21 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-08 15:23 [feature request] org-capture-window-setup to stop capture window taking up whole frame Eric S Fraga
2015-06-08 16:37 ` Charles Millar
2015-06-08 16:46 ` Kaushal
2015-06-09 7:31 ` e.fraga
2015-06-17 8:24 ` Eric S Fraga
2015-06-17 16:41 ` Subhan Michael Tindall
2015-06-18 7:57 ` Eric S Fraga
2015-06-23 20:31 ` Nicolas Goaziou
2015-06-25 8:00 ` Eric S Fraga
2015-06-25 12:22 ` Nicolas Goaziou
2015-06-08 20:28 ` Thierry Banel
2015-06-09 9:22 ` Alan Schmitt
2015-06-09 9:43 ` Eric S Fraga
2015-06-18 11:16 ` Xebar Saram
2015-06-18 11:45 ` Alan Schmitt
2015-06-18 11:52 ` Xebar Saram
2015-06-18 14:42 ` Alan Schmitt
[not found] ` <871thlw193.fsf@gmail.com>
2015-06-09 12:35 ` Bernhard Pröll
2015-06-12 9:27 ` Eric S Fraga
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).