summaryrefslogtreecommitdiff
path: root/lisp/register.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1992-07-19 05:05:19 +0000
committerRichard M. Stallman <rms@gnu.org>1992-07-19 05:05:19 +0000
commit83b5d75750a74181e05e8abb053399a86a76292f (patch)
treed11528ab481a0f978c87f37a826767f058a8cc79 /lisp/register.el
parentfd5285f3e3929a85dd3b140880d3bd9bb9626d4d (diff)
downloademacs-83b5d75750a74181e05e8abb053399a86a76292f.tar.gz
*** empty log message ***
Diffstat (limited to 'lisp/register.el')
-rw-r--r--lisp/register.el28
1 files changed, 23 insertions, 5 deletions
diff --git a/lisp/register.el b/lisp/register.el
index 569e7e3b008..b12beb056e2 100644
--- a/lisp/register.el
+++ b/lisp/register.el
@@ -51,20 +51,38 @@ Argument is a character, naming the register."
(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.