diff options
| author | Kenichi Handa | 2005-07-26 12:03:05 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2005-07-26 12:03:05 +0000 |
| commit | 3ffdf71e89e558bc94c43520a3b7c13f8811cc16 (patch) | |
| tree | 0e4ab181b496cb43b2f1b706194badb8c83acdca | |
| parent | 4635e584dff211603c1a3cd40249ed9be0f28505 (diff) | |
| download | emacs-3ffdf71e89e558bc94c43520a3b7c13f8811cc16.tar.gz emacs-3ffdf71e89e558bc94c43520a3b7c13f8811cc16.zip | |
(robin-define-package): Delete redundant
code.
(robin-add-rule): Allow N-1 reverse conversion.
| -rw-r--r-- | lisp/international/robin.el | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/lisp/international/robin.el b/lisp/international/robin.el index ff5ad4f6c5d..7698eb4fa8c 100644 --- a/lisp/international/robin.el +++ b/lisp/international/robin.el | |||
| @@ -291,7 +291,7 @@ OUTPUT is either a character or a string. RULES are not evaluated. | |||
| 291 | If there already exists a robin package whose name is NAME, the new | 291 | If there already exists a robin package whose name is NAME, the new |
| 292 | one replaces the old one." | 292 | one replaces the old one." |
| 293 | 293 | ||
| 294 | (let ((old (assoc name robin-package-alist)) | 294 | (let ((iname (intern name)) |
| 295 | (new (list name "")) ; "" as a fake output | 295 | (new (list name "")) ; "" as a fake output |
| 296 | input output) | 296 | input output) |
| 297 | (dolist (r rules) | 297 | (dolist (r rules) |
| @@ -301,15 +301,11 @@ one replaces the old one." | |||
| 301 | (cond | 301 | (cond |
| 302 | ((not (stringp input)) | 302 | ((not (stringp input)) |
| 303 | (error "Bad input sequence %S" r)) | 303 | (error "Bad input sequence %S" r)) |
| 304 | ((characterp output) | 304 | ((char-valid-p output) |
| 305 | (put-char-code-property output (intern name) input)) | 305 | (put-char-code-property output iname input)) |
| 306 | ((not (stringp output)) | 306 | ((not (stringp output)) |
| 307 | (error "Bad output pattern %S" r)))) | 307 | (error "Bad output pattern %S" r)))) |
| 308 | (setcar (cdr new) docstring) ; replace "" above with real docstring | 308 | (setcar (cdr new) docstring) ; replace "" above with real docstring |
| 309 | (if old | ||
| 310 | (setcdr old (cdr new)) | ||
| 311 | (setq robin-package-alist | ||
| 312 | (cons new robin-package-alist))) | ||
| 313 | `(let ((slot (assoc ,name robin-package-alist)) | 309 | `(let ((slot (assoc ,name robin-package-alist)) |
| 314 | (newdef ',new)) | 310 | (newdef ',new)) |
| 315 | (if slot | 311 | (if slot |
| @@ -349,11 +345,9 @@ Internal use only." | |||
| 349 | (if branch | 345 | (if branch |
| 350 | 346 | ||
| 351 | ;; A definition already exists for this input. | 347 | ;; A definition already exists for this input. |
| 352 | (progn | 348 | ;; We do not cancel old char-code-property of OUTPUT |
| 353 | (setcar (cdr branch) output) | 349 | ;; so that n-to-1 reverse conversion is possible. |
| 354 | ;; Cancel char-code-property for old definition. | 350 | (setcar (cdr branch) output) |
| 355 | (when (characterp output) | ||
| 356 | (put-char-code-property output (intern name) nil))) | ||
| 357 | 351 | ||
| 358 | ;; New definition for this input. | 352 | ;; New definition for this input. |
| 359 | (setcdr (last tree) (list (list head output)))) | 353 | (setcdr (last tree) (list (list head output)))) |