help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Proper use of `deactivate-mark'?


From: Kevin Rodgers
Subject: Re: Proper use of `deactivate-mark'?
Date: Thu, 13 Feb 2014 23:51:09 -0700
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.28) Gecko/20120306 Thunderbird/3.1.20

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]