emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] replace function name in org-bbdb
@ 2013-03-30 13:17 Rasmus
  2013-03-30 14:45 ` Bastien
  0 siblings, 1 reply; 6+ messages in thread
From: Rasmus @ 2013-03-30 13:17 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 265 bytes --]

Hi,

org-bbdb-anniversary was not working on my system before using bbdb3
from package.el (probably from MELPA...).  This fixes this by renaming
a function which has been changed upstream.

I hope the patch is OK.

–Rasmus

-- 
Dung makes an excellent fertilizer

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Org-bbdb-fix-for-renamed-function-in-bbdb3.patch --]
[-- Type: text/x-patch, Size: 1509 bytes --]

From 3ce26475161fb532cd4a4eedfba298acc9055a48 Mon Sep 17 00:00:00 2001
From: "Rasmus (T60p)" <rasmus@pank.eu>
Date: Sat, 30 Mar 2013 04:12:22 +0100
Subject: [PATCH] Org-bbdb: fix for renamed function in bbdb3

* lisp/org-bbdb.el: `bbdb-record-note' is now
`bbdb-record-xfield' in bbdb3 (changelog 2012-12-25 by Roland
Winkler).

See e.g. http://permalink.gmane.org/gmane.emacs.bbdb.user/3424

TINYCHANGE
---
 lisp/org-bbdb.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/org-bbdb.el b/lisp/org-bbdb.el
index a45a26f..1f71345 100644
--- a/lisp/org-bbdb.el
+++ b/lisp/org-bbdb.el
@@ -116,8 +116,8 @@
 (declare-function bbdb-search-name "ext:bbdb-com" (regexp &optional layout))
 (declare-function bbdb-search-organization "ext:bbdb-com" (regexp &optional layout))
 
-;; `bbdb-record-note' is part of BBDB v3.x
-(declare-function bbdb-record-note "ext:bbdb" (record label))
+;; `bbdb-record-xfield' is part of BBDB v3.x
+(declare-function bbdb-record-xfield "ext:bbdb" (record label))
 
 (declare-function calendar-leap-year-p "calendar" (year))
 (declare-function diary-ordinal-suffix "diary-lib" (n))
@@ -312,7 +312,7 @@ The anniversaries are assumed to be stored `org-bbdb-anniversary-field'."
       (when (setq annivs (if old-bbdb
 			     (bbdb-record-getprop
 			      rec org-bbdb-anniversary-field)
-			   (bbdb-record-note
+			   (bbdb-record-xfield
 			    rec org-bbdb-anniversary-field)))
         (setq annivs (if old-bbdb
 			 (bbdb-split annivs "\n")
-- 
1.8.2


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

* Re: [PATCH] replace function name in org-bbdb
  2013-03-30 13:17 [PATCH] replace function name in org-bbdb Rasmus
@ 2013-03-30 14:45 ` Bastien
  2013-03-30 15:51   ` Rasmus
  0 siblings, 1 reply; 6+ messages in thread
From: Bastien @ 2013-03-30 14:45 UTC (permalink / raw)
  To: Rasmus; +Cc: emacs-orgmode

Hi Rasmus,

Rasmus <rasmus@gmx.us> writes:

> org-bbdb-anniversary was not working on my system before using bbdb3
> from package.el (probably from MELPA...).  This fixes this by renaming
> a function which has been changed upstream.

Looks good.  Is there any versioning we can check in order to know
what function's name will the users use?  Otherwise, this may break
several users setup.  Let us know, thanks,

-- 
 Bastien

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

* Re: [PATCH] replace function name in org-bbdb
  2013-03-30 14:45 ` Bastien
@ 2013-03-30 15:51   ` Rasmus
  2013-04-03 11:55     ` Bastien
  0 siblings, 1 reply; 6+ messages in thread
From: Rasmus @ 2013-03-30 15:51 UTC (permalink / raw)
  To: bzg; +Cc: emacs-orgmode


Bastien,

>> org-bbdb-anniversary was not working on my system before using bbdb3
>> from package.el (probably from MELPA...).  This fixes this by renaming
>> a function which has been changed upstream.
>
> Looks good.  Is there any versioning we can check in order to know
> what function's name will the users use?

bbdb3 hasn't been released yet.  It's a moving target and I would
assume that people who use it are on the edge of the development. . .
The function(s) in question were renamed four months ago.

In any case this function will check that one has a sufficiently new
version of of bbdb (based on the change log I linked to in the commit
message).  Should I make a local version of the bbdb field lookup
function and let the value be determined by the test below?  I
unfortunately don't know what the version was called around 2012/12/25
so I test using the date, which may or may not be too fragile.

#+BEGIN_SRC emacs-lisp

(when (fboundp 'bbdb-version)
  (string-match "\\([0-9]\\{4\\}/[0-9]\\{2\\}/[0-9]\\{2\\}\\)" (bbdb-version))
  (version<=
   (replace-regexp-in-string "/" "."
			     (match-string 1 (bbdb-version)))
   "2012.12.25"))
#+END_SRC

Thanks,
Rasmus

-- 
May the Force be with you

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

* Re: [PATCH] replace function name in org-bbdb
  2013-03-30 15:51   ` Rasmus
@ 2013-04-03 11:55     ` Bastien
  2013-04-03 14:38       ` Rasmus
  0 siblings, 1 reply; 6+ messages in thread
From: Bastien @ 2013-04-03 11:55 UTC (permalink / raw)
  To: Rasmus; +Cc: emacs-orgmode

Hi Rasmus,

Rasmus <rasmus@gmx.us> writes:

>>> org-bbdb-anniversary was not working on my system before using bbdb3
>>> from package.el (probably from MELPA...).  This fixes this by renaming
>>> a function which has been changed upstream.
>>
>> Looks good.  Is there any versioning we can check in order to know
>> what function's name will the users use?
>
> bbdb3 hasn't been released yet.  It's a moving target and I would
> assume that people who use it are on the edge of the development. . .
> The function(s) in question were renamed four months ago.

I fixed this slightly differently:
http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=04b13a

Thanks for spotting this and providing the patch!

Best,

-- 
 Bastien

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

* Re: [PATCH] replace function name in org-bbdb
  2013-04-03 11:55     ` Bastien
@ 2013-04-03 14:38       ` Rasmus
  2013-04-03 14:46         ` Bastien
  0 siblings, 1 reply; 6+ messages in thread
From: Rasmus @ 2013-04-03 14:38 UTC (permalink / raw)
  To: bzg; +Cc: emacs-orgmode

Bastien <bzg@altern.org> writes:

> Hi Rasmus,
>
> Rasmus <rasmus@gmx.us> writes:
>
>>>> org-bbdb-anniversary was not working on my system before using bbdb3
>>>> from package.el (probably from MELPA...).  This fixes this by renaming
>>>> a function which has been changed upstream.
>>>
>>> Looks good.  Is there any versioning we can check in order to know
>>> what function's name will the users use?
>>
>> bbdb3 hasn't been released yet.  It's a moving target and I would
>> assume that people who use it are on the edge of the development. . .
>> The function(s) in question were renamed four months ago.
>
> I fixed this slightly differently:
> http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=04b13a
>
> Thanks for spotting this and providing the patch!

Thanks!  I'm extremely proud to have provided a TINYCHANGE to Org :)
Maybe it will lead the way to a real patch one day? 

In any case it should probably be 

-;; `bbdb-record-xfield' was part of BBDB v3.x
+;; `bbdb-record-note' was part of BBDB v3.x

–Rasmus

-- 
If you can mix business and politics wonderful things can happen!

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

* Re: [PATCH] replace function name in org-bbdb
  2013-04-03 14:38       ` Rasmus
@ 2013-04-03 14:46         ` Bastien
  0 siblings, 0 replies; 6+ messages in thread
From: Bastien @ 2013-04-03 14:46 UTC (permalink / raw)
  To: Rasmus; +Cc: emacs-orgmode

Hi Rasmus,

Rasmus <rasmus@gmx.us> writes:

>> Thanks for spotting this and providing the patch!
>
> Thanks!  I'm extremely proud to have provided a TINYCHANGE to Org :)
> Maybe it will lead the way to a real patch one day? 

:)

> In any case it should probably be 
>
> -;; `bbdb-record-xfield' was part of BBDB v3.x
> +;; `bbdb-record-note' was part of BBDB v3.x

Right, fixed in my local branch, thanks!

-- 
 Bastien

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

end of thread, other threads:[~2013-04-03 14:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-30 13:17 [PATCH] replace function name in org-bbdb Rasmus
2013-03-30 14:45 ` Bastien
2013-03-30 15:51   ` Rasmus
2013-04-03 11:55     ` Bastien
2013-04-03 14:38       ` Rasmus
2013-04-03 14:46         ` Bastien

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