From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jeckob@gmx.net Newsgroups: gmane.emacs.help Subject: Splitting String Date: 15 Nov 2005 04:17:31 -0800 Organization: http://groups.google.com Message-ID: <1132057051.308997.27730@g49g2000cwa.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: sea.gmane.org 1132062418 28273 80.91.229.2 (15 Nov 2005 13:46:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 15 Nov 2005 13:46:58 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Nov 15 14:46:57 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Ec17e-0007o0-LQ for geh-help-gnu-emacs@m.gmane.org; Tue, 15 Nov 2005 14:45:18 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ec17d-0006fz-S2 for geh-help-gnu-emacs@m.gmane.org; Tue, 15 Nov 2005 08:45:18 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!g49g2000cwa.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 48 Original-NNTP-Posting-Host: 84.168.201.145 Original-X-Trace: posting.google.com 1132057056 13731 127.0.0.1 (15 Nov 2005 12:17:36 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Tue, 15 Nov 2005 12:17:36 +0000 (UTC) User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-DE; rv:1.7.5) Gecko/20041108 Firefox/1.0,gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 algic:8080 (squid/2.5.STABLE4) Complaints-To: groups-abuse@google.com Injection-Info: g49g2000cwa.googlegroups.com; posting-host=84.168.201.145; posting-account=iPNgtw0AAAADVXmtuUc8xtI5c2IiBIhs Original-Xref: shelby.stanford.edu gnu.emacs.help:135466 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:31062 Archived-At: Hi all, having problems with some Code i have written, half of the job is done but now i have problems to get on. here is me code until now : (defun format/align-and-newline () (interactive) (setq anker (point)) (let* ((start (progn (beginning-of-line) (point))) (end (progn (end-of-line) (point))) (line (buffer-substring start end)) (words (split-string line))) (setq testpoint (first words)) (if (setq posDoppel (position ?: line) ) (if (position ?. testpoint) (insert "\n") (delete-region start end) (insert (format "%-10s" (first words))) (dolist (word (cdr words)) (insert (format "%-10s" word))) (if (beginning-of-line) (insert "\n") (setq anker (point))) ) ) ) (goto-char anker) (insert "\n") ) (local-set-key (kbd "RET") (function format/align-and-newline)) ;;end If i type a line like this: abc def ghj klm : nop : qrs : tuv the code transforms the string to: abc def ghj klm : nop : qrs : tuv So, the thing im having problems is to get the string like this : abc def ghj klm : nop : qrs : tuv in other words, if there is a colon typed a space before a word, i need to have the colon with the word to be in the cell of the list, and not the colon alone as a word. So, in the example the list should have 7 elements and not 10. Maybe somebody can give me a hint... thanks in advance greets