From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Pillsy Newsgroups: gmane.emacs.help Subject: Re: TERRIBLE ERROR :: Invalid search bound - wrong side of point Date: Thu, 2 Jul 2009 20:42:00 -0700 (PDT) Organization: http://groups.google.com Message-ID: <30ad1c47-f7b3-4eaa-a374-47edff9a6831@26g2000yqk.googlegroups.com> 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 1246598878 31841 80.91.229.12 (3 Jul 2009 05:27:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 3 Jul 2009 05:27:58 +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:27:51 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 1MMbJO-0005Ez-Ci for geh-help-gnu-emacs@m.gmane.org; Fri, 03 Jul 2009 07:27:50 +0200 Original-Received: from localhost ([127.0.0.1]:60635 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MMbJN-0000R2-Ik for geh-help-gnu-emacs@m.gmane.org; Fri, 03 Jul 2009 01:27:49 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!26g2000yqk.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.lang.lisp,comp.lang.scheme,comp.unix.shell Original-Lines: 35 Original-NNTP-Posting-Host: 96.255.112.15 Original-X-Trace: posting.google.com 1246592521 2895 127.0.0.1 (3 Jul 2009 03:42:01 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 3 Jul 2009 03:42:01 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 26g2000yqk.googlegroups.com; posting-host=96.255.112.15; posting-account=h42mRQoAAABXTmoqSUbnZRvVH2KqL98p User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; en-us) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Safari/530.17, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:170537 comp.lang.lisp:270402 comp.lang.scheme:81624 comp.unix.shell:228429 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:65748 Archived-At: On Jul 2, 7:16=A0pm, bolega wrote: [...] > 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. You should probably try comp.emacs or gnu.help.emacs, too, since this group focuses almost entirely on the Common Lisp dialect of Lisp. Nonetheless, I'll take a stab at answering your question. > 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)) Well, one thing that works is to capture the text of the line as a group, like so: (replace-regexp "^\\(.*\\)$" "\\1#" nil (line-beginning-position) (line-end-position)) However, if you just want to stick a character onto the end of the line, why not just move the point there and insert the character instead of using regexps? (save-excursion (end-of-line) (insert "#")) HTH, Pillsy