changeset 94636:3493d476ef0f

Document the fact that (current-local-map) and (urrent-global-map) return references, not copies.
author Eric S. Raymond <esr@snark.thyrsus.com>
date Mon, 05 May 2008 18:13:39 +0000
parents 92e5b9eb3f29
children cb8291c75f39
files doc/lispref/ChangeLog doc/lispref/keymaps.texi
diffstat 2 files changed, 14 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/doc/lispref/ChangeLog	Mon May 05 15:08:59 2008 +0000
+++ b/doc/lispref/ChangeLog	Mon May 05 18:13:39 2008 +0000
@@ -1,3 +1,8 @@
+2008-05-03  Eric S. Raymond  <esr@golux>
+
+	* keymaps.texi: Clarify that (current-local-map) and 
+	(current-global-map) return references, not copies.
+
 2008-05-02  Juri Linkov  <juri@jurta.org>
 
 	* minibuf.texi (Text from Minibuffer): Document a list of
--- a/doc/lispref/keymaps.texi	Mon May 05 15:08:59 2008 +0000
+++ b/doc/lispref/keymaps.texi	Mon May 05 18:13:39 2008 +0000
@@ -766,9 +766,11 @@
 @end defvar
 
 @defun current-global-map
-This function returns the current global keymap.  This is the
-same as the value of @code{global-map} unless you change one or the
-other.
+This function returns the current global keymap.  This is the same as
+the value of @code{global-map} unless you change one or the other.
+The return value is a reference, not a copy; if you use
+@code{define-key} or other functions on it you will alter global
+bindings.
 
 @example
 @group
@@ -802,6 +804,10 @@
 @end example
 @end defun
 
+@code{current-local-map} returns a reference to the local keymap, not
+a copy of it; if you use @code{define-key} or other functions on it 
+you will alter local bindings.
+
 @defun current-minor-mode-maps
 This function returns a list of the keymaps of currently enabled minor modes.
 @end defun