unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* TERRIBLE ERROR :: Invalid search bound - wrong side of point
@ 2009-07-02 23:16 bolega
  2009-07-02 23:35 ` bolega
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: bolega @ 2009-07-02 23:16 UTC (permalink / raw)
  To: help-gnu-emacs

I am doing a very simple and trivial thing that you often do in bash
using sed. Replace the end of the line by a token such as #.

I loath to use newline which is a break in emacs since it probably
does not accept \n.


I only want to replace this on one line such as the current line. I
could narrow to the line but is it really necessary ? Cant I just
specify the limits in replace-regexp ? Either there is something
seriously wrong with my understanding of emacs so I must pursue this
for the sake of learning.

I tried several variants:

(replace-regexp "$" "#" nil (line-beginning-position) (line-end-
position nil) )
(replace-regexp "$" "#" nil (line-beginning-position) (+ (line-end-
position nil) 1))


And why is a first nil needed ? Cant it be a t ?

Here is the error listing.

Debugger entered--Lisp error: (error "Invalid search bound (wrong side
of point)")
  re-search-forward("$" #<marker at 107360 in file.txt> t)
  perform-replace("$" "##" nil t nil nil nil 107360 107360)
  replace-regexp("$" "##" nil 107360 107360)
  eval((replace-regexp "$" "##" nil (point) (line-end-position nil)))
  eval-last-sexp-1(nil)
  eval-last-sexp(nil)
* call-interactively(eval-last-sexp)
  recursive-edit()



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

end of thread, other threads:[~2009-07-03  7:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-02 23:16 TERRIBLE ERROR :: Invalid search bound - wrong side of point bolega
2009-07-02 23:35 ` bolega
2009-07-03  3:42 ` Pillsy
2009-07-03  4:46   ` bolega
2009-07-03  7:16     ` Thien-Thi Nguyen
2009-07-03  7:47 ` TomSW

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).