aboutsummaryrefslogtreecommitdiffstats
path: root/doc/misc
diff options
context:
space:
mode:
authorKevin Ryde2011-07-03 14:40:59 +0200
committerLars Magne Ingebrigtsen2011-07-03 14:40:59 +0200
commit79414ae4dfe70ef065a4afbcbfbcfbdec359fd8c (patch)
treee4182a0dce626dc3ed80c6bbc25a3c0d18d1767b /doc/misc
parentc7844a276494777c90c57cfbb38d90f64ad2d866 (diff)
downloademacs-79414ae4dfe70ef065a4afbcbfbcfbdec359fd8c.tar.gz
emacs-79414ae4dfe70ef065a4afbcbfbcfbdec359fd8c.zip
* cl.texi (For Clauses): @items for hash-values and key-bindings
to make them more visible when skimming. Add examples of `using' clause to them, examples being clearer than a description in words. Fixes: debbugs:6599
Diffstat (limited to 'doc/misc')
-rw-r--r--doc/misc/ChangeLog7
-rw-r--r--doc/misc/cl.texi33
2 files changed, 29 insertions, 11 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 583bdb411bb..474b7a0efab 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,10 @@
12011-07-03 Kevin Ryde <user42@zip.com.au>
2
3 * cl.texi (For Clauses): @items for hash-values and key-bindings
4 to make them more visible when skimming. Add examples of `using'
5 clause to them, examples being clearer than a description in
6 words (bug#6599).
7
12011-07-01 Alan Mackenzie <acm@muc.de> 82011-07-01 Alan Mackenzie <acm@muc.de>
2 9
3 * cc-mode.texi (Guessing the Style): New page. 10 * cc-mode.texi (Guessing the Style): New page.
diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi
index afe7c94f447..ab54b99138a 100644
--- a/doc/misc/cl.texi
+++ b/doc/misc/cl.texi
@@ -2449,22 +2449,33 @@ one of these types of clauses with other clauses like @code{for ... to}
2449or @code{while}. 2449or @code{while}.
2450 2450
2451@item for @var{var} being the hash-keys of @var{hash-table} 2451@item for @var{var} being the hash-keys of @var{hash-table}
2452This clause iterates over the entries in @var{hash-table}. For each 2452@itemx for @var{var} being the hash-values of @var{hash-table}
2453hash table entry, @var{var} is bound to the entry's key. If you write 2453This clause iterates over the entries in @var{hash-table} with
2454@samp{the hash-values} instead, @var{var} is bound to the values 2454@var{var} bound to each key, or value. A @samp{using} clause can bind
2455of the entries. The clause may be followed by the additional 2455a second variable to the opposite part.
2456term @samp{using (hash-values @var{var2})} (where @code{hash-values} 2456
2457is the opposite word of the word following @code{the}) to cause 2457@example
2458@var{var} and @var{var2} to be bound to the two parts of each 2458(loop for k being the hash-keys of h
2459hash table entry. 2459 using (hash-values v)
2460 do
2461 (message "key %S -> value %S" k v))
2462@end example
2460 2463
2461@item for @var{var} being the key-codes of @var{keymap} 2464@item for @var{var} being the key-codes of @var{keymap}
2465@itemx for @var{var} being the key-bindings of @var{keymap}
2462This clause iterates over the entries in @var{keymap}. 2466This clause iterates over the entries in @var{keymap}.
2463The iteration does not enter nested keymaps but does enter inherited 2467The iteration does not enter nested keymaps but does enter inherited
2464(parent) keymaps. 2468(parent) keymaps.
2465You can use @samp{the key-bindings} to access the commands bound to 2469A @code{using} clause can access both the codes and the bindings
2466the keys rather than the key codes, and you can add a @code{using} 2470together.
2467clause to access both the codes and the bindings together. 2471
2472@example
2473(loop for c being the key-codes of (current-local-map)
2474 using (key-bindings b)
2475 do
2476 (message "key %S -> binding %S" c b))
2477@end example
2478
2468 2479
2469@item for @var{var} being the key-seqs of @var{keymap} 2480@item for @var{var} being the key-seqs of @var{keymap}
2470This clause iterates over all key sequences defined by @var{keymap} 2481This clause iterates over all key sequences defined by @var{keymap}