[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
TERRIBLE ERROR :: Invalid search bound - wrong side of point
From: |
bolega |
Subject: |
TERRIBLE ERROR :: Invalid search bound - wrong side of point |
Date: |
Thu, 2 Jul 2009 16:16:30 -0700 (PDT) |
User-agent: |
G2/1.0 |
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()
- TERRIBLE ERROR :: Invalid search bound - wrong side of point,
bolega <=