Subject: bug#16050: 24.3; let copy-to-register choose default location of point for insert-register

From: Tom Tromey <[email-masked]>
Date: Wed, 04 Dec 2013 07:36:12 -0700

I sometimes use registers for repetitive insertion of text.

Sometimes I want point to end up at the end of the insertion.
I know I can do this with a prefix argument, but it would be nicer if I
could specify this automatically for a given register, say when creating
the contents.

For example, when I invoke copy-to-register, if point is at the end of
the region, then that could indicate that I want point to be at the end
of the region at insertion time.

Or, perhaps a prefix argument to copy-to-register would work ok as well.

In GNU Emacs 24.3.7 (x86_64-unknown-linux-gnu, GTK+ Version 3.6.4)
 of 2013-10-28 on barimba
Bzr revision: 111407 [email-masked]
Windowing system distributor `Fedora Project', version 11.0.11303000
Configured using:
 `configure '--prefix=/home/tromey/Space/EmacsBzr/emacs-mt/install''

Important settings:
  value of $LANG: en_US.utf8
  value of $XMODIFIERS: @im=none
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: C/l

Minor modes in effect:
  global-auto-revert-mode: t
  bug-reference-prog-mode: t
  diff-auto-refine-mode: t
  erc-list-mode: t
  erc-menu-mode: t
  erc-autojoin-mode: t
  erc-ring-mode: t
  erc-pcomplete-mode: t
  erc-track-mode: t
  erc-track-minor-mode: t
  erc-match-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-netsplit-mode: t
  erc-spelling-mode: t
  erc-truncate-mode: t
  shell-dirtrack-mode: t
  flyspell-mode: t
  erc-status-mode: t
  erc-services-mode: t
  erc-networks-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  auto-fill-function: tjt-c++-do-auto-fill
  transient-mark-mode: t
  abbrev-mode: t

Recent input:
<f9> <f9> <f9> C-x r i l M-f M-f M-f M-b ( M-f M-d 
) <f9> C-x r i h M-f M-f f <backspace> C-f ( M-f M-d 
) <f9> M-b C-x r i h M-f M-f M-f M-b ( M-f M-d ) C-f 
C-f C-f C-x r i l M-f M-f M-f M-b ( M-f M-d ) <f9> 
<f9> M-f M-f M-b C-x r i l M-f M-f M-f M-b ( M-f M-d 
) C-n C-n M-b M-b M-b M-b C-x r i h M-f M-f M-f M-b 
( M-f M-d ) C-x s ! <f9> <f9> M-b C-x r i h M-f M-f 
M-f M-b ( M-f M-d ) C-n M-b M-b M-b C-x r i l M-f M-f 
M-f M-b ( M-f M-d ) C-M-f C-M-f <return> C-f C-f C-f 
C-x r i h M-f M-f M-f M-b ( M-f M-d ) <f9> <f9> <f9> 
M-f M-f M-b C-x r i l M-f M-f M-f M-b ( M-f M-d ) <f9> 
C-l M-f M-f M-b C-x r i h M-f M-f M-f M-b ( M-f M-d 
) <f9> C-z n C-x b p s y m p r <tab> h <backspace> 
<return> M-v M-v M-v M-v M-v M-v C-v C-v C-v C-v C-v 
C-v C-l C-u C-u C-p C-l <f10> <f10> <f10> <f10> <f10> 
<f10> C-z n C-e M-b M-b C-x r l C-g C-x k <return> 
C-x r i l M-f M-f M-f M-b ( M-f M-d ) C-z n M-x r e 
p o r t - e m <tab> b <tab> <return> C-g C-h k C-x 
r i l C-x 1 C-/ C-h k C-x r i l C-/ C-h k C-x r x C-x 
1 M-x r e p o r t - e m a c s - b u g <return>

Recent messages:
Mark set [3 times]
Quit
Mark set
Quit
Type C-x 1 to delete the help window.
Undo!
Type C-x 1 to delete the help window.
Undo!

