all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: acomber <deedexy@gmail.com>
To: Help-gnu-emacs@gnu.org
Subject: Using append to create a list from a line of text
Date: Tue, 16 Apr 2013 02:58:14 -0700 (PDT)	[thread overview]
Message-ID: <1366106294207-283808.post@n5.nabble.com> (raw)

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.



             reply	other threads:[~2013-04-16  9:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-16  9:58 acomber [this message]
2013-04-16 10:05 ` Using append to create a list from a line of text 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

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=1366106294207-283808.post@n5.nabble.com \
    --to=deedexy@gmail.com \
    --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.