From: shuhei-k Date: Sat, 29 Aug 1998 13:47:09 +0000 (+0000) Subject: Update. X-Git-Tag: apel-8_16~8 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed6d8be6cd6750e957abd8b32cbfe39e18bf9f9a;p=elisp%2Fapel.git Update. --- diff --git a/ChangeLog b/ChangeLog index 67654c5..eadfd6f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,39 @@ +1998-08-29 Shuhei KOBAYASHI + + * 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 * emu-e20.el (ccl-use-symbol-as-program): Reduce diff --git a/emu-20.el b/emu-20.el index 7003d62..b750e41 100644 --- a/emu-20.el +++ b/emu-20.el @@ -54,8 +54,7 @@ &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) @@ -67,8 +66,8 @@ Namely this function ensures that only format decoding and character 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) @@ -79,15 +78,14 @@ Like `insert-file-contents-as-binary', but it converts line-break 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 @@ -146,7 +144,8 @@ is specified, it is used as line break code type of coding-system." (t lbt))))) ) (if (find-coding-system charset) - charset)) + charset + )) (defsubst mime-charset-list () "Return a list of all existing MIME-charset." @@ -171,8 +170,7 @@ is specified, it is used as line break code type of coding-system." (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) @@ -204,8 +202,7 @@ It must be symbol." (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 diff --git a/emu-e19.el b/emu-e19.el index a676413..66ca0b6 100644 --- a/emu-e19.el +++ b/emu-e19.el @@ -75,8 +75,7 @@ (if (eq (following-char) ?\n) (forward-char) ) - (point) - )) + (point))) ;;; @ mouse @@ -94,8 +93,7 @@ "Convert list of character CHAR-LIST to string." (` (mapconcat (function char-to-string) (, char-list) - "") - )) + ""))) ;;; @ end diff --git a/emu-latin1.el b/emu-latin1.el index 45bc9a6..31fa9e2 100644 --- a/emu-latin1.el +++ b/emu-latin1.el @@ -48,13 +48,11 @@ but the contents viewed as characters do change. (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." @@ -77,8 +75,7 @@ but the contents viewed as characters do change. "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) )) @@ -138,25 +135,21 @@ else returns nil. [emu-latin1.el; old MULE emulating function]" (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) @@ -167,8 +160,8 @@ automatic uncompression, etc. 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) @@ -181,8 +174,8 @@ to advanced Emacs features, such as file-name-handlers, format decoding, 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) @@ -194,10 +187,8 @@ find-file-hooks, etc. (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 @@ -212,16 +203,15 @@ find-file-hooks, etc. (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)) @@ -238,8 +228,8 @@ find-file-hooks, etc. (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." @@ -251,8 +241,7 @@ find-file-hooks, etc. (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) @@ -277,8 +266,7 @@ find-file-hooks, etc. (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) @@ -293,8 +281,7 @@ find-file-hooks, etc. (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) @@ -306,8 +293,7 @@ Optional non-nil arg START-COLUMN specifies the starting column. \[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) diff --git a/emu-x20.el b/emu-x20.el index 4ca3c3d..82aa624 100644 --- a/emu-x20.el +++ b/emu-x20.el @@ -88,8 +88,8 @@ to advanced Emacs features, such as file-name-handlers, format decoding, 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 @@ -174,10 +174,8 @@ find-file-hooks, etc. (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." @@ -186,8 +184,7 @@ find-file-hooks, etc. ) (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." @@ -207,8 +204,7 @@ find-file-hooks, etc. (with-temp-buffer (insert string) (decode-mime-charset-region (point-min)(point-max) charset lbt) - (buffer-string) - )) + (buffer-string))) (defvar charsets-mime-charset-alist @@ -284,8 +280,7 @@ but the contents viewed as characters do change. (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) @@ -303,8 +298,7 @@ but the contents viewed as characters do change. 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) "")) @@ -313,8 +307,7 @@ TABLE defaults to the current buffer's category table." ;;; (defun string-to-int-list (str) - (mapcar #'char-int str) - ) + (mapcar #'char-int str)) (defalias 'looking-at-as-unibyte 'looking-at) diff --git a/emu-xemacs.el b/emu-xemacs.el index c0e83bc..7815219 100644 --- a/emu-xemacs.el +++ b/emu-xemacs.el @@ -67,8 +67,7 @@ (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) @@ -81,8 +80,7 @@ (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) @@ -92,13 +90,11 @@ (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 @@ -116,8 +112,7 @@ (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))) ) @@ -147,8 +142,7 @@ 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))))) )