Auto-saving...done

Load-path shadows:
/home/tromey/lib/lisp/rpm-spec-mode hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/site-lisp/rpm-spec-mode
/home/tromey/.emacs.d/elpa/css-mode-1.0/css-mode hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/textmodes/css-mode
/home/tromey/.emacs.d/elpa/ruby-mode-1.0/ruby-mode hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/progmodes/ruby-mode
/home/tromey/.emacs.d/elpa/bubbles-0.5/bubbles hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/play/bubbles
/home/tromey/.emacs.d/elpa/nxml-mode-20041004/nxml-mode hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/nxml/nxml-mode
/home/tromey/.emacs.d/elpa/nxml-mode-20041004/rng-valid hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/nxml/rng-valid
/home/tromey/.emacs.d/elpa/nxml-mode-20041004/rng-xsd hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/nxml/rng-xsd
/home/tromey/.emacs.d/elpa/nxml-mode-20041004/nxml-enc hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/nxml/nxml-enc
/home/tromey/.emacs.d/elpa/nxml-mode-20041004/nxml-glyph hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/nxml/nxml-glyph
/home/tromey/.emacs.d/elpa/nxml-mode-20041004/rng-pttrn hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/nxml/rng-pttrn
/home/tromey/.emacs.d/elpa/nxml-mode-20041004/nxml-uchnm hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/nxml/nxml-uchnm
/home/tromey/.emacs.d/elpa/nxml-mode-20041004/rng-nxml hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/nxml/rng-nxml
/home/tromey/.emacs.d/elpa/nxml-mode-20041004/xmltok hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/nxml/xmltok
/home/tromey/.emacs.d/elpa/nxml-mode-20041004/rng-parse hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/nxml/rng-parse
/home/tromey/.emacs.d/elpa/nxml-mode-20041004/rng-dt hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/nxml/rng-dt
/home/tromey/.emacs.d/elpa/nxml-mode-20041004/rng-maint hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/nxml/rng-maint
/home/tromey/.emacs.d/elpa/nxml-mode-20041004/nxml-rap hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/nxml/nxml-rap
/home/tromey/.emacs.d/elpa/nxml-mode-20041004/rng-cmpct hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/nxml/rng-cmpct
/home/tromey/.emacs.d/elpa/nxml-mode-20041004/rng-match hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/nxml/rng-match
/home/tromey/.emacs.d/elpa/nxml-mode-20041004/nxml-parse hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/nxml/nxml-parse
/home/tromey/.emacs.d/elpa/nxml-mode-20041004/nxml-outln hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/nxml/nxml-outln
/home/tromey/.emacs.d/elpa/nxml-mode-20041004/rng-util hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/nxml/rng-util
/home/tromey/.emacs.d/elpa/nxml-mode-20041004/rng-uri hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/nxml/rng-uri
/home/tromey/.emacs.d/elpa/nxml-mode-20041004/nxml-maint hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/nxml/nxml-maint
/home/tromey/.emacs.d/elpa/nxml-mode-20041004/nxml-ns hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/nxml/nxml-ns
/home/tromey/.emacs.d/elpa/nxml-mode-20041004/xsd-regexp hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/nxml/xsd-regexp
/home/tromey/.emacs.d/elpa/nxml-mode-20041004/nxml-util hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/nxml/nxml-util
/home/tromey/.emacs.d/elpa/nxml-mode-20041004/rng-loc hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/nxml/rng-loc
/home/tromey/.emacs.d/elpa/erc-5.3/erc-replace hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/erc/erc-replace
/home/tromey/.emacs.d/elpa/erc-5.3/erc-imenu hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/erc/erc-imenu
/home/tromey/.emacs.d/elpa/erc-5.3/erc-networks hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/erc/erc-networks
/home/tromey/.emacs.d/elpa/erc-5.3/erc-identd hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/erc/erc-identd
/home/tromey/.emacs.d/elpa/erc-5.3/erc-lang hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/erc/erc-lang
/home/tromey/.emacs.d/elpa/erc-5.3/erc-ezbounce hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/erc/erc-ezbounce
/home/tromey/.emacs.d/elpa/erc-5.3/erc-speedbar hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/erc/erc-speedbar
/home/tromey/.emacs.d/elpa/erc-5.3/erc-services hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/erc/erc-services
/home/tromey/.emacs.d/elpa/erc-5.3/erc-stamp hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/erc/erc-stamp
/home/tromey/.emacs.d/elpa/erc-5.3/erc-sound hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/erc/erc-sound
/home/tromey/.emacs.d/elpa/erc-5.3/erc-ibuffer hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/erc/erc-ibuffer
/home/tromey/.emacs.d/elpa/erc-5.3/erc-netsplit hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/erc/erc-netsplit
/home/tromey/.emacs.d/elpa/erc-5.3/erc-pcomplete hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/erc/erc-pcomplete
/home/tromey/.emacs.d/elpa/erc-5.3/erc-dcc hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/erc/erc-dcc
/home/tromey/.emacs.d/elpa/erc-5.3/erc-ring hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/erc/erc-ring
/home/tromey/.emacs.d/elpa/erc-5.3/erc-autoaway hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/erc/erc-autoaway
/home/tromey/.emacs.d/elpa/erc-5.3/erc-button hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/erc/erc-button
/home/tromey/.emacs.d/elpa/erc-5.3/erc-list hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/erc/erc-list
/home/tromey/.emacs.d/elpa/erc-5.3/erc-page hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/erc/erc-page
/home/tromey/.emacs.d/elpa/erc-5.3/erc-compat hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/erc/erc-compat
/home/tromey/.emacs.d/elpa/erc-5.3/erc-menu hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/erc/erc-menu
/home/tromey/.emacs.d/elpa/erc-5.3/erc-notify hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/erc/erc-notify
/home/tromey/.emacs.d/elpa/erc-5.3/erc-goodies hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/erc/erc-goodies
/home/tromey/.emacs.d/elpa/erc-5.3/erc-capab hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/erc/erc-capab
/home/tromey/.emacs.d/elpa/erc-5.3/erc-backend hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/erc/erc-backend
/home/tromey/.emacs.d/elpa/erc-5.3/erc-fill hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/erc/erc-fill
/home/tromey/.emacs.d/elpa/erc-5.3/erc-join hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/erc/erc-join
/home/tromey/.emacs.d/elpa/erc-5.3/erc hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/erc/erc
/home/tromey/.emacs.d/elpa/erc-5.3/erc-match hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/erc/erc-match
/home/tromey/.emacs.d/elpa/erc-5.3/erc-log hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/erc/erc-log
/home/tromey/.emacs.d/elpa/erc-5.3/erc-xdcc hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/erc/erc-xdcc
/home/tromey/.emacs.d/elpa/erc-5.3/erc-track hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/erc/erc-track
/home/tromey/.emacs.d/elpa/erc-5.3/erc-truncate hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/erc/erc-truncate
/home/tromey/.emacs.d/elpa/erc-5.3/erc-spelling hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/erc/erc-spelling
/home/tromey/.emacs.d/elpa/emms-3.0/tq hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/emacs-lisp/tq
/home/tromey/.emacs.d/elpa/erc-5.3/erc-hecomplete hides /home/tromey/Space/EmacsBzr/emacs-mt/install/share/emacs/24.3/lisp/obsolete/erc-hecomplete

