From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Oliver Scholz Newsgroups: gmane.emacs.help Subject: Re: How to increase a number under cursor? Date: Tue, 20 May 2003 15:34:32 +0200 Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1053438088 15635 80.91.224.249 (20 May 2003 13:41:28 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 20 May 2003 13:41:28 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Tue May 20 15:41:26 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19I7LY-0003yJ-00 for ; Tue, 20 May 2003 15:40:04 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19I7Lv-00009Y-6b for gnu-help-gnu-emacs@m.gmane.org; Tue, 20 May 2003 09:40:27 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!skynet.be!skynet.be!fu-berlin.de!uni-berlin.de!dialin-145-254-192-227.arcor-ip.NET!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 44 Original-NNTP-Posting-Host: dialin-145-254-192-227.arcor-ip.net (145.254.192.227) Original-X-Trace: fu-berlin.de 1053437735 29399969 145.254.192.227 (16 [87814]) X-Attribution: os X-Face: "HgH2sgK|bfH$; PiOJI6|qUCf.ve<51_Od(%ynHr?=>znn#~#oS>",F%B8&\vus),2AsPYb -n>PgddtGEn}s7kH?7kH{P_~vu?]OvVN^qD(L)>G^gDCl(U9n{:d>'DkilN!_K"eNzjrtI4Ya6;Td% IZGMbJ{lawG+'J>QXPZD&TwWU@^~A}f^zAb[Ru;CT(UA]c& User-Agent: Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.3.50 (windows-nt) Cancel-Lock: sha1:gl6w/sqANr9C1BdtmNh2SQG7qbE= Original-Xref: shelby.stanford.edu gnu.emacs.help:113428 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:9923 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:9923 Wang Yin writes: > Hi, > > I want to record a macro to type flexible numbered lists. > for example: Are you talking about a keyboard macro? [...] > The only problem I meet is how to increase the number under > the cursor? It is not clear to me what you want here. Do you simply want a function that deletes the number at point and inserts number + X into the buffer again? What do you want to achieve? If you simply want a skeleton for lists, you could use something like this: (defun wy-list-skel () (interactive) (let ((num 0)) (skeleton-insert '(nil ("Type something: " (number-to-string (setq num (1+ num))) ". " str "\n"))))) Hexadezimal: (defun wy-hex-list-skel () (interactive) (let ((num 0)) (skeleton-insert '(nil ("Type something: " (format "0x%02x" (setq num (1+ num))) ". " str "\n"))))) Oliver -- 1 Prairial an 211 de la Révolution Liberté, Egalité, Fraternité!