all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Emanuel Berg <embe8573@student.uu.se>
To: help-gnu-emacs@gnu.org
Subject: Re: fill comma separated list
Date: Thu, 19 May 2016 15:12:52 +0200	[thread overview]
Message-ID: <86k2iq8a3v.fsf@student.uu.se> (raw)
In-Reply-To: 31550a04-e2c8-4169-9818-b392379237af@googlegroups.com

papab <brad.r.haack@gmail.com> 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 .... http://user.it.uu.se/~embe8573
Emacs Gnus Blogomatic ......... http://user.it.uu.se/~embe8573/blogomatic
                   - so far: 34 Blogomatic articles -                   


  reply	other threads:[~2016-05-19 13:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-19 13:02 fill comma separated list papab
2016-05-19 13:12 ` Emanuel Berg [this message]
2016-06-02 16:08   ` Kaushal Modi
     [not found]   ` <mailman.702.1464883755.1216.help-gnu-emacs@gnu.org>
2016-06-02 17:11     ` Emanuel Berg
2016-06-02 16:41 ` Jorge A. Alfaro-Murillo
2016-06-02 17:47   ` Kaushal Modi
2016-06-02 18:36     ` Jorge A. Alfaro-Murillo
2016-06-02 18:50       ` Jorge A. Alfaro-Murillo
2016-06-02 19:06       ` Kaushal Modi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86k2iq8a3v.fsf@student.uu.se \
    --to=embe8573@student.uu.se \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.