From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Decebal Newsgroups: gmane.emacs.help Subject: Re: Why is there no selected region in the second case Date: Wed, 1 Oct 2008 00:42:15 -0700 (PDT) Organization: http://groups.google.com Message-ID: <5cc30fbe-4f2b-4efa-ba88-39abf37cedb7@v15g2000hsa.googlegroups.com> References: <66c7838f-7c1c-4ddc-b7f3-f99144b9514d@79g2000hsk.googlegroups.com> 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 1222850914 14761 80.91.229.12 (1 Oct 2008 08:48:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 1 Oct 2008 08:48:34 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 01 10:49:32 2008 connect(): Connection refused 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 1KkxOm-0001eB-8E for geh-help-gnu-emacs@m.gmane.org; Wed, 01 Oct 2008 10:49:32 +0200 Original-Received: from localhost ([127.0.0.1]:58883 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KkxHe-0008DC-SR for geh-help-gnu-emacs@m.gmane.org; Wed, 01 Oct 2008 04:42:10 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!v15g2000hsa.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 32 Original-NNTP-Posting-Host: 84.53.123.169 Original-X-Trace: posting.google.com 1222846935 13338 127.0.0.1 (1 Oct 2008 07:42:15 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 1 Oct 2008 07:42:15 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: v15g2000hsa.googlegroups.com; posting-host=84.53.123.169; posting-account=K-cdeAoAAAD_0d505kUtHXJaT5LFIu-3 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; nl; rv:1.9.0.1) Gecko/2008070206 Firefox/3.0.1,gzip(gfe),gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:162899 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:58240 Archived-At: On Sep 30, 7:00=A0pm, Nikolaj Schumacher wrote: > Decebal wrote: > > The first push-mark works and I can delete with delete-region. But the > > second does not work. There is no region selected after the last two > > statements. What am I doing wrong? > > Actually the second one works, too. =A0However, in Emacs, the region is > visually highlighted only when the mark is "active". > > Are you sure you want to activate the mark, though? =A0Normally you would > save the position in a variable, something like this: > > (save-excursion > =A0 (goto-char (point-min)) > =A0 (let ((beg (point))) > =A0 =A0 (re-search-forward "^=3D" nil t) > =A0 =A0 (forward-line 2) > =A0 =A0 (delete-region beg (point)))) That is much better yes. I allready did something like that: (goto-char (point-min)) (re-search-forward "^=3D" nil nil) (forward-line 2) (delete-region (point-min) (point)) (re-search-forward "^=3D" nil nil) (beginning-of-line) (delete-region (point) (point-max)) Because the buffer has to be deleted from the beginning, I do not need to save the point. But otherwise it should be done offcourse. Thanks for the info.