From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: bolega Newsgroups: gmane.emacs.help Subject: Re: TERRIBLE ERROR :: Invalid search bound - wrong side of point Date: Thu, 2 Jul 2009 16:35:57 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1246598717 31544 80.91.229.12 (3 Jul 2009 05:25:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 3 Jul 2009 05:25:17 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jul 03 07:25:10 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MMbGl-0004ak-3w for geh-help-gnu-emacs@m.gmane.org; Fri, 03 Jul 2009 07:25:07 +0200 Original-Received: from localhost ([127.0.0.1]:59876 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MMbGk-0007FL-Ba for geh-help-gnu-emacs@m.gmane.org; Fri, 03 Jul 2009 01:25:06 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!24g2000yqm.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.lang.lisp,comp.lang.scheme,comp.unix.shell Original-Lines: 39 Original-NNTP-Posting-Host: 75.31.65.218 Original-X-Trace: posting.google.com 1246577758 18629 127.0.0.1 (2 Jul 2009 23:35:58 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 2 Jul 2009 23:35:58 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 24g2000yqm.googlegroups.com; posting-host=75.31.65.218; posting-account=REkl4woAAABFXaU7nL79XtGpnmNCQ415 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30),gzip(gfe),gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:170535 comp.lang.lisp:270389 comp.lang.scheme:81616 comp.unix.shell:228422 X-Mailman-Approved-At: Fri, 03 Jul 2009 01:21:52 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:65746 Archived-At: 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=A0pm, bolega 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)") > =A0 re-search-forward("$" # t) > =A0 perform-replace("$" "##" nil t nil nil nil 107360 107360) > =A0 replace-regexp("$" "##" nil 107360 107360) > =A0 eval((replace-regexp "$" "##" nil (point) (line-end-position nil))) > =A0 eval-last-sexp-1(nil) > =A0 eval-last-sexp(nil) > * call-interactively(eval-last-sexp) > =A0 recursive-edit()