diff options
| author | Kevin Ryde | 2011-07-03 14:40:59 +0200 |
|---|---|---|
| committer | Lars Magne Ingebrigtsen | 2011-07-03 14:40:59 +0200 |
| commit | 79414ae4dfe70ef065a4afbcbfbcfbdec359fd8c (patch) | |
| tree | e4182a0dce626dc3ed80c6bbc25a3c0d18d1767b /doc/misc | |
| parent | c7844a276494777c90c57cfbb38d90f64ad2d866 (diff) | |
| download | emacs-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/ChangeLog | 7 | ||||
| -rw-r--r-- | doc/misc/cl.texi | 33 |
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 @@ | |||
| 1 | 2011-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 | |||
| 1 | 2011-07-01 Alan Mackenzie <acm@muc.de> | 8 | 2011-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} | |||
| 2449 | or @code{while}. | 2449 | or @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} |
| 2452 | This clause iterates over the entries in @var{hash-table}. For each | 2452 | @itemx for @var{var} being the hash-values of @var{hash-table} |
| 2453 | hash table entry, @var{var} is bound to the entry's key. If you write | 2453 | This 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 |
| 2455 | of the entries. The clause may be followed by the additional | 2455 | a second variable to the opposite part. |
| 2456 | term @samp{using (hash-values @var{var2})} (where @code{hash-values} | 2456 | |
| 2457 | is 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 |
| 2459 | hash 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} | ||
| 2462 | This clause iterates over the entries in @var{keymap}. | 2466 | This clause iterates over the entries in @var{keymap}. |
| 2463 | The iteration does not enter nested keymaps but does enter inherited | 2467 | The iteration does not enter nested keymaps but does enter inherited |
| 2464 | (parent) keymaps. | 2468 | (parent) keymaps. |
| 2465 | You can use @samp{the key-bindings} to access the commands bound to | 2469 | A @code{using} clause can access both the codes and the bindings |
| 2466 | the keys rather than the key codes, and you can add a @code{using} | 2470 | together. |
| 2467 | clause 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} |
| 2470 | This clause iterates over all key sequences defined by @var{keymap} | 2481 | This clause iterates over all key sequences defined by @var{keymap} |