unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Bug with diary-float ?
@ 2008-04-25 14:20 Brian Adkins
  2008-04-25 18:16 ` Peter Dyballa
       [not found] ` <85skx9ils6.fsf@emr.cs.iit.edu>
  0 siblings, 2 replies; 6+ messages in thread
From: Brian Adkins @ 2008-04-25 14:20 UTC (permalink / raw)
  To: help-gnu-emacs

I have the following line in my diary file:

%%(diary-float t 0 5) 09:30-10:00 The Event

It does correctly show the event for the 5th Sunday of months that have
5 Sundays, but it also shows on the 1st Sunday of a month following a
month with only 4 Sundays :) Apparently the check to see if the computed
day is still in the same month is missing or incorrect.

Is this a known bug? I looked at the code in diary-lib.el, but my newbie
elisp skills are not up to the task - that is one big hairy function.

Brian Adkins


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

* Re: Bug with diary-float ?
  2008-04-25 14:20 Bug with diary-float ? Brian Adkins
@ 2008-04-25 18:16 ` Peter Dyballa
       [not found] ` <85skx9ils6.fsf@emr.cs.iit.edu>
  1 sibling, 0 replies; 6+ messages in thread
From: Peter Dyballa @ 2008-04-25 18:16 UTC (permalink / raw)
  To: Brian Adkins; +Cc: help-gnu-emacs


Am 25.04.2008 um 16:20 schrieb Brian Adkins:

> Is this a known bug? I looked at the code in diary-lib.el, but my  
> newbie
> elisp skills are not up to the task - that is one big hairy function.


I don't know! I'd use the function in the Help menu to report it.  
Best launch a second GNU Emacs with -Q, load your diary (entry), and  
see whether it still behaves the same faulty way.

For me it also makes this mistake in GNU Emacs 22.2.

--
Greetings

   Pete

The best way to accelerate a PC is 9.8 m/s2





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

* Re: Bug with diary-float ?
@ 2008-04-25 22:59 Edward M. Reingold
  0 siblings, 0 replies; 6+ messages in thread
From: Edward M. Reingold @ 2008-04-25 22:59 UTC (permalink / raw)
  To: help-gnu-emacs; +Cc: 873apakocu.fsf, Glenn Morris, emacs-devel

>>>>> "BA" == Brian Adkins <lojicdotcom@gmail.com> writes:

    BA> I have the following line in my diary file: %%(diary-float t 0 5)
    BA> 09:30-10:00 The Event

    BA> It does correctly show the event for the 5th Sunday of months that
    BA> have 5 Sundays, but it also shows on the 1st Sunday of a month
    BA> following a month with only 4 Sundays :) Apparently the check to see
    BA> if the computed day is still in the same month is missing or
    BA> incorrect.

    BA> Is this a known bug? I looked at the code in diary-lib.el, but my
    BA> newbie elisp skills are not up to the task - that is one big hairy
    BA> function.

A bug in the documentation.  The documentation reads

  Floating diary entry--entry applies if date is the nth dayname of month.
  Parameters are MONTH, DAYNAME, N.  MONTH can be a list of months, the
  constant t, or an integer.  The constant t means all months.  If N is
  negative, count backward from the end of the month.

  An optional parameter DAY means the Nth DAYNAME on or after/before MONTH DAY

But it should really say

  Floating diary entry--entry applies if date is the nth dayname on or after
  the first of month.  Parameters are MONTH, DAYNAME, N.  MONTH can be a list
  of months, the constant t, or an integer.  The constant t means all months.
  If N is negative, count backward from the end of the month.

  An optional parameter DAY means the Nth DAYNAME on or after/before MONTH DAY

-- 

Professor Edward M. Reingold                Email: reingold@iit.edu
Department of Computer Science              Voice: (312) 567-3309
Illinois Institute of Technology            Fax:   (312) 567-5067
Stuart Building, 228F
10 West 31st Street
Chicago, IL  60616-3729  U.S.A.


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

