+1998-08-29 Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp>
+
+ * emu-e20.el (ccl-execute-on-string): Too few args.
+ (test-ccl-eof-block-cs): Revert existence checking.
+
+ * emu-e20_2.el (insert-file-contents-as-binary): Return value.
+ (insert-file-contents-as-raw-text): Ditto.
+
+ * emu-mule.el (insert-file-contents-as-raw-text): Return value.
+ (encode-coding-string): Check `coding-system' is non-nil.
+ (decode-coding-string): Ditto.
+ (insert-file-contents-as-binary): Use `as-binary-input-file'.
+ (insert-binary-file-contents-literally): Ditto.
+ (write-region-as-binary): Use `as-binary-output-file'.
+ (write-region-as-raw-text-CRLF): Definition for Emacs 19.28.
+ (write-region-as-mime-charset): Ditto.
+ (mime-charset-to-coding-system): New implementation.
+
+ (ccl-use-symbol-as-program): New constant.
+ (ccl-encoder-eof-block-is-broken): New constant.
+ (ccl-decoder-eof-block-is-broken): New constant.
+ (ccl-eof-block-is-broken): New constant.
+ (make-ccl-coding-system): New function.
+ (ccl-execute): Emacs 20.3 emulating function.
+ (ccl-execute-on-string): Emacs 20.3 emulating function.
+
+ * emu-nemacs.el (write-region-as-binary): Use
+ `as-binary-output-file'
+ (write-region-as-raw-text-CRLF): Ditto.
+ (insert-file-contents-as-binary): Use `as-binary-input-file'.
+ (insert-binary-file-contents-literally): Ditto.
+ (insert-file-contents-as-raw-text): Ditto.
+
+ * emu.el (last): Emacs 20 emulation function.
+ (butlast), (nbutlast): CL emulation functions.
+
1998-08-27 Tanaka Akira <akr@jaist.ac.jp>
* emu-e20.el (ccl-use-symbol-as-program): Reduce
&optional append visit lockname)
"Like `write-region', q.v., but don't encode."
(let ((coding-system-for-write 'binary))
- (write-region start end filename append visit lockname)
- ))
+ (write-region start end filename append visit lockname)))
(defun insert-file-contents-as-binary (filename
&optional visit beg end replace)
code conversion will not take place."
(let ((coding-system-for-read 'binary)
format-alist)
- (insert-file-contents filename visit beg end replace)
- ))
+ ;; Returns list of absolute file name and length of data inserted.
+ (insert-file-contents filename visit beg end replace)))
(defun insert-file-contents-as-raw-text (filename
&optional visit beg end replace)
code."
(let ((coding-system-for-read 'raw-text)
format-alist)
- (insert-file-contents filename visit beg end replace)
- ))
+ ;; Returns list of absolute file name and length of data inserted.
+ (insert-file-contents filename visit beg end replace)))
(defun write-region-as-raw-text-CRLF (start end filename
&optional append visit lockname)
"Like `write-region', q.v., but write as network representation."
(let ((coding-system-for-write 'raw-text-dos))
- (write-region start end filename append visit lockname)
- ))
+ (write-region start end filename append visit lockname)))
;;; @@ Mule emulating aliases
(t lbt)))))
)
(if (find-coding-system charset)
- charset))
+ charset
+ ))
(defsubst mime-charset-list ()
"Return a list of all existing MIME-charset."
(completing-read (format "%s (default %s) " prompt value)
(mapcar (function
(lambda (sym)
- (list (symbol-name sym))
- ))
+ (list (symbol-name sym))))
(mime-charset-list)))))
(defun widget-mime-charset-action (widget &optional event)
(let ((coding-system-for-write
(or (mime-charset-to-coding-system charset)
'binary)))
- (write-region start end filename append visit lockname)
- ))
+ (write-region start end filename append visit lockname)))
;;; @ end
(if (eq (following-char) ?\n)
(forward-char)
)
- (point)
- ))
+ (point)))
;;; @ mouse
"Convert list of character CHAR-LIST to string."
(` (mapconcat (function char-to-string)
(, char-list)
- "")
- ))
+ "")))
;;; @ end
(defun charset-description (charset)
"Return description of CHARSET."
- (get charset 'charset-description)
- )
+ (get charset 'charset-description))
(defun charset-registry (charset)
"Return registry name of CHARSET."
- (get charset 'charset-registry)
- )
+ (get charset 'charset-registry))
(defun charset-width (charset)
"Return number of columns a CHARSET occupies when displayed."
"Return a list of charsets in the region between START and END."
(if (save-excursion
(goto-char start)
- (re-search-forward "[\200-\377]" end t)
- )
+ (re-search-forward "[\200-\377]" end t))
'(latin-iso8859-1)
))
(defmacro as-binary-process (&rest body)
(` (let (selective-display) ; Disable ^M to nl translation.
- (,@ body)
- )))
+ (,@ body))))
(defmacro as-binary-input-file (&rest body)
(` (let ((emx-binary-mode t)) ; Stop CRLF to LF conversion in OS/2
- (,@ body)
- )))
+ (,@ body))))
(defmacro as-binary-output-file (&rest body)
(` (let ((emx-binary-mode t)) ; Stop CRLF to LF conversion in OS/2
- (,@ body)
- )))
+ (,@ body))))
(defun write-region-as-binary (start end filename
&optional append visit lockname)
"Like `write-region', q.v., but don't code conversion."
(let ((emx-binary-mode t))
- (write-region start end filename append visit lockname)
- ))
+ (write-region start end filename append visit lockname)))
(defun insert-file-contents-as-binary (filename
&optional visit beg end replace)
Namely this function ensures that only format decoding and character
code conversion will not take place."
(let ((emx-binary-mode t))
- (insert-file-contents filename visit beg end replace)
- ))
+ ;; Returns list of absolute file name and length of data inserted.
+ (insert-file-contents filename visit beg end replace)))
(defalias 'insert-binary-file-contents 'insert-file-contents-as-binary)
(make-obsolete 'insert-binary-file-contents 'insert-file-contents-as-binary)
find-file-hooks, etc.
This function ensures that none of these modifications will take place."
(let ((emx-binary-mode t))
- (insert-file-contents-literally filename visit beg end replace)
- ))
+ ;; Returns list of absolute file name and length of data inserted.
+ (insert-file-contents-literally filename visit beg end replace)))
(defalias 'insert-file-contents-as-raw-text 'insert-file-contents)
(insert-buffer-substring the-buf start end)
(goto-char (point-min))
(while (re-search-forward "\\(\\=\\|[^\r]\\)\n" nil t)
- (replace-match "\\1\r\n")
- )
- (write-region (point-min)(point-max) filename append visit lockname)
- )))
+ (replace-match "\\1\r\n"))
+ (write-region (point-min)(point-max) filename append visit lockname))))
;;; @ MIME charset
(if (stringp charset)
(setq charset (intern (downcase charset)))
)
- (and (memq charset (list 'us-ascii default-mime-charset))
- charset)
- )
+ (if (memq charset (list 'us-ascii default-mime-charset))
+ charset
+ ))
(defun detect-mime-charset-region (start end)
"Return MIME charset for region between START and END."
(if (save-excursion
(goto-char start)
- (re-search-forward "[\200-\377]" end t)
- )
+ (re-search-forward "[\200-\377]" end t))
default-mime-charset
'us-ascii))
(goto-char (point-min))
(while (search-forward "\r\n" nil t)
(replace-match "\n"))
- ))))
- )
+ ))
+ )))
(defun encode-mime-charset-string (string charset)
"Encode the STRING as MIME CHARSET."
(with-temp-buffer
(insert string)
(decode-mime-charset-region (point-min)(point-max) charset lbt)
- (buffer-string)
- )
+ (buffer-string))
string))
(defalias 'write-region-as-mime-charset 'write-region)
(defun split-char (character)
"Return list of charset and one or two position-codes of CHARACTER."
- (cons (char-charset character) character)
- )
+ (cons (char-charset character) character))
(defalias 'char-length 'char-bytes)
(defalias 'string-width 'length)
(defun string-to-char-list (str)
- (mapcar (function identity) str)
- )
+ (mapcar (function identity) str))
(defalias 'string-to-int-list 'string-to-char-list)
\[emu-latin1.el; MULE 2.3 emulating function]"
(or start-column
(setq start-column 0))
- (substring str start-column width)
- )
+ (substring str start-column width))
(defalias 'looking-at-as-unibyte 'looking-at)
find-file-hooks, etc.
This function ensures that none of these modifications will take place."
(let ((coding-system-for-read 'binary))
- (insert-file-contents-literally filename visit beg end replace)
- ))
+ ;; Returns list absolute file name and length of data inserted.
+ (insert-file-contents-literally filename visit beg end replace)))
;;; @ MIME charset
(narrow-to-region start end)
(decode-coding-region (point-min)(point-max)
(mime-charset-to-coding-system 'raw-text lbt))
- (decode-hz-region (point-min)(point-max))
- )
- (decode-hz-region start end)
- ))
+ (decode-hz-region (point-min)(point-max)))
+ (decode-hz-region start end)))
(defun decode-mime-charset-region (start end charset &optional lbt)
"Decode the text between START and END as MIME CHARSET."
)
(let ((func (cdr (or (assq charset mime-charset-decoder-alist)
(assq t mime-charset-decoder-alist)))))
- (funcall func start end charset lbt)
- ))
+ (funcall func start end charset lbt)))
(defsubst encode-mime-charset-string (string charset)
"Encode the STRING as MIME CHARSET."
(with-temp-buffer
(insert string)
(decode-mime-charset-region (point-min)(point-max) charset lbt)
- (buffer-string)
- ))
+ (buffer-string)))
(defvar charsets-mime-charset-alist
(setq dest (cons (logand code 127) dest)
code (lsh code -7)
i (1+ i)))
- (cons charset dest)
- ))))
+ (cons charset dest)))))
)
(defmacro char-next-index (char index)
CHAR can be any multilingual character
TABLE defaults to the current buffer's category table."
(mapconcat (lambda (chr)
- (char-to-string (int-char chr))
- )
+ (char-to-string (int-char chr)))
(char-category-list character)
""))
;;;
(defun string-to-int-list (str)
- (mapcar #'char-int str)
- )
+ (mapcar #'char-int str))
(defalias 'looking-at-as-unibyte 'looking-at)
(defun invisible-region (start end)
(if (save-excursion
(goto-char start)
- (eq (following-char) ?\n)
- )
+ (eq (following-char) ?\n))
(setq start (1+ start))
)
(put-text-property start end 'invisible t)
(defun invisible-p (pos)
(if (save-excursion
(goto-char pos)
- (eq (following-char) ?\n)
- )
+ (eq (following-char) ?\n))
(setq pos (1+ pos))
)
(get-text-property pos 'invisible)
(save-excursion
(if (save-excursion
(goto-char pos)
- (eq (following-char) ?\n)
- )
+ (eq (following-char) ?\n))
(setq pos (1+ pos))
)
(or (next-single-property-change pos 'invisible)
- (point-max))
- ))
+ (point-max))))
;;; @ mouse
(defun dired-other-frame (dirname &optional switches)
"\"Edit\" directory DIRNAME. Like `dired' but makes a new frame."
(interactive (dired-read-dir-and-switches "in other frame "))
- (switch-to-buffer-other-frame (dired-noselect dirname switches))
- )
+ (switch-to-buffer-other-frame (dired-noselect dirname switches)))
)
filename))
(setq directory (file-name-directory (substring directory 0 -1))
ancestor (concat "../" ancestor)))
- (concat ancestor (substring filename (match-end 0)))
- ))
+ (concat ancestor (substring filename (match-end 0)))))
)