From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 09 20:10:13 2010 Received: (at submit) by debbugs.gnu.org; 10 Jul 2010 00:10:13 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OXNe1-0000KN-GZ for submit@debbugs.gnu.org; Fri, 09 Jul 2010 20:10:13 -0400 Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OXNdy-0000KI-H2 for submit@debbugs.gnu.org; Fri, 09 Jul 2010 20:10:11 -0400 Received: from lists.gnu.org ([199.232.76.165]:52891) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OXNdu-00032Z-OQ for submit@debbugs.gnu.org; Fri, 09 Jul 2010 20:10:06 -0400 Received: from [140.186.70.92] (port=43988 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OXNdr-0005fC-Ea for bug-gnu-emacs@gnu.org; Fri, 09 Jul 2010 20:10:06 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, T_TVD_MIME_NO_HEADERS autolearn=unavailable version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OXNSf-0004e3-PV for bug-gnu-emacs@gnu.org; Fri, 09 Jul 2010 19:58:31 -0400 Received: from mailout1-3.pacific.net.au ([61.8.2.210]:40465 helo=mailout1.pacific.net.au) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OXNSf-0004dc-4i for bug-gnu-emacs@gnu.org; Fri, 09 Jul 2010 19:58:29 -0400 Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.2.163]) by mailout1.pacific.net.au (Postfix) with ESMTP id 0D2EE5BD713 for ; Sat, 10 Jul 2010 09:58:25 +1000 (EST) Received: from blah.blah (ppp2CED.dyn.pacific.net.au [61.8.44.237]) by mailproxy2.pacific.net.au (Postfix) with ESMTP id 08F1B27406 for ; Sat, 10 Jul 2010 09:58:24 +1000 (EST) Received: from gg by blah.blah with local (Exim 4.72) (envelope-from ) id 1OXNSF-0005a9-Dd for bug-gnu-emacs@gnu.org; Sat, 10 Jul 2010 09:58:03 +1000 From: Kevin Ryde To: bug-gnu-emacs@gnu.org Subject: 23.2; cl.texi docs loop hash-values Date: Sat, 10 Jul 2010 09:58:03 +1000 Message-ID: <87mxu0i4xg.fsf@blah.blah> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -5.6 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.6 (-----) --=-=-= In the cl.texi docs for the `loop' macro I had to read a few times before noticing the way hash values are accessed. I think showing as items and adding an example would make it easier for the newcomer :-). 2010-07-09 Kevin Ryde * 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. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=cl.texi.hash-values.diff --- cl.texi.~1.15.~ 2009-11-27 18:28:09.000000000 +1100 +++ cl.texi 2010-07-10 09:50:54.000000000 +1000 @@ -2476,22 +2476,33 @@ or @code{while}. @item for @var{var} being the hash-keys of @var{hash-table} -This clause iterates over the entries in @var{hash-table}. For each -hash table entry, @var{var} is bound to the entry's key. If you write -@samp{the hash-values} instead, @var{var} is bound to the values -of the entries. The clause may be followed by the additional -term @samp{using (hash-values @var{var2})} (where @code{hash-values} -is the opposite word of the word following @code{the}) to cause -@var{var} and @var{var2} to be bound to the two parts of each -hash table entry. +@itemx for @var{var} being the hash-values of @var{hash-table} +This clause iterates over the entries in @var{hash-table} with +@var{var} bound to each key, or value. A @samp{using} clause can bind +a second variable to the opposite part. + +@example +(loop for k being the hash-keys of h + using (hash-values v) + do + (message "key %S -> value %S" k v)) +@end example @item for @var{var} being the key-codes of @var{keymap} +@itemx for @var{var} being the key-bindings of @var{keymap} This clause iterates over the entries in @var{keymap}. The iteration does not enter nested keymaps but does enter inherited (parent) keymaps. -You can use @samp{the key-bindings} to access the commands bound to -the keys rather than the key codes, and you can add a @code{using} -clause to access both the codes and the bindings together. +A @code{using} clause can access both the codes and the bindings +together. + +@example +(loop for c being the key-codes of (current-local-map) + using (key-bindings b) + do + (message "key %S -> binding %S" c b)) +@end example + @item for @var{var} being the key-seqs of @var{keymap} This clause iterates over all key sequences defined by @var{keymap} --=-=-= In GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.0) of 2010-05-16 on raven, modified by Debian configured using `configure '--build' 'i486-linux-gnu' '--build' 'i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.2/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.2/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS='' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_AU value of $XMODIFIERS: nil locale-coding-system: iso-latin-1-unix default enable-multibyte-characters: t --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 03 08:42:10 2011 Received: (at control) by debbugs.gnu.org; 3 Jul 2011 12:42:10 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QdM02-0003aY-4y for submit@debbugs.gnu.org; Sun, 03 Jul 2011 08:42:10 -0400 Received: from hermes.netfonds.no ([80.91.224.195]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QdM01-0003aN-3F for control@debbugs.gnu.org; Sun, 03 Jul 2011 08:42:09 -0400 Received: from cm-84.215.51.58.getinternet.no ([84.215.51.58] helo=quimbies.gnus.org) by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1QdLzq-0007nV-BJ for control@debbugs.gnu.org; Sun, 03 Jul 2011 14:41:58 +0200 Date: Sun, 03 Jul 2011 14:41:57 +0200 Message-Id: To: control@debbugs.gnu.org From: Lars Magne Ingebrigtsen Subject: control message for bug #6599 X-MailScanner-ID: 1QdLzq-0007nV-BJ X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1310301718.41163@oiNlnj9IO5+lBrPg8okghw X-Spam-Status: No X-Spam-Score: -2.8 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.8 (--) tags 6599 fixed close 6599 24.1 From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 03 08:49:37 2011 Received: (at 6599) by debbugs.gnu.org; 3 Jul 2011 12:49:37 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QdM7E-0004aj-M0 for submit@debbugs.gnu.org; Sun, 03 Jul 2011 08:49:37 -0400 Received: from hermes.netfonds.no ([80.91.224.195]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QdM7D-0004aO-9r for 6599@debbugs.gnu.org; Sun, 03 Jul 2011 08:49:35 -0400 Received: from cm-84.215.51.58.getinternet.no ([84.215.51.58] helo=quimbies.gnus.org) by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1QdM70-0007v2-9i; Sun, 03 Jul 2011 14:49:22 +0200 From: Lars Magne Ingebrigtsen To: Kevin Ryde Subject: Re: 23.2; cl.texi docs loop hash-values In-Reply-To: <87mxu0i4xg.fsf@blah.blah> (Kevin Ryde's message of "Sat, 10 Jul 2010 09:58:03 +1000") Date: Sun, 03 Jul 2011 14:41:52 +0200 Message-ID: References: <87mxu0i4xg.fsf@blah.blah> User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux) X-Now-Playing: David Sylvian's _Manafon_: "Manafon" X-Hashcash: 1:23:110703:6599@debbugs.gnu.org::X9+O7hcO/bZFcl0D:00000000000000000000000000000000000000000Ehxx X-Hashcash: 1:23:110703:user42@zip.com.au::tUx1g3bj0fRC0V+T:00000000000000000000000000000000000000000000f338 MIME-Version: 1.0 Content-Type: text/plain X-MailScanner-ID: 1QdM70-0007v2-9i X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1310302162.40914@J0HY41D6QbK2nvYTc4fPIA X-Spam-Status: No X-Spam-Score: -2.8 (--) X-Debbugs-Envelope-To: 6599 Cc: 6599@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.8 (--) Kevin Ryde writes: > In the cl.texi docs for the `loop' macro I had to read a few times > before noticing the way hash values are accessed. I think showing as > items and adding an example would make it easier for the newcomer :-). Yes, I think your version clarifies things greatly. I've applied it to Emacs 24. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog http://lars.ingebrigtsen.no/ From unknown Mon Jun 23 18:30:42 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 01 Aug 2011 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator