|
|
Re: Trouble with cursor palcement when using registers.: msg#00863
emacs.help
|
Subject: |
Re: Trouble with cursor palcement when using registers. |
Lars Gustafsson wrote:
I used registers to construct a paste-function. The problem is that
the cursor is always positioned before the text, which I just pasted
in. When you use the yank-function the cursor is always placed after
the text, which was just pasted in. How do I get the cursor after the
text, which was just pasted in automatically. Here is how the
paste-function is implemented:
(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 "The mark was active")
(transient-mark-mode 1)
(kill-region (region-beginning) (region-end))
(transient-mark-mode 0)
)
)
(insert-register ?a)
(setq mark-active nil)
C-h f insert-register
(insert-register ?a t)
--
<a href=" mailto:<kevin.rodgers@ihs.com>">Kevin Rodgers</a>
|
|