* Minor bug: org-agenda-holidays
@ 2010-12-21 20:21 Paul Sexton
2010-12-21 20:35 ` Tassilo Horn
2010-12-22 7:11 ` Noorul Islam K M
0 siblings, 2 replies; 7+ messages in thread
From: Paul Sexton @ 2010-12-21 20:21 UTC (permalink / raw)
To: emacs-orgmode
In org-agenda.el, the function org-agenda-holidays is coded as:
(defun org-agenda-holidays ()
"Display the holidays for the 3 months around the cursor date."
(interactive)
(org-agenda-execute-calendar-command 'list-calendar-holidays))
'list-calendar-holidays' does not exist. It should be
'calendar-list-holidays'.
Paul
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Minor bug: org-agenda-holidays
2010-12-21 20:21 Minor bug: org-agenda-holidays Paul Sexton
@ 2010-12-21 20:35 ` Tassilo Horn
2010-12-22 7:11 ` Noorul Islam K M
1 sibling, 0 replies; 7+ messages in thread
From: Tassilo Horn @ 2010-12-21 20:35 UTC (permalink / raw)
To: emacs-orgmode
Paul Sexton <psexton@xnet.co.nz> writes:
> In org-agenda.el, the function org-agenda-holidays is coded as:
>
> (defun org-agenda-holidays ()
> "Display the holidays for the 3 months around the cursor date."
> (interactive)
> (org-agenda-execute-calendar-command 'list-calendar-holidays))
>
> 'list-calendar-holidays' does not exist. It should be
> 'calendar-list-holidays'.
In my emacs version (24 from bzr), the former is an alias for the
latter, where the former is obsoleted as of emacs 23.1. So I guess
older emacs version only have the former.
What emacs version are you using?
Bye,
Tassilo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Minor bug: org-agenda-holidays
2010-12-21 20:21 Minor bug: org-agenda-holidays Paul Sexton
2010-12-21 20:35 ` Tassilo Horn
@ 2010-12-22 7:11 ` Noorul Islam K M
[not found] ` <4D11AE5C.6060504@xnet.co.nz>
1 sibling, 1 reply; 7+ messages in thread
From: Noorul Islam K M @ 2010-12-22 7:11 UTC (permalink / raw)
To: Paul Sexton; +Cc: emacs-orgmode
Paul Sexton <psexton@xnet.co.nz> writes:
> In org-agenda.el, the function org-agenda-holidays is coded as:
>
> (defun org-agenda-holidays ()
> "Display the holidays for the 3 months around the cursor date."
> (interactive)
> (org-agenda-execute-calendar-command 'list-calendar-holidays))
>
> 'list-calendar-holidays' does not exist. It should be
> 'calendar-list-holidays'.
>
Did you get any error when you executed this function?
Thanks and Regards
Noorul
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Minor bug: org-agenda-holidays
[not found] ` <4D11AE5C.6060504@xnet.co.nz>
@ 2010-12-22 9:10 ` Noorul Islam K M
2010-12-22 16:24 ` Nick Dokos
0 siblings, 1 reply; 7+ messages in thread
From: Noorul Islam K M @ 2010-12-22 9:10 UTC (permalink / raw)
To: Paul Sexton; +Cc: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 384 bytes --]
Paul Sexton <psexton@xnet.co.nz> writes:
> Yes.
> "Wrong type argument: commandp, list-calendar-holidays"
>
>
I think the following patch will fix the issue for you.
Log
[[[
Make org-agenda-holidays compatible with older versions of emacs.
* lisp/org-agenda.el (org-agenda-holidays): Make this function compatible
with older versions of emacs.
]]]
Thanks and Regards
Noorul
[-- Attachment #2: add-backward-compatibility-for-list-calendar-holidays.txt --]
[-- Type: text/plain, Size: 596 bytes --]
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 19535b4..217c701 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -7685,7 +7685,9 @@ the cursor position."
(defun org-agenda-holidays ()
"Display the holidays for the 3 months around the cursor date."
(interactive)
- (org-agenda-execute-calendar-command 'list-calendar-holidays))
+ (if (fboundp 'list-calendar-holidays)
+ (org-agenda-execute-calendar-command 'list-calendar-holidays)
+ (org-agenda-execute-calendar-command 'calendar-list-holidays)))
(defvar calendar-longitude)
(defvar calendar-latitude)
[-- Attachment #3: Type: text/plain, Size: 557 bytes --]
> On 22/12/2010 8:11 p.m., Noorul Islam K M wrote:
>> Paul Sexton<psexton@xnet.co.nz> writes:
>>
>>> In org-agenda.el, the function org-agenda-holidays is coded as:
>>>
>>> (defun org-agenda-holidays ()
>>> "Display the holidays for the 3 months around the cursor date."
>>> (interactive)
>>> (org-agenda-execute-calendar-command 'list-calendar-holidays))
>>>
>>> 'list-calendar-holidays' does not exist. It should be
>>> 'calendar-list-holidays'.
>>>
>> Did you get any error when you executed this function?
>>
>> Thanks and Regards
>> Noorul
[-- Attachment #4: Type: text/plain, Size: 201 bytes --]
_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: Minor bug: org-agenda-holidays
2010-12-22 9:10 ` Noorul Islam K M
@ 2010-12-22 16:24 ` Nick Dokos
2010-12-22 19:22 ` Tassilo Horn
0 siblings, 1 reply; 7+ messages in thread
From: Nick Dokos @ 2010-12-22 16:24 UTC (permalink / raw)
To: Noorul Islam K M; +Cc: emacs-orgmode, nicholas.dokos, Paul Sexton
Noorul Islam K M <noorul@noorul.com> wrote:
> Paul Sexton <psexton@xnet.co.nz> writes:
>
> > Yes.
> > "Wrong type argument: commandp, list-calendar-holidays"
> >
> >
>
> I think the following patch will fix the issue for you.
>
> Log
> [[[
>
> Make org-agenda-holidays compatible with older versions of emacs.
>
> * lisp/org-agenda.el (org-agenda-holidays): Make this function compatible
> with older versions of emacs.
>
> ]]]
>
I don't think the patch is necessary: as Tassilo points out,
list-calendar-holidays should exist in emacs versions before 23.1, it is
obsoleted in 23.1 and replaced by calendar-list-holidays, but remains as
an alias in versions 23.1 and after. I can confirm that in both
GNU Emacs 23.2.50.1 and GNU Emacs 24.0.50.1, the alias exists and in both cases
(commandp 'list-calendar-holidays)
returns t.
So it looks like a set-up problem at Paul's end and Tassilo's basic
question remains: what version of emacs are you (Paul) running?
If and when the alias goes away, and assuming org supports emacs versions
before 23.1 at that point, then a compatibility patch like Noorul's might
be necessary, but it's probably not a good idea to go for "premature
compatibility" so to speak :-)
Nick
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Minor bug: org-agenda-holidays
2010-12-22 16:24 ` Nick Dokos
@ 2010-12-22 19:22 ` Tassilo Horn
2010-12-22 19:54 ` Nick Dokos
0 siblings, 1 reply; 7+ messages in thread
From: Tassilo Horn @ 2010-12-22 19:22 UTC (permalink / raw)
To: emacs-orgmode
Nick Dokos <nicholas.dokos@hp.com> writes:
Hi Nick,
> I don't think the patch is necessary: as Tassilo points out,
> list-calendar-holidays should exist in emacs versions before 23.1, it
> is obsoleted in 23.1 and replaced by calendar-list-holidays, but
> remains as an alias in versions 23.1 and after. I can confirm that in
> both GNU Emacs 23.2.50.1 and GNU Emacs 24.0.50.1, the alias exists and
> in both cases
>
> (commandp 'list-calendar-holidays)
>
> returns t.
I've just fired up emacs 23.1 on some other machine, and there is really
only `calendar-list-holidays'.
Hm, no, not true. But `calendar-list-holidays' is directly visible to
C-h f cause it's autoloaded whereas `list-calendar-holidays' is only
there after (require 'holidays). With newer emacsen, both are visible
directly, probably because `define-obsolete-function-alias'.
Bye,
Tassilo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Re: Minor bug: org-agenda-holidays
2010-12-22 19:22 ` Tassilo Horn
@ 2010-12-22 19:54 ` Nick Dokos
0 siblings, 0 replies; 7+ messages in thread
From: Nick Dokos @ 2010-12-22 19:54 UTC (permalink / raw)
To: Tassilo Horn; +Cc: nicholas.dokos, emacs-orgmode
Tassilo Horn <tassilo@member.fsf.org> wrote:
> Nick Dokos <nicholas.dokos@hp.com> writes:
>
> Hi Nick,
>
> > I don't think the patch is necessary: as Tassilo points out,
> > list-calendar-holidays should exist in emacs versions before 23.1, it
> > is obsoleted in 23.1 and replaced by calendar-list-holidays, but
> > remains as an alias in versions 23.1 and after. I can confirm that in
> > both GNU Emacs 23.2.50.1 and GNU Emacs 24.0.50.1, the alias exists and
> > in both cases
> >
> > (commandp 'list-calendar-holidays)
> >
> > returns t.
>
> I've just fired up emacs 23.1 on some other machine, and there is really
> only `calendar-list-holidays'.
>
> Hm, no, not true. But `calendar-list-holidays' is directly visible to
> C-h f cause it's autoloaded whereas `list-calendar-holidays' is only
> there after (require 'holidays). With newer emacsen, both are visible
> directly, probably because `define-obsolete-function-alias'.
>
Ah, thanks, that clears up things. I did some more spelunking on
emacs-22.3: only list-calendar-holidays exists there, so they seem to
have rationalized the name in 23.1 but didn't quite get the
compatibility right until 23.2 (or a later 23.1 at least, one after
Paul's version).
So, for Paul, the fix seems to be to
(require 'holidays)
in his .emacs somewhere, possibly before loading org-mode.
For org-mode, probably the best thing to do is to change
list-calendar-holidays to calendar-list-holidays as soon as support for
emacs-22.3 is dropped (except that there is still older - and current -
xemacsen to check of course). The joys of backward compatibility...
Nick
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2010-12-22 19:54 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-21 20:21 Minor bug: org-agenda-holidays Paul Sexton
2010-12-21 20:35 ` Tassilo Horn
2010-12-22 7:11 ` Noorul Islam K M
[not found] ` <4D11AE5C.6060504@xnet.co.nz>
2010-12-22 9:10 ` Noorul Islam K M
2010-12-22 16:24 ` Nick Dokos
2010-12-22 19:22 ` Tassilo Horn
2010-12-22 19:54 ` Nick Dokos
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).