Mercurial > emacs
changeset 2699:83fee0378e0e
(jump-to-register): Allow file name "in" a register.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 09 May 1993 00:57:56 +0000 |
parents | 6940c6b5d988 |
children | 9de57e00caf7 |
files | lisp/register.el |
diffstat | 1 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/register.el Sat May 08 23:49:17 1993 +0000 +++ b/lisp/register.el Sun May 09 00:57:56 1993 +0000 @@ -34,14 +34,16 @@ "Alist of elements (NAME . CONTENTS), one for each Emacs register. NAME is a character (a number). CONTENTS is a string, number, frame configuration, mark or list. -A list represents a rectangle; its elements are strings.") +A list of strings represents a rectangle. +A list of the form (file . NAME) represents the file named NAME.") (defun get-register (char) "Return contents of Emacs register named CHAR, or nil if none." (cdr (assq char register-alist))) (defun set-register (char value) - "Set contents of Emacs register named CHAR to VALUE. Returns VALUE." + "Set contents of Emacs register named CHAR to VALUE. Returns VALUE. +See the documentation of the variable `register-alist' for possible VALUE." (let ((aelt (assq char register-alist))) (if aelt (setcdr aelt value) @@ -74,6 +76,8 @@ (defalias 'register-to-point 'jump-to-register) (defun jump-to-register (char) "Move point to location stored in a register. +If the register contains a file name, find that file. + \(To put a file name in a register, you must use `set-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." @@ -87,6 +91,8 @@ ((markerp val) (switch-to-buffer (marker-buffer val)) (goto-char val)) + ((and (consp val) (eq (car val) 'file)) + (find-file (cdr val))) (t (error "Register doesn't contain a buffer position or configuration")))))