Mercurial > hg > xemacs-beta
comparison lisp/register.el @ 272:c5d627a313b1 r21-0b34
Import from CVS: tag r21-0b34
| author | cvs |
|---|---|
| date | Mon, 13 Aug 2007 10:28:48 +0200 |
| parents | 084402c475ba |
| children | 558f606b08ae |
comparison
equal
deleted
inserted
replaced
| 271:c7b7086b0a39 | 272:c5d627a313b1 |
|---|---|
| 47 (defun get-register (reg) | 47 (defun get-register (reg) |
| 48 "Return contents of Emacs register named REG, or nil if none." | 48 "Return contents of Emacs register named REG, or nil if none." |
| 49 (cdr (assq reg register-alist))) | 49 (cdr (assq reg register-alist))) |
| 50 | 50 |
| 51 (defun set-register (register value) | 51 (defun set-register (register value) |
| 52 "Set contents of Emacs register named REGISTER to VALUE. Returns VALUE. | 52 "Set contents of Emacs register named REGISTER to VALUE. Return VALUE. |
| 53 See the documentation of the variable `register-alist' for possible VALUE." | 53 See the documentation of the variable `register-alist' for possible VALUE." |
| 54 (let ((aelt (assq register register-alist))) | 54 (let ((aelt (assq register register-alist))) |
| 55 (if aelt | 55 (if aelt |
| 56 (setcdr aelt value) | 56 (setcdr aelt value) |
| 57 (setq aelt (cons register value)) | 57 (setq aelt (cons register value)) |
| 136 ;Two args, NUMBER and REGISTER (a character, naming the register). | 136 ;Two args, NUMBER and REGISTER (a character, naming the register). |
| 137 ;If NUMBER is nil, digits in the buffer following point are read | 137 ;If NUMBER is nil, digits in the buffer following point are read |
| 138 ;to get the number to store. | 138 ;to get the number to store. |
| 139 ;Interactively, NUMBER is the prefix arg (none means nil)." | 139 ;Interactively, NUMBER is the prefix arg (none means nil)." |
| 140 ; (interactive "P\ncNumber to register: ") | 140 ; (interactive "P\ncNumber to register: ") |
| 141 ; (set-register char | 141 ; (set-register char |
| 142 ; (if arg | 142 ; (if arg |
| 143 ; (prefix-numeric-value arg) | 143 ; (prefix-numeric-value arg) |
| 144 ; (if (looking-at "[0-9][0-9]*") | 144 ; (if (looking-at "[0-9][0-9]*") |
| 145 ; (save-excursion | 145 ; (save-excursion |
| 146 ; (save-restriction | 146 ; (save-restriction |
| 151 ; (read (current-buffer)))) | 151 ; (read (current-buffer)))) |
| 152 ; 0)))) | 152 ; 0)))) |
| 153 | 153 |
| 154 ;(defun increment-register (arg char) | 154 ;(defun increment-register (arg char) |
| 155 ; "Add NUMBER to the contents of register REGISTER. | 155 ; "Add NUMBER to the contents of register REGISTER. |
| 156 ;Interactively, NUMBER is the prefix arg (none means nil)." | 156 ;Interactively, NUMBER is the prefix arg (none means nil)." |
| 157 ; (interactive "p\ncNumber to register: ") | 157 ; (interactive "p\ncNumber to register: ") |
| 158 ; (or (integerp (get-register char)) | 158 ; (or (integerp (get-register char)) |
| 159 ; (error "Register does not contain a number")) | 159 ; (error "Register does not contain a number")) |
| 160 ; (set-register char (+ arg (get-register char)))) | 160 ; (set-register char (+ arg (get-register char)))) |
| 161 | 161 |
