Function: point-to-register
point-to-register is an interactive and byte-compiled function defined
in register.el.gz.
Signature
(point-to-register REGISTER &optional ARG)
Documentation
Store current location of point in REGISTER.
With prefix argument ARG, store current frame configuration (a.k.a. "frameset").
Use C-x r j (jump-to-register) to go to that location or restore that configuration.
Argument is a character, the name of the register.
Interactively, prompt for REGISTER using register-read-with-preview.
Probably introduced at or before Emacs version 17.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/register.el.gz
(defun point-to-register (register &optional arg)
"Store current location of point in REGISTER.
With prefix argument ARG, store current frame configuration (a.k.a. \"frameset\").
Use \\[jump-to-register] to go to that location or restore that configuration.
Argument is a character, the name of the register.
Interactively, prompt for REGISTER using `register-read-with-preview'."
(interactive (list (register-read-with-preview
(if current-prefix-arg
"Frame configuration to register: "
"Point to register: "))
current-prefix-arg))
;; Turn the marker into a file-ref if the buffer is killed.
(add-hook 'kill-buffer-hook #'register-swap-out nil t)
(set-register register
;; FIXME: How does this `current-frame-configuration' differ
;; in practice with what `frameset-to-register' does?
(if arg (list (current-frame-configuration) (point-marker))
(point-marker))))