unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Kevin Rodgers <kevin.d.rodgers@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Proper use of `deactivate-mark'?
Date: Thu, 13 Feb 2014 23:51:09 -0700	[thread overview]
Message-ID: <ldkea5$93i$1@ger.gmane.org> (raw)
In-Reply-To: <barmar-854A71.13075913022014@news.eternal-september.org>

On 2/13/14 11:07 AM, Barry Margolin wrote:
> Maybe it should be:
>
> (and
>    (use-region-p)
>    (progn
>      (copy-to-register ?s (region-beginning) (region0end))
>      (deactivate-mark)))

;; http://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node84.html
;; As a matter of style, `when' is normally used to conditionally produce
;; some side effects, and the value of the when form is normally not
;; used. If the value is relevant, then it may be stylistically more
;; appropriate to use `and' or `if'.

(when (use-region-p)
   (copy-to-register ?s (region-beginning) (region0end))
   (deactivate-mark))

-- 
Kevin Rodgers
Denver, Colorado, USA




      parent reply	other threads:[~2014-02-14  6:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-13 17:19 Proper use of `deactivate-mark'? Thorsten Jolitz
2014-02-13 17:28 ` Stefan Monnier
2014-02-13 17:59   ` Thorsten Jolitz
2014-02-13 18:39     ` Michael Heerdegen
     [not found]   ` <mailman.14992.1392314356.10748.help-gnu-emacs@gnu.org>
2014-02-13 18:07     ` Barry Margolin
2014-02-13 18:52       ` Thorsten Jolitz
2014-02-14  6:51       ` Kevin Rodgers [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

  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='ldkea5$93i$1@ger.gmane.org' \
    --to=kevin.d.rodgers@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.
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).