From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Le TeXnicien de Surface Newsgroups: gmane.emacs.help Subject: Re: about register Date: Sat, 21 Apr 2007 21:02:07 +0200 Organization: les newsgroups par Orange Message-ID: <462a5fb1$0$27411$ba4acef3@news.orange.fr> References: <462a0f65$0$27366$ba4acef3@news.orange.fr> <87abx1kab5.fsf@orme.bigwalter.net> 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 1177184112 22100 80.91.229.12 (21 Apr 2007 19:35:12 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 21 Apr 2007 19:35:12 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Apr 21 21:35:06 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 1HfLMO-000320-6k for geh-help-gnu-emacs@m.gmane.org; Sat, 21 Apr 2007 21:35:04 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HfLRa-0007qV-Ma for geh-help-gnu-emacs@m.gmane.org; Sat, 21 Apr 2007 15:40:26 -0400 Original-Path: shelby.stanford.edu!newshub.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!proxad.net!193.252.118.146.MISMATCH!news.wanadoo.fr!news.wanadoo.fr!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: KNode/0.10.1 Original-Lines: 33 Original-NNTP-Posting-Date: 21 Apr 2007 21:02:09 CEST Original-NNTP-Posting-Host: 86.207.52.250 Original-X-Trace: 1177182129 news.orange.fr 27411 86.207.52.250:60109 Original-X-Complaints-To: abuse@orange.fr Original-Xref: shelby.stanford.edu gnu.emacs.help:147370 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:42974 Archived-At: Daniel Jensen écrivait/wrote : > Le TeXnicien de Surface writes: > >> I'd like to use the following command: >> (defun complete-pid () >> (interactive) >> (goto-char 0) >> (number-to-register 1 "A") >> (while (re-search-forward "p=PID=0" nil t) >> (insert-register "A") >> (increment-register 1 "A") >> )) >> >> but when emacs finds the first `p=PID=' it says: >> `register does not contain a number' >> and stops. > > 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? > 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? Once again, many thanks. -- Le TeXnicien de Surface