comparison lisp/language/japan-util.el @ 37913:49a0ec256ceb

(japanese-hankaku): Prefer the charset `jisx0201' when the optional argument `ascii-only' is not specified. (japanese-hankaku-region): Ditto. From Katsumi Yamaoka <yamaoka@jpl.org>
author Gerd Moellmann <gerd@gnu.org>
date Mon, 28 May 2001 11:03:17 +0000
parents dfd29e68d398
children 67b464da13ec
comparison
equal deleted inserted replaced
37912:351539ffdaba 37913:49a0ec256ceb
199 The argument may be a character or string. The result has the same type. 199 The argument may be a character or string. The result has the same type.
200 The argument object is not altered--the value is a copy. 200 The argument object is not altered--the value is a copy.
201 Optional argument ASCII-ONLY non-nil means to return only ASCII character." 201 Optional argument ASCII-ONLY non-nil means to return only ASCII character."
202 (if (stringp obj) 202 (if (stringp obj)
203 (japanese-string-conversion obj 'japanese-hankaku-region ascii-only) 203 (japanese-string-conversion obj 'japanese-hankaku-region ascii-only)
204 (or (get-char-code-property obj 'ascii) 204 (or (and (not ascii-only)
205 (and (not ascii-only)
206 (get-char-code-property obj 'jisx0201)) 205 (get-char-code-property obj 'jisx0201))
206 (get-char-code-property obj 'ascii)
207 obj))) 207 obj)))
208 208
209 ;;;###autoload 209 ;;;###autoload
210 (defun japanese-zenkaku (obj) 210 (defun japanese-zenkaku (obj)
211 "Convert argument to `zenkaku' and return that. 211 "Convert argument to `zenkaku' and return that.
280 (narrow-to-region from to) 280 (narrow-to-region from to)
281 (save-excursion 281 (save-excursion
282 (goto-char (point-min)) 282 (goto-char (point-min))
283 (while (re-search-forward "\\cj" nil t) 283 (while (re-search-forward "\\cj" nil t)
284 (let* ((zenkaku (preceding-char)) 284 (let* ((zenkaku (preceding-char))
285 (hankaku (or (get-char-code-property zenkaku 'ascii) 285 (hankaku (or (and (not ascii-only)
286 (and (not ascii-only) 286 (get-char-code-property zenkaku 'jisx0201))
287 (get-char-code-property zenkaku 'jisx0201))))) 287 (get-char-code-property zenkaku 'ascii))))
288 (if hankaku 288 (if hankaku
289 (japanese-replace-region (match-beginning 0) (match-end 0) 289 (japanese-replace-region (match-beginning 0) (match-end 0)
290 hankaku))))))) 290 hankaku)))))))
291 291
292 ;;;###autoload 292 ;;;###autoload