Re: testing org-bbdb-anniversaries

2020-02-22 Thread Bastien
Hi Andrès,

andrés ramírez  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



Re: testing org-bbdb-anniversaries

2020-02-21 Thread andrés ramírez
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



Re: testing org-bbdb-anniversaries

2020-02-21 Thread Nicolas Goaziou
Hello,

rrandr...@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



testing org-bbdb-anniversaries

2020-02-21 Thread Andrés Ramírez
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