all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Decebal <CLDWesterhof@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Why is there no selected region in the second case
Date: Wed, 1 Oct 2008 00:42:15 -0700 (PDT)	[thread overview]
Message-ID: <5cc30fbe-4f2b-4efa-ba88-39abf37cedb7@v15g2000hsa.googlegroups.com> (raw)
In-Reply-To: mailman.20263.1222794037.18990.help-gnu-emacs@gnu.org

On Sep 30, 7:00 pm, Nikolaj Schumacher <m...@nschum.de> wrote:
> Decebal <CLDWester...@gmail.com> 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.  However, in Emacs, the region is
> visually highlighted only when the mark is "active".
>
> Are you sure you want to activate the mark, though?  Normally you would
> save the position in a variable, something like this:
>
> (save-excursion
>   (goto-char (point-min))
>   (let ((beg (point)))
>     (re-search-forward "^=" nil t)
>     (forward-line 2)
>     (delete-region beg (point))))

That is much better yes. I allready did something like that:
  (goto-char (point-min))
  (re-search-forward "^=" nil nil)
  (forward-line 2)
  (delete-region (point-min) (point))
  (re-search-forward "^=" 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.


      parent reply	other threads:[~2008-10-01  7:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-29 16:30 Why is there no selected region in the second case Decebal
2008-09-30 17:00 ` Nikolaj Schumacher
     [not found] ` <mailman.20263.1222794037.18990.help-gnu-emacs@gnu.org>
2008-10-01  7:42   ` Decebal [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5cc30fbe-4f2b-4efa-ba88-39abf37cedb7@v15g2000hsa.googlegroups.com \
    --to=cldwesterhof@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.