changeset 92385:c24471443e22

More info on how to replace make-variable-frame-local.
author Glenn Morris <rgm@gnu.org>
date Sat, 01 Mar 2008 20:31:09 +0000
parents 3cb290e82a4d
children f84562a68d15
files etc/NEWS.22
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/etc/NEWS.22	Sat Mar 01 20:23:36 2008 +0000
+++ b/etc/NEWS.22	Sat Mar 01 20:31:09 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.