From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: daniel@bigwalter.net (Daniel Jensen) Newsgroups: gmane.emacs.help Subject: Re: about register Date: Sun, 22 Apr 2007 12:42:43 +0200 Message-ID: <87vefou1uk.fsf@orme.bigwalter.net> References: <462a0f65$0$27366$ba4acef3@news.orange.fr> <87abx1kab5.fsf@orme.bigwalter.net> <462a5fb1$0$27411$ba4acef3@news.orange.fr> Reply-To: indiscipline@gmail.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1177241716 1230 80.91.229.12 (22 Apr 2007 11:35:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 22 Apr 2007 11:35:16 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Apr 22 13:35:10 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HfaLV-0005FL-5X for geh-help-gnu-emacs@m.gmane.org; Sun, 22 Apr 2007 13:35:09 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HfaQm-00037d-9k for geh-help-gnu-emacs@m.gmane.org; Sun, 22 Apr 2007 07:40:36 -0400 Original-Path: shelby.stanford.edu!newshub.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 38 Original-X-Trace: individual.net Mbub2WPYWW5jQQH4vIbgMg+48VfmEjs5YGgPS34/s89jliWpld X-Face: SNGmwsN&0DaHhS0!*%\@y"Wc^).,<; VsqY#}K/NJ:A Z6_>Md7x$Z9C1%BAu41M'12-8(f2{H*8OsnYv,K+y.szl1K>}{uC/>2?; k[KUiD=$}@z>odk|7Tk7i $A|{j7LhTt!:SdVp5Z, kKA247}--"-QLedxCbw|#&bh=R]Rd)kx{q+T'fG)9ayG`+\@g'3vx1Fd3bl -`3}Guvr!A"Z);"$|]CXW>YR5m"<[L User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.98 (gnu/linux) Cancel-Lock: sha1:wjXifrrf7BkzIlB5iTSpMAQCP2U= Original-Xref: shelby.stanford.edu gnu.emacs.help:147373 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:42977 Archived-At: Le TeXnicien de Surface writes: > Daniel Jensen écrivait/wrote : > >> You are using strings as register names, this is why it does not work. >> The problem lies in how registers are implemented; they are compared >> behind the scenes with the eq predicate. However, strings are not eq. >> Use characters instead (e.g., ?A), > > Thank you, it works. > BTW where could I find such a piece of information about character? > Is it lisp or emacs-specific? You can start with reading the function documentation; `C-h f number-to-register RET' and so on. That has always the most useful information on how to use functions. In this case, it mentions that characters are used to name registers. To find answers to the more general questions, like "But, what is a character anyway?", consult the Emacs Lisp manual. Chapter 2 describes the data types and how you can use them in your programs. Here you will find that characters can be entered with the question mark syntax in Lisp code. The Lisp manual also holds information such as how registers are implemented, but you don't need to know that just to use them. >> or perhaps better do away with the register and use a variable. > > I will try to remember that next time I need such a command ;-) But won't > there be some catch to write the value of the variable in the buffer? It will require extra work to insert a number from a variable -- you have to convert it to a string. But I think your code will be clearer if you use a variable. You can do it like this: (let ((counter 1)) (while ... (insert (number-to-string counter)) (setq counter (+ counter 1))))