X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=emu-e20_2.el;h=023b2f4bbd58e7455c8991200343e61bc8134275;hb=4fb468dedfa66eec17eb9ddb48ebe44dfa7913ac;hp=3781a8109998ff1e6505a1387cd0db74515453c2;hpb=7b29257d8e5b741634916e7d39c733cc2cb57a42;p=elisp%2Fapel.git diff --git a/emu-e20_2.el b/emu-e20_2.el index 3781a81..023b2f4 100644 --- a/emu-e20_2.el +++ b/emu-e20_2.el @@ -28,6 +28,20 @@ ;;; Code: +;;; @ 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 enable-multibyte-characters flag) + ) + + ;;; @ character ;;; @@ -35,7 +49,7 @@ (defmacro char-next-index (char index) "Return index of character succeeding CHAR whose index is INDEX." - `(+ index (char-bytes char))) + `(+ ,index (char-bytes ,char))) ;;; @ string @@ -58,6 +72,12 @@ (defalias 'string-to-int-list 'string-to-char-list) +(defun looking-at-as-unibyte (regexp) + "Like `looking-at', but string is regarded as unibyte sequence." + (let (enable-multibyte-characters) + (looking-at regexp) + )) + ;;; @@ obsoleted aliases ;;; ;;; You should not use them.