Re: [PATCH] custom format functions -- don't use dynamic variable access

2015-05-23 Thread Roland Winkler
On Thu Nov 20 2014 Eric Abrahamsen wrote:
> Attached is a patch that changes how variables are accessed by custom
> field formatting functions. We've been relying on dynamic variable
> access by those functions, but the variables should probably be passed
> in as arguments instead.

This is really about an undocumented experimental feature and I am
curious:  Have you been using it and if yes in what context?

In your patch, I do not see a need to propagate the variable START
which holds the value of point when FORMATFUN is called.  Do you agree?

Also: Have you checked the code whether elsewhere it relies on
dynamic scoping?  I vaguely remember that BBDB used to use this more
often, but the only other instance I found was in bbdb-print.el
which anyway I'd like to rewrite.

`eval'-based code like bbdb-dial-local-prefix-alist is possibly
another candidate for updating.



> --
> >From 8233febf7614290f3375c56ef4be4ceceb9da196 Mon Sep 17 00:00:00 2001
> From: Eric Abrahamsen 
> Date: Thu, 20 Nov 2014 12:31:07 +0800
> Subject: [PATCH] Pass dynamic vars to custom format functions
> 
> * lisp/bbdb.el (bbdb-display-record-multi-line): Custom field-formatting
>   functions should receive relevant variables as arguments, not access
>   them dynamically.
> 
> Proofing for lexical binding.
> ---
>  lisp/bbdb.el | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lisp/bbdb.el b/lisp/bbdb.el
> index ba7423a..f32a74b 100644
> --- a/lisp/bbdb.el
> +++ b/lisp/bbdb.el
> @@ -3789,7 +3789,7 @@ FIELD-LIST is the list of actually displayed FIELDS."
>(setq start (point))
>(cond (;; customized formatting
>   (setq formatfun (intern-soft (format 
> "bbdb-display-%s-multi-line" field)))
> - (funcall formatfun record))
> + (funcall formatfun record indent fmt start))
>  ;; phone
>  ((eq field 'phone)
>   (dolist (phone (bbdb-record-phone record))
> -- 
> 2.1.3
> 
> 
> --
> --
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
> --
> ___
> bbdb-info@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bbdb-info
> BBDB Home Page: http://bbdb.sourceforge.net/

--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


[BBDB] ChangeLog 2015-05-23

2015-05-23 Thread Roland Winkler
On Thu Mar 12 2015 Eric Abrahamsen wrote:
> >> For this issue, this patch ought to do it.
> >
> > The optional arg COMPARE-FN of add-to-list defaults to equal.
> 
> So it does! Here's another.

I have marginally simplified your patch.

2015-05-23  Eric Abrahamsen 
* lisp/bbdb.el (bbdb-record-set-field, bbdb-parse-records): Use
equal for comparison when populating lists of labels.

--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/