emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* testing org-bbdb-anniversaries
@ 2020-02-21 16:48 Andrés Ramírez
  2020-02-21 18:02 ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Andrés Ramírez @ 2020-02-21 16:48 UTC (permalink / raw)
  To: emacs-orgmode

Hi. Emacs 26.3, org 9.1.9

My bbdb anniversary entries are not being shown on my agenda.

I would like to add warning on emacs startup when bbdb records are not
being showed.

I eval 'org-bbdb-anniversaries' that lead me to
--8<---------------cut here---------------start------------->8---
Debugger entered--Lisp error: (void-variable date)
  (car date)
  (let* ((m (car date)) (d (nth 1 date)) (y (nth 2 date)) (annivs (gethash (list m d) org-bbdb-anniv-hash)) (text nil) rec recs) (if (and (= m 3) (= d 1) (not (null (gethash (list 2 29) org-bbdb-anniv-hash))) (not (calendar-leap-year-p y))) (progn (setq recs (gethash (list 2 29) org-bbdb-anniv-hash)) (while (setq rec (car-safe (prog1 recs (setq recs ...)))) (setq annivs (cons rec annivs))))) (if annivs (progn (while (setq rec (car-safe (prog1 annivs (setq annivs ...)))) (if rec (progn (let* (... ... ... ... ... ...) (org-add-props tmp nil ... name) (if text ... ...))))))) text)
  org-bbdb-anniversaries()
  eval((org-bbdb-anniversaries) nil)
  elisp--eval-last-sexp(nil)
  eval-last-sexp(nil)
  funcall-interactively(eval-last-sexp nil)
  call-interactively(eval-last-sexp nil nil)
  command-execute(eval-last-sexp)
--8<---------------cut here---------------end--------------->8---
above is intended behaviour?

I would like to to check  an specific date on bbdb-records 2020-02-29
and that date should return me a result that would confirm me
org-bbdb-anniversaries is loading my entries on agenda, otherwise a
warning message should appear on emacs startup.

Which is the right way of checking org-bbdb-anniversaries is loading my
entries?

BR

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

* Re: testing org-bbdb-anniversaries
  2020-02-21 16:48 testing org-bbdb-anniversaries Andrés Ramírez
@ 2020-02-21 18:02 ` Nicolas Goaziou
  2020-02-21 18:41   ` andrés ramírez
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Goaziou @ 2020-02-21 18:02 UTC (permalink / raw)
  To: Andrés Ramírez; +Cc: emacs-orgmode

Hello,

rrandresf@gmail.com (Andrés Ramírez) writes:

> I eval 'org-bbdb-anniversaries' that lead me to
>
> --8<---------------cut here---------------start------------->8---
> Debugger entered--Lisp error: (void-variable date)
>   (car date)

[...]

> above is intended behaviour?

Sadly, yes. Like most diary-related stuff, it expects the `date'
variable to be globally bound.

> I would like to to check  an specific date on bbdb-records 2020-02-29
> and that date should return me a result that would confirm me
> org-bbdb-anniversaries is loading my entries on agenda, otherwise a
> warning message should appear on emacs startup.
>
> Which is the right way of checking org-bbdb-anniversaries is loading my
> entries?

Something like 

  (let ((date '(2 29 2020))) (org-bbdb-anniversaries))

should do.

Regards,

-- 
Nicolas Goaziou

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

* Re: testing org-bbdb-anniversaries
  2020-02-21 18:02 ` Nicolas Goaziou
@ 2020-02-21 18:41   ` andrés ramírez
  2020-02-22  9:33     ` Bastien
  0 siblings, 1 reply; 4+ messages in thread
From: andrés ramírez @ 2020-02-21 18:41 UTC (permalink / raw)
  To: Andrés Ramírez, emacs-orgmode

Hi Nicolas.

Nicolas> Sadly, yes. Like most diary-related stuff, it expects the
Nicolas> `date' variable to be globally bound.

Perhaps something about it on the help?
--8<---------------cut here---------------start------------->8---
(defun org-bbdb-anniversaries ()
  "Extract anniversaries from BBDB for display in the agenda
  In case of calling programatically. Like most diary-related stuff, it expects the
  `date' variable to be globally bound."
  (require 'bbdb)
  .....
  )
--8<---------------cut here---------------end--------------->8---

Nicolas> Something like
Nicolas>   (let ((date '(2 29 2020))) (org-bbdb-anniversaries))

It helped. Thanks.

BR

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

* Re: testing org-bbdb-anniversaries
  2020-02-21 18:41   ` andrés ramírez
@ 2020-02-22  9:33     ` Bastien
  0 siblings, 0 replies; 4+ messages in thread
From: Bastien @ 2020-02-22  9:33 UTC (permalink / raw)
  To: andrés ramírez; +Cc: emacs-orgmode

Hi Andrès,

andrés ramírez <rrandresf@gmail.com> writes:

> Perhaps something about it on the help?
>
> (defun org-bbdb-anniversaries ()
>   "Extract anniversaries from BBDB for display in the agenda
>   In case of calling programatically. Like most diary-related stuff, it expects the
>   `date' variable to be globally bound."
>   (require 'bbdb)
>   .....
>   )

I've slightly enhanced the docstring, thanks for the suggestion.

-- 
 Bastien

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

end of thread, other threads:[~2020-02-22  9:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-21 16:48 testing org-bbdb-anniversaries Andrés Ramírez
2020-02-21 18:02 ` Nicolas Goaziou
2020-02-21 18:41   ` andrés ramírez
2020-02-22  9:33     ` Bastien

Code repositories for project(s) associated with this 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).