From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: bolega Newsgroups: gmane.emacs.help Subject: TERRIBLE ERROR :: Invalid search bound - wrong side of point Date: Thu, 2 Jul 2009 16:16:30 -0700 (PDT) Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1246598631 31374 80.91.229.12 (3 Jul 2009 05:23:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 3 Jul 2009 05:23:51 +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:23:44 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 1MMbFQ-0004HJ-9Z for geh-help-gnu-emacs@m.gmane.org; Fri, 03 Jul 2009 07:23:44 +0200 Original-Received: from localhost ([127.0.0.1]:59379 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MMbFP-0006E9-9I for geh-help-gnu-emacs@m.gmane.org; Fri, 03 Jul 2009 01:23:43 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!y7g2000yqa.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.lang.lisp,comp.lang.scheme,comp.unix.shell Original-Lines: 36 Original-NNTP-Posting-Host: 75.28.138.153 Original-X-Trace: posting.google.com 1246576590 13819 127.0.0.1 (2 Jul 2009 23:16:30 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 2 Jul 2009 23:16:30 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: y7g2000yqa.googlegroups.com; posting-host=75.28.138.153; 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:170534 comp.lang.lisp:270388 comp.lang.scheme:81613 comp.unix.shell:228421 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:65745 Archived-At: 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("$" # 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()