unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Using append to create a list from a line of text
@ 2013-04-16  9:58 acomber
  2013-04-16 10:05 ` Christopher Schmidt
  2013-04-16 13:10 ` Drew Adams
  0 siblings, 2 replies; 6+ messages in thread
From: acomber @ 2013-04-16  9:58 UTC (permalink / raw)
  To: Help-gnu-emacs

I want to create a list of words from a line of text delimitted by tabs. I
want to basically split the line into atoms, split by tab.

The code below is sort of pseudocode but is this the best approach to do
this type of thing?

Here is my first attempt:-

(defun get-hdr()
    ;obviously point must be positioned on correct line
    (let (mylist)
      while(not (end-of-line)
         while(re-search-forward ("[A-Za-z]+[^\t\n]" nil t)
           append (match-string 1) mylist      
         )
      )
   )
)

How do I get my function to return the list, mylist?




--
View this message in context: http://emacs.1067599.n5.nabble.com/Using-append-to-create-a-list-from-a-line-of-text-tp283808.html
Sent from the Emacs - Help mailing list archive at Nabble.com.



^ permalink raw reply	[flat|nested] 6+ messages in thread
[parent not found: <mailman.24205.1366106299.855.help-gnu-emacs@gnu.org>]

end of thread, other threads:[~2013-04-17 18:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-16  9:58 Using append to create a list from a line of text acomber
2013-04-16 10:05 ` Christopher Schmidt
2013-04-16 13:10 ` Drew Adams
     [not found] <mailman.24205.1366106299.855.help-gnu-emacs@gnu.org>
2013-04-16 20:51 ` Pascal J. Bourguignon
2013-04-17 16:27   ` Barry Margolin
2013-04-17 18:23     ` Pascal J. Bourguignon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).