Commit cbd4993c authored by Karl Heuer's avatar Karl Heuer

(view-register, insert-register): Handle dead marker.

parent 05041ba0
......@@ -144,10 +144,13 @@ REGISTER is a character."
(princ val))
((markerp val)
(princ "a buffer position:\nbuffer ")
(princ (buffer-name (marker-buffer val)))
(princ ", position ")
(princ (+ 0 val)))
(let ((buf (marker-buffer val)))
(if (null buf)
(princ "a marker in no buffer")
(princ "a buffer position:\nbuffer ")
(princ (buffer-name buf))
(princ ", position ")
(princ (marker-position val)))))
((window-configuration-p val)
(princ "a window configuration."))
......@@ -183,13 +186,17 @@ Interactively, second arg is non-nil if prefix arg is supplied."
(interactive "cInsert register: \nP")
(push-mark)
(let ((val (get-register char)))
(if (consp val)
(insert-rectangle val)
(if (stringp val)
(insert val)
(if (or (integerp val) (markerp val))
(princ (+ 0 val) (current-buffer))
(error "Register does not contain text")))))
(cond
((consp val)
(insert-rectangle val))
((stringp val)
(insert val))
((integerp val)
(princ val (current-buffer)))
((and (markerp val) (marker-position val))
(princ (marker-position val) (current-buffer)))
(t
(error "Register does not contain text"))))
(if (not arg) (exchange-point-and-mark)))
(defun copy-to-register (char start end &optional delete-flag)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment