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 <address@hidden> wrote in message news:<address@hidden>...
> 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]