diff options
| author | Kenichi Handa | 1997-08-10 04:07:03 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1997-08-10 04:07:03 +0000 |
| commit | 2de6d4470ce134cb92aefc0d7a296a6fd292c3a4 (patch) | |
| tree | 8e785a16347ebbb92c0207cde4b089f1fee8bbd2 | |
| parent | d6d6d592014c3e4e1bfbbda42d2f920c59e5c2c5 (diff) | |
| download | emacs-2de6d4470ce134cb92aefc0d7a296a6fd292c3a4.tar.gz emacs-2de6d4470ce134cb92aefc0d7a296a6fd292c3a4.zip | |
(prefer-coding-system): Moved to mule-util.el.
| -rw-r--r-- | lisp/international/mule-util.el | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/lisp/international/mule-util.el b/lisp/international/mule-util.el index 0c4c895077f..e9a3d67aa68 100644 --- a/lisp/international/mule-util.el +++ b/lisp/international/mule-util.el | |||
| @@ -318,28 +318,6 @@ or one is an alias of the other." | |||
| 318 | (equal (coding-system-plist coding-system-1) | 318 | (equal (coding-system-plist coding-system-1) |
| 319 | (coding-system-plist coding-system-2)))) | 319 | (coding-system-plist coding-system-2)))) |
| 320 | 320 | ||
| 321 | ;;;###autoload | ||
| 322 | (defun prefer-coding-system (coding-system) | ||
| 323 | "Add CODING-SYSTEM at the front of the priority list for automatic detection." | ||
| 324 | (interactive "zPrefer coding system: ") | ||
| 325 | (if (not (and coding-system (coding-system-p coding-system))) | ||
| 326 | (error "Invalid coding system `%s'" coding-system)) | ||
| 327 | (let ((coding-category (coding-system-category coding-system)) | ||
| 328 | (parent (coding-system-parent coding-system))) | ||
| 329 | (if (not coding-category) | ||
| 330 | ;; CODING-SYSTEM is no-conversion or undecided. | ||
| 331 | (error "Can't prefer the coding system `%s'" coding-system)) | ||
| 332 | (set coding-category (or parent coding-system)) | ||
| 333 | (if (not (eq coding-category (car coding-category-list))) | ||
| 334 | ;; We must change the order. | ||
| 335 | (setq coding-category-list | ||
| 336 | (cons coding-category | ||
| 337 | (delq coding-category coding-category-list)))) | ||
| 338 | (if (and parent (interactive-p)) | ||
| 339 | (message "Highest priority is set to %s (parent of %s)" | ||
| 340 | parent coding-system)) | ||
| 341 | (setq-default buffer-file-coding-system (or parent coding-system)))) | ||
| 342 | |||
| 343 | 321 | ||
| 344 | ;;; Composite charcater manipulations. | 322 | ;;; Composite charcater manipulations. |
| 345 | 323 | ||
| @@ -375,6 +353,19 @@ positions (integers or markers) specifying the region." | |||
| 375 | (insert (decompose-composite-char (string-to-char str))))))) | 353 | (insert (decompose-composite-char (string-to-char str))))))) |
| 376 | 354 | ||
| 377 | ;;;###autoload | 355 | ;;;###autoload |
| 356 | (defun decompose-string (string) | ||
| 357 | "Decompose all composite characters in STRING." | ||
| 358 | (let* ((l (string-to-list string)) | ||
| 359 | (tail l) | ||
| 360 | ch) | ||
| 361 | (while tail | ||
| 362 | (setq ch (car tail)) | ||
| 363 | (setcar tail (if (cmpcharp ch) (decompose-composite-char ch) | ||
| 364 | (char-to-string ch))) | ||
| 365 | (setq tail (cdr tail))) | ||
| 366 | (apply 'concat l))) | ||
| 367 | |||
| 368 | ;;;###autoload | ||
| 378 | (defconst reference-point-alist | 369 | (defconst reference-point-alist |
| 379 | '((tl . 0) (tc . 1) (tr . 2) | 370 | '((tl . 0) (tc . 1) (tr . 2) |
| 380 | (ml . 3) (mc . 4) (mr . 5) | 371 | (ml . 3) (mc . 4) (mr . 5) |