emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Re: Org-expiry: How to define keyword for org-expiry-add-k


From: David Maus
Subject: Re: [Orgmode] Re: Org-expiry: How to define keyword for org-expiry-add-keyword
Date: Sun, 10 Jan 2010 16:30:42 +0100
User-agent: Wanderlust/2.15.6 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.7 Emacs/23.1.91 (i486-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

At Thu, 07 Jan 2010 18:01:11 +0100,
David Maus wrote:
>
> [1  <text/plain; US-ASCII (7bit)>]
> At Tue, 05 Jan 2010 15:26:06 -0800,
> Markus Heller wrote:
> >
> >
> > But when I run M-x org-expiry-process-entries in the agenda or in my
> > example file (see below), I get the following message in the minibuffer:
> >
> > "The mark is not set now, so there is no region"
> >
>
> [...]
>
> No. Up to now org-expiry is constructed to work on a per file basis
> and `org-expiry-process-entries' even expects the headlines to process
> in a region. That is what the first message "The mark is not set now,
> so there is no region" complains about.

Actually I have to correct myself: That `org-expiry-process-entries'
/requires/ mark to be set seems like a bug:

,----
| (defun org-expiry-process-entries (beg end)
|   "Process all expired entries between BEG and END.
| The expiry process will run the function defined by
| `org-expiry-handler-functions'."
|   (interactive "r")
|   (save-excursion
|     (let ((beg (if (org-region-active-p)
|                  (region-beginning) (point-min)))
|         (end (if (org-region-active-p)
|                  (region-end) (point-max))))
| ...
`----

beg and end are mandatory parameters and (interactive "r") sets beg
and end to beginning and end of region respectively. But as far as I
understand the source (tm), the function parameters are not used
because the let-statement defines two local variables beg and end
depending on whether there is an active region or not.

But if there is no region active the (interactive "r") complains about
no region and terminates the function. So the else statements in the
if clauses are never used, right?

So `org-expiry-process-entries' should read:

,----
| (defun org-expiry-process-entries ()
|   "Process all expired entries between BEG and END.
| The expiry process will run the function defined by
| `org-expiry-handler-functions'."
|   (interactive)
|   (save-excursion
| ...
`----

Or am I missing something?

 -- David

--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... address@hidden
Email..... address@hidden

Attachment: pgpJRE6X3QE2B.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]