Mercurial > emacs
changeset 17171:6f95d429f32d
(viet-decode-viqr-region): Supply correct
argumnents to rassoc.
(viqr-post-read-conversion, viqr-pre-write-conversion): New
functions.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Tue, 18 Mar 1997 23:14:07 +0000 |
parents | 3dc25ead0463 |
children | 1798b476d58b |
files | lisp/language/viet-util.el |
diffstat | 1 files changed, 21 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/language/viet-util.el Tue Mar 18 23:14:07 1997 +0000 +++ b/lisp/language/viet-util.el Tue Mar 18 23:14:07 1997 +0000 @@ -224,7 +224,7 @@ (goto-char (point-min)) (while (re-search-forward viqr-regexp nil t) (let* ((viqr (buffer-substring (match-beginning 0) (match-end 0))) - (ch (car (rassoc viet-viqr-alist viqr)))) + (ch (car (rassoc viqr viet-viqr-alist)))) (if ch (progn (delete-region (match-beginning 0) (match-end 0)) @@ -247,7 +247,7 @@ (goto-char (point-min)) (while (re-search-forward "\\cv" nil t) (let* ((ch (preceding-char)) - (viqr (cdr (assoc viet-viqr-alist ch)))) + (viqr (cdr (assq ch viet-viqr-alist)))) (if viqr (progn (delete-char -1) @@ -259,6 +259,25 @@ (interactive) (viet-encode-viqr-region (point-min) (point-max))) +;;;###autoload +(defun viqr-post-read-conversion (len) + (save-excursion + (save-restriction + (narrow-to-region (point) (+ (point) len)) + (let ((buffer-modified-p (buffer-modified-p))) + (viet-decode-viqr-region (point-min) (point-max)) + (set-buffer-modified-p buffer-modified-p) + (- (point-max) (point-min)))))) + +;;;###autoload +(defun viqr-pre-write-conversion (from to) + (let ((old-buf (current-buffer)) + (work-buf (get-buffer-create " *viet-work*"))) + (set-buffer work-buf) + (erase-buffer) + (insert-buffer-substring old-buf from to) + (viet-encode-viqr-region (point-min) (point-max)))) + ;;; (provide 'language/viet-util)