[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: TERRIBLE ERROR :: Invalid search bound - wrong side of point
From: |
bolega |
Subject: |
Re: TERRIBLE ERROR :: Invalid search bound - wrong side of point |
Date: |
Thu, 2 Jul 2009 16:35:57 -0700 (PDT) |
User-agent: |
G2/1.0 |
To save trouble to myself, I searched the whole of google for the
error but no luck. One issue is the "$" which confuses any search
engine.
On Jul 2, 4:16 pm, bolega <gnuist...@gmail.com> wrote:
> 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()