unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Kevin Rodgers <kevin.rodgers@ihs.com>
Subject: Re: Trouble with cursor palcement when using registers.
Date: Fri, 27 Dec 2002 10:22:58 -0700	[thread overview]
Message-ID: <3E0C8C72.7040604@ihs.com> (raw)
In-Reply-To: 340bc066.0212270900.3f972de2@posting.google.com

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:&lt;kevin.rodgers&#64;ihs.com&gt;">Kevin Rodgers</a>

      reply	other threads:[~2002-12-27 17:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-27 17:00 Trouble with cursor palcement when using registers Lars Gustafsson
2002-12-27 17:22 ` Kevin Rodgers [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3E0C8C72.7040604@ihs.com \
    --to=kevin.rodgers@ihs.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).