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.

Eric

>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/

Reply via email to