diff options
| author | Karl Heuer | 1997-12-08 01:57:31 +0000 |
|---|---|---|
| committer | Karl Heuer | 1997-12-08 01:57:31 +0000 |
| commit | 4d2caa0732b95a6a96252aeab7100f33b11a6ad3 (patch) | |
| tree | 29ae2651f462a36248e4d51d3f6f67ec5becf4c1 | |
| parent | ed80a8e438420af031178a08c5dad5770cc9a2ef (diff) | |
| download | emacs-4d2caa0732b95a6a96252aeab7100f33b11a6ad3.tar.gz emacs-4d2caa0732b95a6a96252aeab7100f33b11a6ad3.zip | |
(number-to-register): Move point as a side effect.
| -rw-r--r-- | lisp/register.el | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/lisp/register.el b/lisp/register.el index 69f33ca4b24..eb0aa8107c2 100644 --- a/lisp/register.el +++ b/lisp/register.el | |||
| @@ -139,21 +139,17 @@ delete any existing frames that the frame configuration doesn't mention. | |||
| 139 | (defun number-to-register (arg char) | 139 | (defun number-to-register (arg char) |
| 140 | "Store a number in a register. | 140 | "Store a number in a register. |
| 141 | Two args, NUMBER and REGISTER (a character, naming the register). | 141 | Two args, NUMBER and REGISTER (a character, naming the register). |
| 142 | If NUMBER is nil, digits in the buffer following point are read | 142 | If NUMBER is nil, a decimal number is read from the buffer starting |
| 143 | to get the number to store. | 143 | at point, and point moves to the end of that number. |
| 144 | Interactively, NUMBER is the prefix arg (none means nil)." | 144 | Interactively, NUMBER is the prefix arg (none means nil)." |
| 145 | (interactive "P\ncNumber to register: ") | 145 | (interactive "P\ncNumber to register: ") |
| 146 | (set-register char | 146 | (set-register char |
| 147 | (if arg | 147 | (if arg |
| 148 | (prefix-numeric-value arg) | 148 | (prefix-numeric-value arg) |
| 149 | (if (looking-at "[0-9][0-9]*") | 149 | (if (looking-at "\\s-*-?[0-9]+") |
| 150 | (save-excursion | 150 | (progn |
| 151 | (save-restriction | 151 | (goto-char (match-end 0)) |
| 152 | (narrow-to-region (point) | 152 | (string-to-int (match-string 0))) |
| 153 | (progn (skip-chars-forward "0-9") | ||
| 154 | (point))) | ||
| 155 | (goto-char (point-min)) | ||
| 156 | (read (current-buffer)))) | ||
| 157 | 0)))) | 153 | 0)))) |
| 158 | 154 | ||
| 159 | (defun increment-register (arg char) | 155 | (defun increment-register (arg char) |