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

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

Re: Tabs (yikes)


From: Karl Pflästerer
Subject: Re: Tabs (yikes)
Date: Tue, 18 Mar 2003 19:40:32 +0100
User-agent: Gnus/5.090016 (Oort Gnus v0.16) Hamster/2.0.0.1

On 18 Mar 2003, Tony Vitonis <- vitonis@comcast.deletethis.net wrote:

>(define-key text-mode-map [tab] 'tab-to-tab-stop)
>(setq tab-stop-list '(3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 48
>51 54 57 60 63 66 69 72 75 78))

>But I can *not* seem to find a way to make it happen using my
>default-tab-width, which I've specified this way:

>Is there any way to make this happen without typing in the long dreary
>list of tab stops?  Thanks very much.

You could write a function which computes the list for you. Here are two
solutions. The first uses recursion, the second one uses iteration but
if you have Gnu Emacs you would have to write `(require 'cl)' to be able
to use it.

(defun return-tabslist (start end &optional step)
  (if (< end start)
    nil
    (cons start
          (return-tabslist (+ start (or step default-tab-width)) end))))

(defun return-tabslist (start end &optional step)
  (loop for x from start to end by (or step default-tab-width)
        collect x))

bye
   KP

-- 
"But it has nothing to do with what a _value_ is.  This has to do with
whether you pass whatever-a-value-is or wherever-whatever-is-a-value-is
whenever you pass an argument to a function.  (Call it the Shakira
theory. :)"       [Erik Naggum in cll über call-by-value und call-by-reference]


reply via email to

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