Re: [patch] Fix bbdb-omit-record

2016-07-19 Thread Matt Lundin
I'd like to heartily endorse the inclusion of Marco's patch. (I just
debugged this today and came up with the same fix; then I found this
email.)

The patch is a very minor fix for a bug that detracts significantly from
bbdb functionality. Without the patch, bbdb-omit-record does not work,
since bbdb-redisplay-record is missing the delete-p argument. As a
result, when one calls bbdb-omit-record, instead of excluding the
current record, it instead redisplays the *BBDB* buffer with the current
record at the top of the buffer.

Thanks,
Matt

Marco Wahl  writes:

> Hi Roland and all,
>
> Please consider to apply this microscopic patch for resurrecting
> `bbdb-omit-record' (which is on key 'o' in *BBDB*.)
>
>
> Best regards!
> -- 
> Marco Wahl
> GPG: 0x49010A040A3AE6F2
>
>>From 1e82d7d5d86a978619bbea52c23ba663d1747ced Mon Sep 17 00:00:00 2001
> From: Marco Wahl 
> Date: Tue, 15 Dec 2015 22:53:22 +0100
> Subject: [PATCH] Fix bbdb-omit-record
>
> ---
>  lisp/bbdb-com.el | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lisp/bbdb-com.el b/lisp/bbdb-com.el
> index c3fb500..d2f9a61 100644
> --- a/lisp/bbdb-com.el
> +++ b/lisp/bbdb-com.el
> @@ -1499,7 +1499,7 @@ With prefix N, omit the next N records.  If negative, 
> omit backwards."
>(setq n (min (- n) num))
>(bbdb-prev-record n))
>  (dotimes (i n)
> -  (bbdb-redisplay-record (bbdb-current-record) t
> +  (bbdb-redisplay-record (bbdb-current-record) nil t
>  
>  ;;; Fixing up bogus records

--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: org-bbdb-anniversaries gives error 'bad sexp'

2011-05-16 Thread Matt Lundin
Roland Winkler wink...@gnu.org writes:

 On Sun May 15 2011 Matt Lundin wrote:
 I'd be happy to take this on. AFAICT, there are three functions in
 org-bbdb that no longer exist in bbdb v3.
 
 bbdb-name
 bbdb-company
 bbdb-record-getprop
 
 The first two can easily be defaliased to bbdb-search-organization and
 bbdb-search-name. (For a while, we should probably support bbdb v2 and
 v3 simultaneously.)

 Things might be a bit more subtle. The new organization field is
 a list, not a single string.

Thanks. That's good to know. AFAICT, bbdb-search-organization already
accommodates for this fact. That is, if you give it a regexp, it will
return all records matching the regexp in the organization field. Since
org-bbdb calls bbdb-company with a string as an argument, wouldn't a
defalias be sufficient for the time being?

 The other major change that breaks compatibility is the order of the
 parameters in bbdb-split. It has been reversed in the new bbdb: i.e.,
 one used to call (bbdb-split string separator), whereas now one must
 call (bbdb-split separator string). Is there a compelling reason to
 change this order in the new bbdb?

 The change is not only with respect to the order of arguments that
 could be reverted in BBDB v3. More importantly, I tried to get rid
 of hard-coded separators. Most often the separator arg is now the
 name of the field that is split. Then the actual separator is looked
 up in bbdb-separator-alist. While I do not know yet a good strategy
 for the upgrade of org-mode's BBDB interface, I'd find it
 unfortunate if such a feature was lost in org-mode to preserve
 backward compatibility.

Thanks for the explanation. For the time being, I'll add a workaround to
accommodate both versions.

Best,
Matt

--
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: org-bbdb-anniversaries gives error 'bad sexp'

2011-05-16 Thread Matt Lundin
Leo sdl@gmail.com writes:

 On 2011-05-16 00:58 +0800, Matt Lundin wrote:
 I'd be happy to take this on. AFAICT, there are three functions in
 org-bbdb that no longer exist in bbdb v3.

 If you want you can build on top of my version. The anniversaries is
 still broken since I don't use BBDB-anniv.el. The rest works well for
 the past few weeks.

Thanks Leo! This is very helpful.

I have anniversaries working in my own setup, so between the two sets of
modifications, I should be able to provide a full set of fixes. More
soon...

Best,
Matt

--
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: BBDB beginners guide?

2011-04-04 Thread Matt Lundin
Leo sdl@gmail.com writes:

 On 2011-04-04 10:31 +0800, Matt Lundin wrote:
 When my updates of BBDB were in a pre-alpha stage and I did not yet
 have a detailed roadmap where they would take me, I thought that
 there was really not much of a point trying to continuously (at each
 intermediate stage) preserve backward compatibility when it would
 have been possible.

 I appreciate all the work you have done to freshen up bbdb!

 I, too, have some reservations about the extent of some of the name
 changes. For instance, the new bbdb breaks org-mode's bbdb module, which
 is part of GNU Emacs.

 I personally think it would be far more productive to worry about
 backward compatibility later on. For example, we could add a new
 org-bbdb3 module to org mode and leave the old as it is.

First, let me thank Roland again for the new bbdb; it is a great
improvement, and the code has been cleaned up a lot!

I do think it can be productive right now, while development is moving
quickly, to ask whether some of the changes, such as reversing the
parameters of bbdb-split, are necessary, since they are easier to fix
now than they will be later. I imagine later on is relative to when
the bbdb 3.x series will be officially released. I just joined this
list, so I am not yet aware of a development roadmap.

In the meantime, if anyone is interested, I found that the following
hacks help to make org-bbdb.el work with the new bbdb:

--8---cut here---start-8---
(defalias 'bbdb-company 'bbdb-search-organization)
(defalias 'bbdb-name 'bbdb-search-name)

(defun bbdb-record-getprop (record label)
  (and (eq label 'company)
   (setq label 'organization))
  (if (memq label '(name degree organization address phone mail aka))
(funcall
 (intern 
  (concat bbdb-record- (symbol-name label))) 
 record)
(bbdb-record-note record label)))

(defadvice bbdb-split (around my-bbdb-split activate)
  (when (or (string= string \n) (string= string -))
(let ((sep string))
  (setq string separator
separator sep)))
  ad-do-it)
--8---cut here---end---8---

Best,
Matt


--
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: BBDB beginners guide?

2011-04-04 Thread Matt Lundin
Roland Winkler wink...@gnu.org writes:

 On Mon Apr 4 2011 Leo wrote:
 I personally think it would be far more productive to worry about
 backward compatibility later on. For example, we could add a new
 org-bbdb3 module to org mode and leave the old as it is.

 While I do not know any details of how BBDB is hooked into /
 interfacing org mode, I expect that Leo's suggestion is probably the
 cleanest way to go (and similar for other packages that might have a
 bbdb interface).


Thanks for the reply. That sounds like a good plan. I think org-bbdb can
be tweaked to accommodate both the old and the new bbdb without a
complete rewrite.

I do agree that your code cleanup will yield huge benefits over the long
run. So it's better to get the pain of upgrading over at once -- and
then enjoy the new and improved bbdb for many years to come!

Thanks again,
Matt

--
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: BBDB beginners guide?

2011-04-03 Thread Matt Lundin
Roland Winkler wink...@gnu.org writes:

 When my updates of BBDB were in a pre-alpha stage and I did not yet
 have a detailed roadmap where they would take me, I thought that
 there was really not much of a point trying to continuously (at each
 intermediate stage) preserve backward compatibility when it would
 have been possible.

I appreciate all the work you have done to freshen up bbdb!

I, too, have some reservations about the extent of some of the name
changes. For instance, the new bbdb breaks org-mode's bbdb module, which
is part of GNU Emacs.

Some of the breakage can be fixed with defaliases: e.g.,

(defalias 'bbdb-company 'bbdb-search-organization)
(defalias 'bbdb-name 'bbdb-search-name)

But other changes require a more complicated workaround. For instance,
org-bbdb calls bbdb-split, which used to have arguments in the following
order:

--8---cut here---start-8---
(defun bbdb-split (string separators)
--8---cut here---end---8---

The order above makes sense to me, since it is the conventional order of
parameters for split-string functions in emacs. But the new bbdb
reverses the order of the argument, thus breaking compatibility with
org-bbdb.el:

--8---cut here---start-8---
(defun bbdb-split (separator string)
--8---cut here---end---8---

Another issue: bbdb-record-note is not as comprehensive as the
bbdb-record-getprop; i.e., it only works for some fields.

I'd be happy to work on org-bbdb, but since there will likely be users
of bbdb 2.35 for a very long time, workarounds will be a bit tricky.

Similarly I imagine many emacs users have this hook in their .emacs:

(add-hook 'message-setup-hook 'bbdb-define-all-aliases)

If these users upgrade to the newest bbdb, message buffer setup will
fail, since the name of the function has been changed to
bbdb-get-mail-aliases.

 Now that the new code has reached a more mature stage, it could make
 sense to look over it once more for things like defaliases. (Yet this
 might require checking things more carefully, as I also tried to make
 the behavior of BBDB more consistent both with respect to differents
 parts of BBDB as well as compared with other packages of emacs.)

If we are going to break backwards compatibility, perhaps we should
provide a clear list and explanation of all the changes on bbdb home
page.

Please let me know if there's anything I can do to help.

Best,
Matt

--
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/