Features:
(shadow emacsbug bookmark cal-move rect tabify man nndoc iso-transl
perl-mode org-wl org-w3m org-vm org-rmail org-mhe org-mew org-irc
org-jsinfo org-infojs org-html org-exp ob-exp org-exp-blocks org-agenda
org-info org-gnus org-docview org-bibtex bibtex org-bbdb org ob-tangle
ob-ref ob-lob ob-table org-footnote org-src ob-comint ob-keys
org-pcomplete org-list org-faces org-entities noutline outline
org-version ob-emacs-lisp ob org-compat org-macs ob-eval org-loaddefs
find-func vc-annotate m4-mode imenu autoconf autoconf-mode jimb-patch
webjump url-http url-gw url-auth url-queue conf-mode apropos etags
make-mode sh-script smie executable gnus-fun dwarf-mode python
find-dired texinfo log-view compare-w grep ffap tcl dired-aux thai-util
thai-word cus-start cus-load autorevert rebase-mode goto-addr log-edit
pcvs-util add-log smerge-mode find-file novice w3m-form w3m-cookie
w3m-bookmark w3m-tabmenu w3m-session w3m doc-view image-mode w3m-hist
w3m-fb bookmark-w3m w3m-ems w3m-ccl ccl w3m-favicon w3m-image w3m-proc
w3m-util dabbrev gnus-html xml url-cache mm-url idutils copyright
asm-mode bug-reference cc-langs cc-mode cc-fonts cc-guess cc-menus
cc-cmds help-mode gud mailalias bbdb-sc supercite regi mail-hist
diff-mode misearch multi-isearch gdb-shell vc-git vc-bzr vc-sccs vc-svn
vc-cvs vc-rcs vc-dir ewoc vc vc-dispatcher shr-color color shr
browse-url flow-fill qp bbdb-hooks bbdb-gui jka-compr smiley gnus-cite
mm-archive gnus-async gnus-bcklg gnus-ml disp-table nndraft nnmh gnutls
nnml parse-time netrc nnfolder bbdb-gnus bbdb-snarf mail-extr bbdb-com
nnnil gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg
gnus-art mm-uu mml2015 epg-config mm-view mml-smime smime dig nntp
gnus-cache gnus-sum nnoo gnus-group gnus-undo nnmail mail-source
smtpmail sendmail gnus-start gnus-spec gnus-int gnus-range message
rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader gnus-win gnus
gnus-ems nnheader mail-utils network-stream starttls tls erc-menu
erc-join erc-ring erc-pcomplete erc-track erc-match erc-button wid-edit
erc-fill erc-stamp erc-netsplit erc-spelling erc-truncate pcmpl-unix
pcmpl-gnu shell pcomplete compile flyspell ispell eldoc emms-status
emms-lastfm rx emms-browser sort emms-playlist-sort emms-score
emms-player-xine emms-player-mpd emms-url url url-proxy url-privacy
url-expand url-methods url-history url-cookie url-domsuf url-util
url-parse url-vars mailcap tq emms-playing-time emms-lyrics derived
emms-streams emms-mode-line emms-cache emms-info-ogginfo
emms-info-mp3info emms-info later-do emms-playlist-mode edmacro kmacro
emms-player-mplayer emms-player-simple emms-source-playlist
emms-source-file locate dired emms-setup emms emms-compat
dwarf-mode-autoloads gdb-shell-autoloads finder-inf magit-autoloads
nxml-enc pydoc-info-autoloads info-look info weblogger-autoloads
xml-rpc-autoloads package mule-util cal-china lunar solar cal-dst
cal-bahai cal-islam cal-hebrew holidays hol-loaddefs appt diary-lib
diary-loaddefs cal-menu easymenu calendar cal-loaddefs uniquify warnings
mouse-sel easy-mmode cl-macs gv status cl erc-services erc-networks
erc-goodies erc erc-backend erc-compat format-spec auth-source eieio
byte-opt bytecomp byte-compile cconv gnus-util mm-util mail-prsvr
password-cache thingatpt pp cc-styles cc-align cc-engine cc-vars cc-defs
advice help-fns cl-lib advice-preload bbdb timezone ange-ftp comint
ansi-color ring server bbdb-autoloads time-date tooltip ediff-hook
vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list newcomment lisp-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process dbusbind dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty emacs)

Tom