changeset 20324:2365fc61875d

(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.
author Karl Heuer <kwzh@gnu.org>
date Sun, 23 Nov 1997 02:12:23 +0000
parents eae9c49831e4
children fea279940ce8
files lisp/register.el
diffstat 1 files changed, 12 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/register.el	Sun Nov 23 02:10:07 1997 +0000
+++ b/lisp/register.el	Sun Nov 23 02:12:23 1997 +0000
@@ -68,14 +68,18 @@
 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 @@
   (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"))