[Top][All Lists]

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

Re: fill comma separated list

From: Emanuel Berg
Subject: Re: fill comma separated list
Date: Thu, 19 May 2016 15:12:52 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

papab <address@hidden> writes:

> I have a whole bunch of sequences of numbers,
> like this: 5.1816, -3.81, 4.8768, 5.1816,
> -4.4196, 4.8768, 6.4008, -4.4196, 5.48640,
> 6.4008, -3.81, 5.486400;
> I'd like to be able to make it look like this
> easily: 5.1816, -3.81, 4.8768, 5.1816,
> -4.4196, 4.8768, 6.4008, -4.4196, 5.486400,
> 6.4008, -3.81, 5.48640
> 3 numbers per row. Suggestions?
> Some variation of fill-paragraph?

You want to separate data, programming
(modification of the data), and interface
(display of the result).

Here, there is no modification of the data, but
you still want the display (interface) to be
programmable, as sometime in the future perhaps
you want four data items per row and then it'll
be super-fast to change the digit 3 into a 4
with no other change necessary!

This is called MVC but what happens when people
explain and/or define that is that everyone
gets confused and irritated. But it is
actually simple!

So if you understood my description as I think
you did, *don't* read the Wikipedia article on
MVC! [1]

I'd do:

    1. Put the data in a text file with no
       commas and one and only one data item
       per line.

    2. Write a defun that reads that into
       a Lisp list.

    3. Write a defun that iterates the list and
       prints a newline for every X items, 3 in
       your case.

Tell me if you need help with any of those
steps :)

[1] Hey, I told you not to read it!

underground experts united ....
Emacs Gnus Blogomatic .........
                   - so far: 34 Blogomatic articles -                   

reply via email to

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