From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: acomber Newsgroups: gmane.emacs.help Subject: Re: elisp how to insert text at end of each line Date: Thu, 11 Apr 2013 07:02:58 -0700 (PDT) Message-ID: <1365688978229-283483.post@n5.nabble.com> References: <1365614909301-283410.post@n5.nabble.com> <87obdmxnhd.fsf@gmail.com> <1365675809309-283460.post@n5.nabble.com> <87vc7tcnfq.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1365688992 2990 80.91.229.3 (11 Apr 2013 14:03:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 11 Apr 2013 14:03:12 +0000 (UTC) To: Help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Apr 11 16:03:16 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UQI5r-0000LE-6Z for geh-help-gnu-emacs@m.gmane.org; Thu, 11 Apr 2013 16:03:15 +0200 Original-Received: from localhost ([::1]:49776 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQI5q-0002sV-F2 for geh-help-gnu-emacs@m.gmane.org; Thu, 11 Apr 2013 10:03:14 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:52274) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQI5d-0002r6-E4 for Help-gnu-emacs@gnu.org; Thu, 11 Apr 2013 10:03:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQI5b-0006cU-Ig for Help-gnu-emacs@gnu.org; Thu, 11 Apr 2013 10:03:01 -0400 Original-Received: from sam.nabble.com ([216.139.236.26]:47588) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQI5b-0006cM-ER for Help-gnu-emacs@gnu.org; Thu, 11 Apr 2013 10:02:59 -0400 Original-Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1UQI5a-0008Cg-8D for Help-gnu-emacs@gnu.org; Thu, 11 Apr 2013 07:02:58 -0700 In-Reply-To: <87vc7tcnfq.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 216.139.236.26 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:90097 Archived-At: Don't know if its useful but as a result of learning from this forum, I implemented like this: (defun do-cols (text)=20 (goto-char (point-min))=20 (while (search-forward "\t" nil t) (replace-match text) ) ) (defun do-rows (text)=20 "convert word tbl to html tbl" (interactive) (goto-char (point-min))=20 (while (not (eobp))=20 (end-of-line)=20 (insert text)=20 (forward-line) ) ) (defun do-table () "convert word tbl to html tbl" (interactive) (goto-char (point-min)) (insert " ") (insert " ") (insert "=09") =20 (do-cols "=09")=20 (do-rows " ") (insert "") (insert "") (insert " ") =20 ) It=E2=80=99s probably the naffest lisp function ever, but it works for me. It requires the only text in the buffer to be the table data and only works on a single table. -- View this message in context: http://emacs.1067599.n5.nabble.com/elisp-how-= to-insert-text-at-end-of-each-line-tp283410p283483.html Sent from the Emacs - Help mailing list archive at Nabble.com.