diff options
| author | Richard M. Stallman | 1993-05-09 00:57:56 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-05-09 00:57:56 +0000 |
| commit | 22073ddadb104b452a2a154ce6964e8238632913 (patch) | |
| tree | b91400eaf52f20c99c40e772de5acb8bb54cb8a4 | |
| parent | e532b0166158d7b19dae058b97c5309e1c080f20 (diff) | |
| download | emacs-22073ddadb104b452a2a154ce6964e8238632913.tar.gz emacs-22073ddadb104b452a2a154ce6964e8238632913.zip | |
(jump-to-register): Allow file name "in" a register.
| -rw-r--r-- | lisp/register.el | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/register.el b/lisp/register.el index 32463453702..114f25fa8fd 100644 --- a/lisp/register.el +++ b/lisp/register.el | |||
| @@ -34,14 +34,16 @@ | |||
| 34 | "Alist of elements (NAME . CONTENTS), one for each Emacs register. | 34 | "Alist of elements (NAME . CONTENTS), one for each Emacs register. |
| 35 | NAME is a character (a number). CONTENTS is a string, number, | 35 | NAME is a character (a number). CONTENTS is a string, number, |
| 36 | frame configuration, mark or list. | 36 | frame configuration, mark or list. |
| 37 | A list represents a rectangle; its elements are strings.") | 37 | A list of strings represents a rectangle. |
| 38 | A list of the form (file . NAME) represents the file named NAME.") | ||
| 38 | 39 | ||
| 39 | (defun get-register (char) | 40 | (defun get-register (char) |
| 40 | "Return contents of Emacs register named CHAR, or nil if none." | 41 | "Return contents of Emacs register named CHAR, or nil if none." |
| 41 | (cdr (assq char register-alist))) | 42 | (cdr (assq char register-alist))) |
| 42 | 43 | ||
| 43 | (defun set-register (char value) | 44 | (defun set-register (char value) |
| 44 | "Set contents of Emacs register named CHAR to VALUE. Returns VALUE." | 45 | "Set contents of Emacs register named CHAR to VALUE. Returns VALUE. |
| 46 | See the documentation of the variable `register-alist' for possible VALUE." | ||
| 45 | (let ((aelt (assq char register-alist))) | 47 | (let ((aelt (assq char register-alist))) |
| 46 | (if aelt | 48 | (if aelt |
| 47 | (setcdr aelt value) | 49 | (setcdr aelt value) |
| @@ -74,6 +76,8 @@ Argument is a character, naming the register." | |||
| 74 | (defalias 'register-to-point 'jump-to-register) | 76 | (defalias 'register-to-point 'jump-to-register) |
| 75 | (defun jump-to-register (char) | 77 | (defun jump-to-register (char) |
| 76 | "Move point to location stored in a register. | 78 | "Move point to location stored in a register. |
| 79 | If the register contains a file name, find that file. | ||
| 80 | \(To put a file name in a register, you must use `set-register'.) | ||
| 77 | If the register contains a window configuration (one frame) or a frame | 81 | If the register contains a window configuration (one frame) or a frame |
| 78 | configuration (all frames), restore that frame or all frames accordingly. | 82 | configuration (all frames), restore that frame or all frames accordingly. |
| 79 | Argument is a character, naming the register." | 83 | Argument is a character, naming the register." |
| @@ -87,6 +91,8 @@ Argument is a character, naming the register." | |||
| 87 | ((markerp val) | 91 | ((markerp val) |
| 88 | (switch-to-buffer (marker-buffer val)) | 92 | (switch-to-buffer (marker-buffer val)) |
| 89 | (goto-char val)) | 93 | (goto-char val)) |
| 94 | ((and (consp val) (eq (car val) 'file)) | ||
| 95 | (find-file (cdr val))) | ||
| 90 | (t | 96 | (t |
| 91 | (error "Register doesn't contain a buffer position or configuration"))))) | 97 | (error "Register doesn't contain a buffer position or configuration"))))) |
| 92 | 98 | ||