all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* List into Columns
@ 2004-06-23 15:18 Artist
  2004-06-23 16:22 ` Brendan Halpin
  0 siblings, 1 reply; 5+ messages in thread
From: Artist @ 2004-06-23 15:18 UTC (permalink / raw)


How I can convert a list into columns , in the similar way `ls` does on unix.

Thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: List into Columns
  2004-06-23 15:18 List into Columns Artist
@ 2004-06-23 16:22 ` Brendan Halpin
  2004-06-24 15:09   ` Artist
  0 siblings, 1 reply; 5+ messages in thread
From: Brendan Halpin @ 2004-06-23 16:22 UTC (permalink / raw)


googleartist@yahoo.com (Artist) writes:

> How I can convert a list into columns , in the similar way `ls` does on unix.

Does this give you a clue?:

(setq mylist '("one" "two" "three and a half"))
(dolist (element mylist) 
        (insert (format "%s\n" element)))

If not, explain a bit more.

Brendan
-- 
Brendan Halpin,  Department of Sociology,  University of Limerick,  Ireland
Tel: w +353-61-213147 f +353-61-202569 h +353-61-390476; Room F2-025 x 3147
mailto:brendan.halpin@ul.ie  http://www.ul.ie/sociology/brendan.halpin.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: List into Columns
  2004-06-23 16:22 ` Brendan Halpin
@ 2004-06-24 15:09   ` Artist
  2004-06-25  8:32     ` Brendan Halpin
  0 siblings, 1 reply; 5+ messages in thread
From: Artist @ 2004-06-24 15:09 UTC (permalink / raw)


Brendan Halpin <brendan.halpin@ul.ie> wrote in message news:<877jtynt0o.fsf@wivenhoe.staff8.ul.ie>...
> googleartist@yahoo.com (Artist) writes:
> 
> > How I can convert a list into columns , in the similar way `ls` does on unix.
> 
> Does this give you a clue?:
> 
> (setq mylist '("one" "two" "three and a half"))
> (dolist (element mylist) 
>         (insert (format "%s\n" element)))
> 
> If not, explain a bit more.
> 
> Brendan

It is actually divided into columns according to the width of the item
and width of the 'screen'.

Example:
ls -1 =>

a
b
b2222222222222222222222222222222222222
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
c
d
e


ls =>
a  b2222222222222222222222222222222222222        c  e
b  bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb  d

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: List into Columns
  2004-06-24 15:09   ` Artist
@ 2004-06-25  8:32     ` Brendan Halpin
  2004-06-25 17:14       ` Artist
  0 siblings, 1 reply; 5+ messages in thread
From: Brendan Halpin @ 2004-06-25  8:32 UTC (permalink / raw)


googleartist@yahoo.com (Artist) writes:

> Example:
> ls -1 =>
> 
> a
> b
> b2222222222222222222222222222222222222
> bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
> c
> d
> e
> 
> 
> ls =>
> a  b2222222222222222222222222222222222222        c  e
> b  bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb  d


If you're on Unix, the shell command "column" will do this for you.
In Emacs, mark your list, do "C-u ESC | column RET" -- that is,
run shell-command-on-region on your list, giving "column" as the
region. "M-x man RET column RET" tells more.

Brendan

-- 
Brendan Halpin,  Department of Sociology,  University of Limerick,  Ireland
Tel: w +353-61-213147 f +353-61-202569 h +353-61-390476; Room F2-025 x 3147
mailto:brendan.halpin@ul.ie  http://www.ul.ie/sociology/brendan.halpin.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: List into Columns
  2004-06-25  8:32     ` Brendan Halpin
@ 2004-06-25 17:14       ` Artist
  0 siblings, 0 replies; 5+ messages in thread
From: Artist @ 2004-06-25 17:14 UTC (permalink / raw)


Brendan Halpin <brendan.halpin@ul.ie> wrote in message news:<87fz8kox65.fsf@wivenhoe.staff8.ul.ie>...
> googleartist@yahoo.com (Artist) writes:
[Snipped]....
>
> 
> 
> If you're on Unix, the shell command "column" will do this for you.
> In Emacs, mark your list, do "C-u ESC | column RET" -- that is,
> run shell-command-on-region on your list, giving "column" as the
> region. "M-x man RET column RET" tells more.
> 
> Brendan
Exactly.. Thank you, Brendan.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-06-25 17:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-23 15:18 List into Columns Artist
2004-06-23 16:22 ` Brendan Halpin
2004-06-24 15:09   ` Artist
2004-06-25  8:32     ` Brendan Halpin
2004-06-25 17:14       ` Artist

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.