emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* can I refile or archive from the agenda without rebuilding?
@ 2014-12-12 13:30 Alan Schmitt
  2014-12-12 17:01 ` Kyle Meyer
  0 siblings, 1 reply; 8+ messages in thread
From: Alan Schmitt @ 2014-12-12 13:30 UTC (permalink / raw)
  To: emacs-orgmode

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

Hello,

My agenda is fairly big, and it takes a few minutes to generate it. When
I need to refile many items to different places (so bulk edit is not an
option), it slows me down quite a bit. Is there an option to prevent
rebuilding the agenda after archiving or refiling?

Thanks,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 494 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: can I refile or archive from the agenda without rebuilding?
  2014-12-12 13:30 can I refile or archive from the agenda without rebuilding? Alan Schmitt
@ 2014-12-12 17:01 ` Kyle Meyer
  2014-12-13  9:16   ` Alan Schmitt
  0 siblings, 1 reply; 8+ messages in thread
From: Kyle Meyer @ 2014-12-12 17:01 UTC (permalink / raw)
  To: Alan Schmitt; +Cc: emacs-orgmode

Alan Schmitt <alan.schmitt@polytechnique.org> wrote:
> My agenda is fairly big, and it takes a few minutes to generate it.

Wow.

> When I need to refile many items to different places (so bulk edit is
> not an option), it slows me down quite a bit. Is there an option to
> prevent rebuilding the agenda after archiving or refiling?

org-agenda-refile takes a NO-UPDATE argument.  To set this
interactively, you could advise org-agenda-refile (or wrap it in another
command).

-- 
Kyle

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: can I refile or archive from the agenda without rebuilding?
  2014-12-12 17:01 ` Kyle Meyer
@ 2014-12-13  9:16   ` Alan Schmitt
  2014-12-15  8:31     ` Samuel Loury
  0 siblings, 1 reply; 8+ messages in thread
From: Alan Schmitt @ 2014-12-13  9:16 UTC (permalink / raw)
  To: Kyle Meyer; +Cc: emacs-orgmode

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

On 2014-12-12 12:01, Kyle Meyer <kyle@kyleam.com> writes:

> Alan Schmitt <alan.schmitt@polytechnique.org> wrote:
>> My agenda is fairly big, and it takes a few minutes to generate it.
>
> Wow.

I meant seconds (about 20 seconds). But is feels like minutes ;)

>> When I need to refile many items to different places (so bulk edit is
>> not an option), it slows me down quite a bit. Is there an option to
>> prevent rebuilding the agenda after archiving or refiling?
>
> org-agenda-refile takes a NO-UPDATE argument.  To set this
> interactively, you could advise org-agenda-refile (or wrap it in another
> command).

This is a great suggestion, thanks! It works perfectly.

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 494 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: can I refile or archive from the agenda without rebuilding?
  2014-12-13  9:16   ` Alan Schmitt
@ 2014-12-15  8:31     ` Samuel Loury
  2014-12-16  9:17       ` Alan Schmitt
  0 siblings, 1 reply; 8+ messages in thread
From: Samuel Loury @ 2014-12-15  8:31 UTC (permalink / raw)
  To: Alan Schmitt, Kyle Meyer; +Cc: emacs-orgmode

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

Alan Schmitt <alan.schmitt@polytechnique.org> writes:

> On 2014-12-12 12:01, Kyle Meyer <kyle@kyleam.com> writes:
>
>> Alan Schmitt <alan.schmitt@polytechnique.org> wrote:
>>> My agenda is fairly big, and it takes a few minutes to generate it.
>>
>> Wow.
>
> I meant seconds (about 20 seconds). But is feels like minutes ;)

I have the same feeling :-).

>>> When I need to refile many items to different places (so bulk edit is
>>> not an option), it slows me down quite a bit. Is there an option to
>>> prevent rebuilding the agenda after archiving or refiling?
>>
>> org-agenda-refile takes a NO-UPDATE argument.  To set this
>> interactively, you could advise org-agenda-refile (or wrap it in another
>> command).
>
> This is a great suggestion, thanks! It works perfectly.

For other readers to take advantage of the code, this is my
implementation of the advise.

--8<---------------cut here---------------start------------->8---
(defun my/org-agenda-refile (orig &optional goto rfloc no-update)
  (funcall orig goto rfloc t))

(add-function :around
			  (symbol-function 'org-agenda-refile)
			  #'my/org-agenda-refile)
--8<---------------cut here---------------end--------------->8---

My two cents,
-- 
Konubinix
GPG Key    : 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: can I refile or archive from the agenda without rebuilding?
  2014-12-15  8:31     ` Samuel Loury
@ 2014-12-16  9:17       ` Alan Schmitt
  2014-12-16 20:46         ` Kyle Meyer
  0 siblings, 1 reply; 8+ messages in thread
From: Alan Schmitt @ 2014-12-16  9:17 UTC (permalink / raw)
  To: Samuel Loury; +Cc: Kyle Meyer, emacs-orgmode

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

On 2014-12-15 09:31, Samuel Loury <konubinix@gmail.com> writes:

