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

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

Cursor at end of region pasted in


From: Lars Gustafsson
Subject: Cursor at end of region pasted in
Date: 20 Feb 2004 00:54:56 -0800

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


reply via email to

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