all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* return of replace-match
@ 2014-03-04 14:42 Phillip Lord
  2014-03-04 15:16 ` Michael Heerdegen
  2014-03-05  7:29 ` Alex Kost
  0 siblings, 2 replies; 7+ messages in thread
From: Phillip Lord @ 2014-03-04 14:42 UTC (permalink / raw)
  To: Help-gnu-emacs



I've been trying out "replace-match". The elisp manual says....

 -- Function: replace-match replacement &optional fixedcase literal
          string subexp
     This function performs a replacement operation on a buffer or
     string.

     If you did the last search in a buffer, you should omit the STRING
     argument or specify `nil' for it, and make sure that the current
     buffer is the one in which you performed the last search.  Then
     this function edits the buffer, replacing the matched text with
     REPLACEMENT.  It leaves point at the end of the replacement text,
     and returns `t'.


However, if I eval the progn below (with bob where it says)

(progn
  (re-search-forward "bob")
  (replace-match "fred"))

bob



point gets moved to the end of "bob" (now "fred") but "nil" is returned.


The docstring doesn't say anything at all about return types (unless
operating over a string.

Am I doing something wrong?

Phil



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

end of thread, other threads:[~2014-03-05 11:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-04 14:42 return of replace-match Phillip Lord
2014-03-04 15:16 ` Michael Heerdegen
2014-03-04 15:33   ` Phillip Lord
2014-03-05  7:29 ` Alex Kost
2014-03-05  9:15   ` Bastien
2014-03-05 10:58     ` Phillip Lord
2014-03-05 11:11     ` Nicolas Richard

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.