>>> org-agenda-refile takes a NO-UPDATE argument.  To set this
>>> interactively, you could advise org-agenda-refile (or wrap it in another
>>> command).
>>
>> This is a great suggestion, thanks! It works perfectly.
>
> For other readers to take advantage of the code, this is my
> implementation of the advise.
>
> (defun my/org-agenda-refile (orig &optional goto rfloc no-update)
>   (funcall orig goto rfloc t))
>
> (add-function :around
> 			  (symbol-function 'org-agenda-refile)
> 			  #'my/org-agenda-refile)

This is how I did it:

#+begin_src emacs-lisp
(defun as/org-agenda-refile-noupdate (&optional goto rfloc)
  "Call `org-agenda-refile' with arguments GOTO, RFLOC, and t."
  (interactive "P")
  (org-agenda-refile goto rfloc t))

(add-hook 'org-agenda-mode-hook
          (lambda ()
            (local-set-key (kbd "C-c C-w") 'as/org-agenda-refile-noupdate)))
#+end_src

I'm curious: is it better to use an advice or to redefine a function?

Thanks,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 494 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: can I refile or archive from the agenda without rebuilding?
  2014-12-16  9:17       ` Alan Schmitt
@ 2014-12-16 20:46         ` Kyle Meyer
  2014-12-17  9:34           ` Samuel Loury
  2014-12-17 15:36           ` Alan Schmitt
  0 siblings, 2 replies; 8+ messages in thread
From: Kyle Meyer @ 2014-12-16 20:46 UTC (permalink / raw)
  To: Alan Schmitt; +Cc: emacs-orgmode, Samuel Loury

Alan Schmitt <alan.schmitt@polytechnique.org> wrote:
> On 2014-12-15 09:31, Samuel Loury <konubinix@gmail.com> writes:
[...]
> This is how I did it:
>
> #+begin_src emacs-lisp
> (defun as/org-agenda-refile-noupdate (&optional goto rfloc)
>   "Call `org-agenda-refile' with arguments GOTO, RFLOC, and t."
>   (interactive "P")
>   (org-agenda-refile goto rfloc t))
>
> (add-hook 'org-agenda-mode-hook
>           (lambda ()
>             (local-set-key (kbd "C-c C-w") 'as/org-agenda-refile-noupdate)))
> #+end_src

You could also use

    (define-key org-agenda-mode-map [remap org-agenda-refile]
      'as/org-agenda-refile-noupdate)

> I'm curious: is it better to use an advice or to redefine a function?

I usually prefer to define a new function because it allows you to use
both the old and new variant.

--
Kyle

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: can I refile or archive from the agenda without rebuilding?
  2014-12-16 20:46         ` Kyle Meyer
@ 2014-12-17  9:34           ` Samuel Loury
  2014-12-17 15:36           ` Alan Schmitt
  1 sibling, 0 replies; 8+ messages in thread
From: Samuel Loury @ 2014-12-17  9:34 UTC (permalink / raw)
  To: Kyle Meyer, Alan Schmitt; +Cc: emacs-orgmode

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

Kyle Meyer <kyle@kyleam.com> writes:

> Alan Schmitt <alan.schmitt@polytechnique.org> wrote:
>> On 2014-12-15 09:31, Samuel Loury <konubinix@gmail.com> writes:
> [...]
>> This is how I did it:
>>
>> #+begin_src emacs-lisp
>> (defun as/org-agenda-refile-noupdate (&optional goto rfloc)
>>   "Call `org-agenda-refile' with arguments GOTO, RFLOC, and t."
>>   (interactive "P")
>>   (org-agenda-refile goto rfloc t))
>>
>> (add-hook 'org-agenda-mode-hook
>>           (lambda ()
>>             (local-set-key (kbd "C-c C-w") 'as/org-agenda-refile-noupdate)))
>> #+end_src
>
> You could also use
>
>     (define-key org-agenda-mode-map [remap org-agenda-refile]
>       'as/org-agenda-refile-noupdate)
>
>> I'm curious: is it better to use an advice or to redefine a function?
>
> I usually prefer to define a new function because it allows you to use
> both the old and new variant.

That makes sense. Thanks for the advice (no pun intended).

-- 
Konubinix
GPG Key    : 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: can I refile or archive from the agenda without rebuilding?
  2014-12-16 20:46         ` Kyle Meyer
  2014-12-17  9:34           ` Samuel Loury
@ 2014-12-17 15:36           ` Alan Schmitt
  1 sibling, 0 replies; 8+ messages in thread
From: Alan Schmitt @ 2014-12-17 15:36 UTC (permalink / raw)
  To: Kyle Meyer; +Cc: emacs-orgmode, Samuel Loury

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

On 2014-12-16 15:46, Kyle Meyer <kyle@kyleam.com> writes:

> Alan Schmitt <alan.schmitt@polytechnique.org> wrote:
>> On 2014-12-15 09:31, Samuel Loury <konubinix@gmail.com> writes:
> [...]
>> This is how I did it:
>>
>> #+begin_src emacs-lisp
>> (defun as/org-agenda-refile-noupdate (&optional goto rfloc)
>>   "Call `org-agenda-refile' with arguments GOTO, RFLOC, and t."
>>   (interactive "P")
>>   (org-agenda-refile goto rfloc t))
>>
>> (add-hook 'org-agenda-mode-hook
>>           (lambda ()
>>             (local-set-key (kbd "C-c C-w") 'as/org-agenda-refile-noupdate)))
>> #+end_src
>
> You could also use
>
>     (define-key org-agenda-mode-map [remap org-agenda-refile]
>       'as/org-agenda-refile-noupdate)

Thank you for this suggestion, it is most useful.

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 494 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-12-17 15:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-12 13:30 can I refile or archive from the agenda without rebuilding? Alan Schmitt
2014-12-12 17:01 ` Kyle Meyer
2014-12-13  9:16   ` Alan Schmitt
2014-12-15  8:31     ` Samuel Loury
2014-12-16  9:17       ` Alan Schmitt
2014-12-16 20:46         ` Kyle Meyer
2014-12-17  9:34           ` Samuel Loury
2014-12-17 15:36           ` Alan Schmitt

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).