changeset 820:cd6b1e1da3fc

*** empty log message ***
author Richard M. Stallman <rms@gnu.org>
date Sun, 19 Jul 1992 05:05:19 +0000
parents 5bbabfcef929
children cee415e2dae8
files lisp/register.el lisp/window.el
diffstat 2 files changed, 23 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/register.el	Sun Jul 19 01:07:07 1992 +0000
+++ b/lisp/register.el	Sun Jul 19 05:05:19 1992 +0000
@@ -51,20 +51,38 @@
   (interactive "cPoint to register: \nP")
   (set-register char (if arg (current-frame-configuration) (point-marker))))
 
+(defun window-configuration-to-register (char arg)
+  "Store the window configuration of the selected frame in register REGISTER.
+Use \\[jump-to-register] to restore the configuration.
+Argument is a character, naming the register."
+  (interactive "cPoint to register: \nP")
+  (set-register char (current-window-configuration)))
+
+(defun frame-configuration-to-register (char 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 "cPoint to register: \nP")
+  (set-register char (current-frame-configuration)))
+
 (fset 'register-to-point 'jump-to-register)
 (defun jump-to-register (char)
   "Move point to location stored in a register.
+If the register contains a window configuration (one frame) or a frame
+configuration (all frames), restore that frame or all frames accordingly.
 Argument is a character, naming the register."
   (interactive "cJump to register: ")
   (let ((val (get-register char)))
     (condition-case ()
 	(set-frame-configuration val)
       (error
-       (if (markerp val)
-	   (progn
-	     (switch-to-buffer (marker-buffer val))
-	     (goto-char val))
-	 (error "Register doesn't contain a buffer position or frame configuration"))))))
+       (if (window-configuration-p val)
+	   (set-window-configuration val)
+	 (if (markerp val)
+	     (progn
+	       (switch-to-buffer (marker-buffer val))
+	       (goto-char val))
+	   (error "Register doesn't contain a buffer position or configuration")))))))
 
 ;(defun number-to-register (arg char)
 ;  "Store a number in a register.
--- a/lisp/window.el	Sun Jul 19 01:07:07 1992 +0000
+++ b/lisp/window.el	Sun Jul 19 05:05:19 1992 +0000
@@ -110,22 +110,8 @@
   (interactive "p")
   (shrink-window arg t))
 
-(defun window-config-to-register (name)
-  "Save the current window configuration in register REG (a letter).
-It can be later retrieved using \\[M-x register-to-window-config]."
-  (interactive "cSave window configuration in register: ")
-  (set-register name (current-window-configuration)))
-
-(defun register-to-window-config (name)
-  "Restore (make current) the window configuration in register REG (a letter).
-Use with a register previously set with \\[window-config-to-register]."
-  (interactive "cRestore window configuration from register: ")
-  (set-window-configuration (get-register name)))
-
 (define-key ctl-x-map "2" 'split-window-vertically)
 (define-key ctl-x-map "3" 'split-window-horizontally)
-(define-key ctl-x-map "6" 'window-config-to-register)
-(define-key ctl-x-map "7" 'register-to-window-config)
 (define-key ctl-x-map "}" 'enlarge-window-horizontally)
 (define-key ctl-x-map "{" 'shrink-window-horizontally)