From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Jordi Burguet Castell Newsgroups: gmane.emacs.help Subject: function to increase numbers in a buffer Date: Tue, 22 Apr 2003 15:50:14 +0200 Organization: University of California, Irvine Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: main.gmane.org 1051052198 4904 80.91.224.249 (22 Apr 2003 22:56:38 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 22 Apr 2003 22:56:38 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 23 00:56:37 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 1986gn-0001Gx-00 for ; Wed, 23 Apr 2003 00:56:37 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 1986fi-0002h8-03 for gnu-help-gnu-emacs@m.gmane.org; Tue, 22 Apr 2003 18:55:30 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsfeed.berkeley.edu!ucberkeley!ihnp4.ucsd.edu!news.service.uci.edu!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 24 Original-NNTP-Posting-Host: decw07.ps.uci.edu User-Agent: KNode/0.7.1 Original-Xref: shelby.stanford.edu gnu.emacs.help:112191 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:8690 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:8690 Hello, I am trying to write a function that would work like query-replace-regexp, but instead of replacing each match with a fixed string, I want the matched numbers to be increased by 3. Or, easier, I have a file that looks like this: 20 1 23523 20 2 23874 20 3 23898 ... and I want to increase all the numbers in the third column by a certain amount, say 3, from (point) to (point-max). A Perl script would not help, because I need to do it several times and from different points. I started following a tutorial in emacs-lisp, and also tried looking at the code of some ".el" files, but it seems that I am still far from being able to do such a simple(?) function. This post is in case some charitable emacs-lisp expert soul knows how to do it. Thanks, Jordi