From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: `yank-and-mark` command? Date: Sun, 05 Jul 2015 14:35:42 -0400 Organization: A noiseless patient Spider Message-ID: References: <55997125.7020703@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1436121618 10011 80.91.229.3 (5 Jul 2015 18:40:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 5 Jul 2015 18:40:18 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jul 05 20:40:18 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZBopt-0005TY-UB for geh-help-gnu-emacs@m.gmane.org; Sun, 05 Jul 2015 20:40:18 +0200 Original-Received: from localhost ([::1]:47379 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZBopt-0002uq-4y for geh-help-gnu-emacs@m.gmane.org; Sun, 05 Jul 2015 14:40:17 -0400 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 14 Injection-Info: mx02.eternal-september.org; posting-host="77dfc20685d6333c044388a259a97140"; logging-data="22166"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ZhtcuMVaKWFpizqL3hNwz" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:NxHMTlaVqn137OrdiWtD7MCaX/0= sha1:Xkl/SDWi+vseuaDiaHdDW5pr1Qw= Original-Xref: usenet.stanford.edu gnu.emacs.help:213175 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:105462 Archived-At: > I am trying to mimic C-y C-x C-x. I have considered using > a keyboard macro, but I would prefer a Lisp alternative. That doesn't say in which way your code doesn't work like you want. But my guess is that the yank sets deactivate-mark and exchange-point-and-mark doesn't reset it, so after running the command the mark is deactivated by the default code that deactivates the mark after buffer modifications. So you'll want to add (setq deactivate-mark nil) either before or after exchange-point-and-mark. Stefan