help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to increase a number under cursor?


From: Sandip Chitale
Subject: Re: How to increase a number under cursor?
Date: 21 May 2003 09:13:20 -0700

Well, I am not sure if this is what you want but here is a defun
that inserts a template into a file:

(defun insert-template (template &optional count)
  (interactive  "sTemplate: \np")
  (let ((i 1))
    (while (<= i count)
      (insert (format template i))
      (setq i (+ i 1)))))

Type:

C-u 5 M-x insert-template Ret

Prompt in minibuffer:
---------------------------------
Template:
---------------------------------

Type:

% d . C-q C-j Ret

The following is inserted in the buffer:

1.
2.
3.
4.
5.

Wang Yin <wang-y01@mails.tsinghua.edu.cn> wrote in message 
news:<phwugm3tfv.fsf@wangyin.com>...
> Hi,
> 
> I want to record a macro to type flexible numbered lists.
> for example:
> 
> continuous:
> 1. 
> 2.
> 3.
> 4.
> ...
> 
> odd:
> 1.
> 3.
> 5.
> 7.
> ...
> 
> 
> hex:
> 
> 0x9
> 0xA
> 0xB
> 
> octal:
> 007
> 010
> 011
> 
> The only problem I meet is how to increase the number under
> the cursor?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]