X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=emu-mule.el;h=4a691722bbd8a787410f65b86039ee73f44039e1;hb=4fb468dedfa66eec17eb9ddb48ebe44dfa7913ac;hp=eed2bd7fa20f9fc5bc06e6a48a4a2100d308550d;hpb=d414170754dc3d6016cb12268d3eab08ed2d3650;p=elisp%2Fapel.git diff --git a/emu-mule.el b/emu-mule.el index eed2bd7..4a69172 100644 --- a/emu-mule.el +++ b/emu-mule.el @@ -29,7 +29,7 @@ ;;; (cond (running-emacs-19 - (require 'emu-19) + (require 'emu-e19) ;; Suggested by SASAKI Osamu ;; (cf. [os2-emacs-ja:78]) @@ -69,6 +69,12 @@ (defalias 'charset-columns 'char-width) (defalias 'charset-direction 'char-direction) +(defun charset-chars (charset) + "Return the number of characters per dimension of CHARSET." + (if (= (logand (nth 2 (character-set charset)) 1) 1) + 96 + 94)) + ;;; @ coding system ;;; @@ -220,6 +226,14 @@ find-file-hooks, etc. (decode-coding-string string cs) string))) +(defun write-region-as-mime-charset (charset start end filename) + "Like `write-region', q.v., but code-convert by MIME CHARSET." + (let ((file-coding-system + (or (mime-charset-to-coding-system charset) + *noconv*))) + (write-region start end filename append visit) + )) + ;;; @@ to coding-system ;;; @@ -312,6 +326,20 @@ It must be symbol.") (cons lc-ascii (find-charset-region start end)))) +;;; @ 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 mc-flag flag) + ) + + ;;; @ character ;;; @@ -319,14 +347,14 @@ It must be symbol.") (defmacro char-next-index (char index) "Return index of character succeeding CHAR whose index is INDEX." - (` (+ index (char-bytes char)))) + (` (+ (, index) (char-bytes (, char))))) ;;; @@ obsoleted aliases ;;; ;;; You should not use them. (defalias 'char-length 'char-bytes) -(defalias 'char-columns 'char-width) +;;(defalias 'char-columns 'char-width) ;;; @ string @@ -370,6 +398,8 @@ Optional non-nil arg START-COLUMN specifies the starting column. ;;; ) +(defalias 'looking-at-as-unibyte 'looking-at) + ;;; @ regulation ;;;