rearrangement.
[elisp/apel.git] / emu-nemacs.el
index 77bfc0a..aeae7a0 100644 (file)
@@ -220,6 +220,14 @@ else returns nil. [emu-nemacs.el; Mule emulating function]"
 
 (fset 'insert-binary-file-contents 'insert-file-contents-as-binary)
 
+(defun insert-file-contents-as-raw-text (filename
+                                        &optional visit beg end replace)
+  "Like `insert-file-contents', q.v., but don't character code conversion.
+\[emu-nemacs.el]"
+  (let (kanji-flag)
+    (insert-file-contents filename visit beg end replace)
+    ))
+
 (defun insert-binary-file-contents-literally (filename
                                              &optional visit beg end replace)
   "Like `insert-file-contents-literally', q.v., but don't code conversion.
@@ -312,6 +320,29 @@ find-file-hooks, etc.
        (convert-string-kanji-code string cs 3)
       string)))
 
+(defun write-region-as-mime-charset (charset start end filename)
+  "Like `write-region', q.v., but code-convert by MIME CHARSET.
+\[emu-nemacs.el]"
+  (let ((kanji-fileio-code
+        (or (mime-charset-to-coding-system charset)
+            *noconv*)))
+    (write-region start end filename)
+    ))
+
+
+;;; @ buffer representation
+;;;
+
+(defsubst-maybe set-buffer-multibyte (flag)
+  "Set the multibyte flag of the current buffer to FLAG.
+If FLAG is t, this makes the buffer a multibyte buffer.
+If FLAG is nil, this makes the buffer a single-byte buffer.
+The buffer contents remain unchanged as a sequence of bytes
+but the contents viewed as characters do change.
+\[Emacs 20.3 emulating function]"
+  (setq kanji-flag flag)
+  )
+
 
 ;;; @ character
 ;;;
@@ -335,22 +366,11 @@ find-file-hooks, etc.
       1
     2))
 
+(defalias 'char-length 'char-bytes)
+
 (defmacro char-next-index (char index)
   "Return index of character succeeding CHAR whose index is INDEX."
-  (` (1+ index)))
-
-;;; @@ Old Mule emulating aliases
-;;;
-;;; You should not use them.
-
-;;(defalias 'char-leading-char 'char-charset)
-
-;;; @@ obsoleted aliases
-;;;
-;;; You should not use them.
-
-(defalias 'char-length 'char-bytes)
-;;(defalias 'char-columns 'char-width)
+  (` (+ (, index) (char-bytes (, char)))))
 
 
 ;;; @ string
@@ -414,6 +434,8 @@ Optional non-nil arg START-COLUMN specifies the starting column.
            (setq to to-prev)))
       (substring str from to))))
 
+(defalias 'looking-at-as-unibyte 'looking-at)
+
 ;;; @@ obsoleted aliases
 ;;;
 ;;; You should not use them.