help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

What is elisp idiom for continue until end of buffer


From: acomber
Subject: What is elisp idiom for continue until end of buffer
Date: Fri, 10 Aug 2012 07:43:17 -0700 (PDT)

I created this elisp function

(defun fmt-tbl () 
  "format Word tables for wiki"
  (interactive)
  (goto-char (point-min))
  (insert "{||-")
 (while (search-forward "\t")
    (delete-backward-char 1)
    (insert "|")
  )
  (goto-char (point-min))
  (while (search-forward "\n")
    (insert "|-")
  )
  (goto-char (point-max))
  (insert "|}")
)

Which fails at  (while (search-forward "\n").  I also tried 
 (while (end-of-line)
   (insert "|-")
 )

But that also didn't work.

How can I repeatedly goto end of line on each line until EOF?




--
View this message in context: 
http://emacs.1067599.n5.nabble.com/What-is-elisp-idiom-for-continue-until-end-of-buffer-tp261116.html
Sent from the Emacs - Help mailing list archive at Nabble.com.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]