* Re: Bug with diary-float ?
       [not found] ` <85skx9ils6.fsf@emr.cs.iit.edu>
@ 2008-04-26  1:40   ` Brian Adkins
  2008-04-28 17:07     ` Edward M. Reingold
  0 siblings, 1 reply; 6+ messages in thread
From: Brian Adkins @ 2008-04-26  1:40 UTC (permalink / raw)
  To: help-gnu-emacs

reingold@emr.cs.iit.edu (Edward M. Reingold) writes:

>>>>>> "BA" == Brian Adkins <lojicdotcom@gmail.com> writes:
>
>     BA> I have the following line in my diary file: %%(diary-float t 0 5)
>     BA> 09:30-10:00 The Event
>
>     BA> It does correctly show the event for the 5th Sunday of months that
>     BA> have 5 Sundays, but it also shows on the 1st Sunday of a month
>     BA> following a month with only 4 Sundays :) Apparently the check to see
>     BA> if the computed day is still in the same month is missing or
>     BA> incorrect.
>
>     BA> Is this a known bug? I looked at the code in diary-lib.el, but my
>     BA> newbie elisp skills are not up to the task - that is one big hairy
>     BA> function.
>
> A bug in the documentation.  The documentation reads
>
>   Floating diary entry--entry applies if date is the nth dayname of month.
>   Parameters are MONTH, DAYNAME, N.  MONTH can be a list of months, the
>   constant t, or an integer.  The constant t means all months.  If N is
>   negative, count backward from the end of the month.
>
>   An optional parameter DAY means the Nth DAYNAME on or after/before MONTH DAY
>
> But it should really say
>
>   Floating diary entry--entry applies if date is the nth dayname on or after
>   the first of month.  Parameters are MONTH, DAYNAME, N.  MONTH can be a list
>   of months, the constant t, or an integer.  The constant t means all months.
>   If N is negative, count backward from the end of the month.
>
>   An optional parameter DAY means the Nth DAYNAME on or after/before MONTH DAY

Huh? Are you saying that May 4, 2008 should count as a "5th Sunday of
the month"? diary-float works as I'd expect for all cases where the date
actually exists in the month e.g. 1st Wednesday, 3rd Wednesday, 2nd
Saturday, etc.

I think it's a bug in the function, not the documentation.

>
> -- 
>
> Professor Edward M. Reingold                Email: reingold@iit.edu
> Department of Computer Science              Voice: (312) 567-3309
> Illinois Institute of Technology            Fax:   (312) 567-5067
> Stuart Building, 228F
> 10 West 31st Street
> Chicago, IL  60616-3729  U.S.A.


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

* Re: Bug with diary-float ?
  2008-04-26  1:40   ` Brian Adkins
@ 2008-04-28 17:07     ` Edward M. Reingold
  2008-05-03  1:31       ` Brian Adkins
  0 siblings, 1 reply; 6+ messages in thread
From: Edward M. Reingold @ 2008-04-28 17:07 UTC (permalink / raw)
  To: help-gnu-emacs

>>>>> "BA" == Brian Adkins <lojicdotcom@gmail.com> writes:

    BA> Huh? Are you saying that May 4, 2008 should count as a "5th Sunday of
    BA> the month"? diary-float works as I'd expect for all cases where the
    BA> date actually exists in the month e.g. 1st Wednesday, 3rd Wednesday,
    BA> 2nd Saturday, etc.

Yes; the function was intended to give you a day of the week after/before a
certain point, like, "The third Tuesday after November 12."  If you want to
restrict it to a particular interval, you can do that too, why restrict it to
a calendar month?

You can easily write whatever function you want!

-- 

Professor Edward M. Reingold                Email: reingold@iit.edu
Department of Computer Science              Voice: (312) 567-3309
Illinois Institute of Technology            Fax:   (312) 567-5067
Stuart Building, 228F
10 West 31st Street
Chicago, IL  60616-3729  U.S.A.


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

* Re: Bug with diary-float ?
  2008-04-28 17:07     ` Edward M. Reingold
@ 2008-05-03  1:31       ` Brian Adkins
  0 siblings, 0 replies; 6+ messages in thread
From: Brian Adkins @ 2008-05-03  1:31 UTC (permalink / raw)
  To: help-gnu-emacs

reingold@emr.cs.iit.edu (Edward M. Reingold) writes:

>>>>>> "BA" == Brian Adkins <lojicdotcom@gmail.com> writes:
>
>     BA> Huh? Are you saying that May 4, 2008 should count as a "5th Sunday of
>     BA> the month"? diary-float works as I'd expect for all cases where the
>     BA> date actually exists in the month e.g. 1st Wednesday, 3rd Wednesday,
>     BA> 2nd Saturday, etc.
>
> Yes; the function was intended to give you a day of the week after/before a
> certain point, like, "The third Tuesday after November 12."  If you want to
> restrict it to a particular interval, you can do that too, why restrict it to
> a calendar month?

Do you actually use this feature? I would think "3rd Tuesday after Nov
12" is much more rare than the 5th Sunday of the month. Most calendaring
programs provide an "nth day of the month" feature.

To answer your question about why I want to restrict it to a calendar
month, it's because that's when the event is :)

> You can easily write whatever function you want!
>
> -- 
>
> Professor Edward M. Reingold                Email: reingold@iit.edu
> Department of Computer Science              Voice: (312) 567-3309
> Illinois Institute of Technology            Fax:   (312) 567-5067
> Stuart Building, 228F
> 10 West 31st Street
> Chicago, IL  60616-3729  U.S.A.


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

end of thread, other threads:[~2008-05-03  1:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-25 14:20 Bug with diary-float ? Brian Adkins
2008-04-25 18:16 ` Peter Dyballa
     [not found] ` <85skx9ils6.fsf@emr.cs.iit.edu>
2008-04-26  1:40   ` Brian Adkins
2008-04-28 17:07     ` Edward M. Reingold
2008-05-03  1:31       ` Brian Adkins
  -- strict thread matches above, loose matches on Subject: below --
2008-04-25 22:59 Edward M. Reingold

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