emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/international/mule.el


From: Kenichi Handa
Subject: [Emacs-diffs] Changes to emacs/lisp/international/mule.el
Date: Tue, 28 Dec 2004 20:36:38 -0500

Index: emacs/lisp/international/mule.el
diff -c emacs/lisp/international/mule.el:1.209 
emacs/lisp/international/mule.el:1.210
*** emacs/lisp/international/mule.el:1.209      Mon Dec 27 16:12:11 2004
--- emacs/lisp/international/mule.el    Wed Dec 29 01:25:15 2004
***************
*** 1924,1929 ****
--- 1924,1948 ----
              (setq buffer-undo-list
                    (cons (cons from (point-max)) undo-list-saved))))))))
  
+ (defun recode-region (start end new-coding coding)
+   "Re-decode the region (previously decoded by CODING) by NEW-CODING."
+   (interactive
+    (list (region-beginning) (region-end)
+        (read-coding-system "Text was really in: ")
+        (let ((coding (or buffer-file-coding-system last-coding-system-used)))
+          (read-coding-system
+           (concat "But was interpreted as"
+                   (if coding (format " (default %S): " coding) ": "))
+           coding))))
+   (or (and new-coding coding)
+       (error "Coding system not specified"))
+   ;; Check it before we encode the region.
+   (check-coding-system new-coding)
+   (save-restriction
+     (narrow-to-region start end)
+     (encode-coding-region (point-min) (point-max) coding)
+     (decode-coding-region (point-min) (point-max) new-coding)))
+ 
  (defun make-translation-table (&rest args)
    "Make a translation table from arguments.
  A translation table is a char table intended for character




reply via email to

[Prev in Thread] Current Thread [Next in Thread]