diff options
| author | Richard M. Stallman | 1990-12-16 17:53:49 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1990-12-16 17:53:49 +0000 |
| commit | b42e61564f4c93f7a7272afbda18ea0bc3d47a6c (patch) | |
| tree | af746873a9f5c6979620e3b99f8e4bb04d4954bb | |
| parent | c9a9e8bcd1180b999cf9731db1efcd582c60b03f (diff) | |
| download | emacs-b42e61564f4c93f7a7272afbda18ea0bc3d47a6c.tar.gz emacs-b42e61564f4c93f7a7272afbda18ea0bc3d47a6c.zip | |
*** empty log message ***
| -rw-r--r-- | lisp/register.el | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/lisp/register.el b/lisp/register.el index 599b5591176..e41a3ddf503 100644 --- a/lisp/register.el +++ b/lisp/register.el | |||
| @@ -21,7 +21,8 @@ | |||
| 21 | (defvar register-alist nil | 21 | (defvar register-alist nil |
| 22 | "Alist of elements (NAME . CONTENTS), one for each Emacs register. | 22 | "Alist of elements (NAME . CONTENTS), one for each Emacs register. |
| 23 | NAME is a character (a number). CONTENTS is a string, number, | 23 | NAME is a character (a number). CONTENTS is a string, number, |
| 24 | mark or list. A list represents a rectangle; its elements are strings.") | 24 | screen configuration, mark or list. |
| 25 | A list represents a rectangle; its elements are strings.") | ||
| 25 | 26 | ||
| 26 | (defun get-register (char) | 27 | (defun get-register (char) |
| 27 | "Return contents of Emacs register named CHAR, or nil if none." | 28 | "Return contents of Emacs register named CHAR, or nil if none." |
| @@ -37,11 +38,13 @@ Returns VALUE." | |||
| 37 | (setq register-alist (cons aelt register-alist))) | 38 | (setq register-alist (cons aelt register-alist))) |
| 38 | value)) | 39 | value)) |
| 39 | 40 | ||
| 40 | (defun point-to-register (char) | 41 | (defun point-to-register (char arg) |
| 41 | "Store current location of point in a register. | 42 | "Store current location of point in register REGISTER. |
| 43 | With prefix argument, store current screen configuration. | ||
| 44 | Use \\[jump-to-register] to go to that location or restore that configuration. | ||
| 42 | Argument is a character, naming the register." | 45 | Argument is a character, naming the register." |
| 43 | (interactive "cPoint to register: ") | 46 | (interactive "cPoint to register: \nP") |
| 44 | (set-register char (point-marker))) | 47 | (set-register char (if arg (current-screen-configuration) (point-marker)))) |
| 45 | 48 | ||
| 46 | (fset 'register-to-point 'jump-to-register) | 49 | (fset 'register-to-point 'jump-to-register) |
| 47 | (defun jump-to-register (char) | 50 | (defun jump-to-register (char) |
| @@ -49,11 +52,14 @@ Argument is a character, naming the register." | |||
| 49 | Argument is a character, naming the register." | 52 | Argument is a character, naming the register." |
| 50 | (interactive "cJump to register: ") | 53 | (interactive "cJump to register: ") |
| 51 | (let ((val (get-register char))) | 54 | (let ((val (get-register char))) |
| 52 | (if (markerp val) | 55 | (condition-case () |
| 53 | (progn | 56 | (set-screen-configuration val) |
| 54 | (switch-to-buffer (marker-buffer val)) | 57 | (error |
| 55 | (goto-char val)) | 58 | (if (markerp val) |
| 56 | (error "Register doesn't contain a buffer position")))) | 59 | (progn |
| 60 | (switch-to-buffer (marker-buffer val)) | ||
| 61 | (goto-char val)) | ||
| 62 | (error "Register doesn't contain a buffer position or screen configuration"))))) | ||
| 57 | 63 | ||
| 58 | ;(defun number-to-register (arg char) | 64 | ;(defun number-to-register (arg char) |
| 59 | ; "Store a number in a register. | 65 | ; "Store a number in a register. |