]> git.eshelyaron.com Git - emacs.git/commitdiff
(window-configuration-to-register):
authorKarl Heuer <kwzh@gnu.org>
Sun, 23 Nov 1997 02:12:23 +0000 (02:12 +0000)
committerKarl Heuer <kwzh@gnu.org>
Sun, 23 Nov 1997 02:12:23 +0000 (02:12 +0000)
(frame-configuration-to-register): Include (point) in the saved value.
(jump-to-register): Restore (point) as well as window or frame config.

lisp/register.el

index 32cd981bdcac978baf9263b735edd94031c672c9..54a64ef52d84a571999f82c64c66b662c2497a17 100644 (file)
@@ -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"))