unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Cursor at end of region pasted in
@ 2004-02-20  8:54 Lars Gustafsson
  2004-02-20 10:34 ` Floyd Davidson
  2004-02-20 11:10 ` Johan Bockgård
  0 siblings, 2 replies; 8+ messages in thread
From: Lars Gustafsson @ 2004-02-20  8:54 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-02-20 17:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-20  8:54 Cursor at end of region pasted in Lars Gustafsson
2004-02-20 10:34 ` Floyd Davidson
2004-02-20 15:41   ` Stefan Monnier
2004-02-20 15:45     ` David Kastrup
2004-02-20 15:54       ` Stefan Monnier
2004-02-20 16:01         ` Simon Josefsson
2004-02-20 17:43         ` Alan Mackenzie
2004-02-20 11:10 ` Johan Bockgård

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).