unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Emanuel Berg <moasen@zoho.com>
To: help-gnu-emacs@gnu.org
Subject: Re: mixing argument types
Date: Mon, 27 Aug 2018 22:07:24 +0200	[thread overview]
Message-ID: <86y3crk1z7.fsf@zoho.com> (raw)
In-Reply-To: mailman.5588.1535375213.1292.help-gnu-emacs@gnu.org

Rodolfo Medina wrote:

> And region-beginning/end...?

You can set the mark with C-SPC
(`set-mark-command'), and then move point (the
cursor) around with the usual keys. You should
now see the effect of this in the buffer.
The area covered is called the region. Often,
functions operate on this region because it is
a natural way to specify what part of the
buffer should be affected by a command: first
the user sets the region, then the command is
invoked, and because there is a region, the
command affects that, rather than the whole
buffer (or something else, depending on the
command).

In Elisp code, you can find out if there is
a region with (use-region-p). You can even,
right now reading this, evaluate that (with
`C-x C-e', `eval-last-sexp') with and without
a region: it should evaluate to t or nil
accordingly.

In the Elisp code, if there is a region you use
`region-beginning' and `region-end' to delimit
the part of the buffer it covers.

-- 
underground experts united
http://user.it.uu.se/~embe8573


  parent reply	other threads:[~2018-08-27 20:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.5556.1535294433.1292.help-gnu-emacs@gnu.org>
2018-08-26 16:02 ` replace-regexp from A to B? Emanuel Berg
2018-08-26 17:54   ` Rodolfo Medina
     [not found]   ` <mailman.5566.1535306070.1292.help-gnu-emacs@gnu.org>
2018-08-26 19:35     ` Emanuel Berg
2018-08-26 19:42       ` mixing argument types (was: Re: replace-regexp from A to B?) Emanuel Berg
2018-08-26 20:23         ` mixing argument types Stefan Monnier
     [not found]         ` <mailman.5572.1535315139.1292.help-gnu-emacs@gnu.org>
2018-08-26 21:09           ` Emanuel Berg
2018-08-27 13:06             ` Rodolfo Medina
     [not found]             ` <mailman.5588.1535375213.1292.help-gnu-emacs@gnu.org>
2018-08-27 19:08               ` Emanuel Berg
2018-08-27 20:07               ` Emanuel Berg [this message]
2018-08-28  7:29                 ` Rodolfo Medina

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=86y3crk1z7.fsf@zoho.com \
    --to=moasen@zoho.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).