diff options
| author | Karl Heuer | 1997-11-23 02:12:23 +0000 |
|---|---|---|
| committer | Karl Heuer | 1997-11-23 02:12:23 +0000 |
| commit | b4a91f432a15bef35454515eba7fe98c538b3765 (patch) | |
| tree | 0218a0ed16a97e77319d2dedd0a8d363060d2afe | |
| parent | f83d2997fbf6b7b8287f34a89966f404bd095698 (diff) | |
| download | emacs-b4a91f432a15bef35454515eba7fe98c538b3765.tar.gz emacs-b4a91f432a15bef35454515eba7fe98c538b3765.zip | |
(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.
| -rw-r--r-- | lisp/register.el | 19 |
1 files changed, 12 insertions, 7 deletions
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." | |||
| 68 | Use \\[jump-to-register] to restore the configuration. | 68 | Use \\[jump-to-register] to restore the configuration. |
| 69 | Argument is a character, naming the register." | 69 | Argument is a character, naming the register." |
| 70 | (interactive "cWindow configuration to register: \nP") | 70 | (interactive "cWindow configuration to register: \nP") |
| 71 | (set-register register (current-window-configuration))) | 71 | ;; current-window-configuration does not include the value |
| 72 | ;; of point in the current buffer, so record that separately. | ||
| 73 | (set-register register (list (current-window-configuration) (point)))) | ||
| 72 | 74 | ||
| 73 | (defun frame-configuration-to-register (register &optional arg) | 75 | (defun frame-configuration-to-register (register &optional arg) |
| 74 | "Store the window configuration of all frames in register REGISTER. | 76 | "Store the window configuration of all frames in register REGISTER. |
| 75 | Use \\[jump-to-register] to restore the configuration. | 77 | Use \\[jump-to-register] to restore the configuration. |
| 76 | Argument is a character, naming the register." | 78 | Argument is a character, naming the register." |
| 77 | (interactive "cFrame configuration to register: \nP") | 79 | (interactive "cFrame configuration to register: \nP") |
| 78 | (set-register register (current-frame-configuration))) | 80 | ;; current-frame-configuration does not include the value |
| 81 | ;; of point in the current buffer, so record that separately. | ||
| 82 | (set-register register (list (current-frame-configuration) (point)))) | ||
| 79 | 83 | ||
| 80 | (defalias 'register-to-point 'jump-to-register) | 84 | (defalias 'register-to-point 'jump-to-register) |
| 81 | (defun jump-to-register (register &optional delete) | 85 | (defun jump-to-register (register &optional delete) |
| @@ -91,11 +95,12 @@ delete any existing frames that the frame configuration doesn't mention. | |||
| 91 | (interactive "cJump to register: \nP") | 95 | (interactive "cJump to register: \nP") |
| 92 | (let ((val (get-register register))) | 96 | (let ((val (get-register register))) |
| 93 | (cond | 97 | (cond |
| 94 | ((and (fboundp 'frame-configuration-p) | 98 | ((and (consp val) (frame-configuration-p (car val))) |
| 95 | (frame-configuration-p val)) | 99 | (set-frame-configuration (car val) (not delete)) |
| 96 | (set-frame-configuration val (not delete))) | 100 | (goto-char (cadr val))) |
| 97 | ((window-configuration-p val) | 101 | ((and (consp val) (window-configuration-p (car val))) |
| 98 | (set-window-configuration val)) | 102 | (set-window-configuration (car val)) |
| 103 | (goto-char (cadr val))) | ||
| 99 | ((markerp val) | 104 | ((markerp val) |
| 100 | (or (marker-buffer val) | 105 | (or (marker-buffer val) |
| 101 | (error "That register's buffer no longer exists")) | 106 | (error "That register's buffer no longer exists")) |