From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: lng2@spray.se (Lars Gustafsson) Newsgroups: gmane.emacs.help Subject: Cursor at end of region pasted in Date: 20 Feb 2004 00:54:56 -0800 Organization: http://groups.google.com Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <340bc066.0402200054.7e63d9c0@posting.google.com> NNTP-Posting-Host: deer.gmane.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1077267683 30541 80.91.224.253 (20 Feb 2004 09:01:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 20 Feb 2004 09:01:23 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Feb 20 10:01:20 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Au6XA-0007Io-00 for ; Fri, 20 Feb 2004 10:01:20 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1Au6Wk-00010B-OE for geh-help-gnu-emacs@m.gmane.org; Fri, 20 Feb 2004 04:00:54 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsfeed.berkeley.edu!ucberkeley!sn-xit-02!sn-xit-04!sn-xit-05!sn-xit-09!supernews.com!postnews1.google.com!not-for-mail Original-Newsgroups: comp.emacs,gnu.emacs.help Original-Lines: 24 Original-NNTP-Posting-Host: 81.225.34.28 Original-X-Trace: posting.google.com 1077267297 32483 127.0.0.1 (20 Feb 2004 08:54:57 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 20 Feb 2004 08:54:57 +0000 (UTC) Original-Xref: shelby.stanford.edu comp.emacs:83341 gnu.emacs.help:121066 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 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 Xref: main.gmane.org gmane.emacs.help:17016 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:17016 Hi! How do I get the cursor to place itself at the end of the region, which has just been pasted in? Right now it places itself at the beginning of the region, which has just been pasted in. This is my function: (global-unset-key [(control v)]) (global-set-key [(control v)] 'paste-and-show) ; PASTE-KEY. (defun paste-and-show () (interactive) "Paste from register a" (progn (message "Region from register a pasted in") (if (eq mark-active (not nil)) ; if-part (progn ; then-part (message "Markeringen var aktiv") (transient-mark-mode 1) (kill-region (region-beginning) (region-end)) ;(transient-mark-mode 0) ) ) (insert-register ?a) (setq mark-active nil) )) Thanks in advance, Lars