all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* elisp search-forward problem - function stops on search failed error
@ 2013-04-11 11:24 acomber
  2013-04-11 12:35 ` Tassilo Horn
  2013-04-11 12:48 ` Andreas Röhler
  0 siblings, 2 replies; 3+ messages in thread
From: acomber @ 2013-04-11 11:24 UTC (permalink / raw)
  To: Help-gnu-emacs

I wrote a function to replace tab characters with a string as in:

(defun do-cols () 
  "convert tab char to html td delim"
  (interactive)
  (goto-char (point-min)) 
     (while (search-forward "\t")
        (insert "
")
     )
) 

which works fine but on finishing I see in the command window: Search
failed: "    "

I think that when this error occurs the lisp function stops running.
That doesn't matter for simple use of do-cols but I want to call the
function from a bigger lisp function and I think if this error occurs
then the calling lisp function stops processing.

so anyway, I changed the function like this:

(defun do-cols () 
  "convert tab char to html td delim"
  (interactive)
  (goto-char (point-min)) 
     (while (search-forward "\t", nil, t)
        (insert "
")
     )
)

But this function does nothing, get error:

Symbol's value as variable is void: \,

How can I fix do-cols so it actually works and will allow a calling
function to continue processing to next line?

eg I might want:

(defun do-table () 
  "convert word table to html"
  (interactive)
  (goto-char (point-min)) 
  (do-cols)
  (do-rows)
)




--
View this message in context: http://emacs.1067599.n5.nabble.com/elisp-search-forward-problem-function-stops-on-search-failed-error-tp283469.html
Sent from the Emacs - Help mailing list archive at Nabble.com.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-04-11 12:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-11 11:24 elisp search-forward problem - function stops on search failed error acomber
2013-04-11 12:35 ` Tassilo Horn
2013-04-11 12:48 ` Andreas Röhler

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.