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 <e...@ericabrahamsen.net> > 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/