changeset 80262:22717831546c

More info on how to replace make-variable-frame-local.
author Glenn Morris <rgm@gnu.org>
date Sat, 01 Mar 2008 20:30:51 +0000
parents 4af0bb174714
children 5a10ddb5551f
files etc/NEWS
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/etc/NEWS	Sat Mar 01 19:16:02 2008 +0000
+++ b/etc/NEWS	Sat Mar 01 20:30:51 2008 +0000
@@ -135,7 +135,15 @@
 * Lisp Changes in Emacs 22.2.
 
 ** Frame-local variables are deprecated and are slated for removal.
-Use frame parameters instead.
+They can easily be emulated.  Rather than calling `make-variable-frame-local'
+and accessing the variable value directly, explicitly check for a
+frame-parameter, and if there is one, use its value in preference to
+that of the variable. Eg:
+(let ((fp (assoc 'var (frame-parameters))))
+  ;; Use frame-parameter, even if nil.
+  (if fp (cdr fp)
+     ;; Else use normal variable value.
+     var))
 
 ** The function invisible-p returns non-nil if the character
 after a specified position is invisible.