From: Karl Heuer Date: Sun, 23 Nov 1997 02:12:23 +0000 (+0000) Subject: (window-configuration-to-register): X-Git-Tag: emacs-20.3~2749 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b4a91f432a15bef35454515eba7fe98c538b3765;p=emacs.git (window-configuration-to-register): (frame-configuration-to-register): Include (point) in the saved value. (jump-to-register): Restore (point) as well as window or frame config. --- diff --git a/lisp/register.el b/lisp/register.el index 32cd981bdca..54a64ef52d8 100644 --- a/lisp/register.el +++ b/lisp/register.el @@ -68,14 +68,18 @@ Argument is a character, naming the register." Use \\[jump-to-register] to restore the configuration. Argument is a character, naming the register." (interactive "cWindow configuration to register: \nP") - (set-register register (current-window-configuration))) + ;; current-window-configuration does not include the value + ;; of point in the current buffer, so record that separately. + (set-register register (list (current-window-configuration) (point)))) (defun frame-configuration-to-register (register &optional arg) "Store the window configuration of all frames in register REGISTER. Use \\[jump-to-register] to restore the configuration. Argument is a character, naming the register." (interactive "cFrame configuration to register: \nP") - (set-register register (current-frame-configuration))) + ;; current-frame-configuration does not include the value + ;; of point in the current buffer, so record that separately. + (set-register register (list (current-frame-configuration) (point)))) (defalias 'register-to-point 'jump-to-register) (defun jump-to-register (register &optional delete) @@ -91,11 +95,12 @@ delete any existing frames that the frame configuration doesn't mention. (interactive "cJump to register: \nP") (let ((val (get-register register))) (cond - ((and (fboundp 'frame-configuration-p) - (frame-configuration-p val)) - (set-frame-configuration val (not delete))) - ((window-configuration-p val) - (set-window-configuration val)) + ((and (consp val) (frame-configuration-p (car val))) + (set-frame-configuration (car val) (not delete)) + (goto-char (cadr val))) + ((and (consp val) (window-configuration-p (car val))) + (set-window-configuration (car val)) + (goto-char (cadr val))) ((markerp val) (or (marker-buffer val) (error "That register's buffer no longer exists"))