From: morioka Date: Tue, 10 Mar 1998 05:12:32 +0000 (+0000) Subject: tm 7.87. X-Git-Tag: tm7_87~1 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=aed61f4327f3bc83b99966079471ca4160e76960;p=elisp%2Ftm.git tm 7.87. --- diff --git a/ChangeLog b/ChangeLog index ab14135..e395484 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,32 @@ +Mon Sep 23 19:53:58 1996 MORIOKA Tomohiko + + * tl: Version 7.61.7 was released. + * MEL: Version 6.0 was released. + * tm: Version 7.87 was released. + * tm-mh-e: Version 7.69 was released. + + * tm-edit.el (mime-editor/insert-file): Use variable + `mime-file-encoding-method-alist' instead of + `mime-encoding-method-alist'. + + (mime-editor/insert-binary-file): New implementation; Use function + `mime-insert-encoded-file'. + + Function `mime-editor/insert-binary-buffer' was abolished. + + (mime-editor/insert-voice): New implementation. + + (mime-editor/voice-recorder): Renamed from `mime-voice-recorder'; + argument was changed. + + (mime-editor/voice-recorder-for-sun): Renamed from + `mime-voice-recorder-for-sun'; New implementation; Don't support + AUDIOHOST. + + (mime/editor-mode): DOC-string was modified for + `mime-editor/voice-recorder'. + + Mon Sep 23 13:16:56 1996 MORIOKA Tomohiko * tl: Version 7.61.6 was released. diff --git a/Makefile b/Makefile index a77327c..3334cb1 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ # $Id: Makefile,v 7.29 1996/09/07 17:20:36 morioka Exp morioka $ # -VERSION = 7.86 +VERSION = 7.87 SHELL = /bin/sh MAKE = make diff --git a/tm-edit.el b/tm-edit.el index f62b31c..2601a39 100644 --- a/tm-edit.el +++ b/tm-edit.el @@ -6,7 +6,7 @@ ;; MORIOKA Tomohiko ;; Maintainer: MORIOKA Tomohiko ;; Created: 1994/08/21 renamed from mime.el -;; Version: $Revision: 7.86 $ +;; Version: $Revision: 7.87 $ ;; Keywords: mail, news, MIME, multimedia, multilingual ;; This file is part of tm (Tools for MIME). @@ -22,8 +22,8 @@ ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; see the file COPYING. If not, write to -;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. ;;; Commentary: @@ -121,7 +121,7 @@ ;;; (defconst mime-editor/RCS-ID - "$Id: tm-edit.el,v 7.86 1996/09/21 14:33:25 morioka Exp $") + "$Id: tm-edit.el,v 7.87 1996/09/23 19:53:58 morioka Exp $") (defconst mime-editor/version (get-version-string mime-editor/RCS-ID)) @@ -148,9 +148,9 @@ If non-nil, the text tag is not inserted unless something different.") (defvar mime-auto-hide-body t "*Hide non-textual body encoded in base64 after insertion if non-nil.") -(defvar mime-voice-recorder - (function mime-voice-recorder-for-sun) - "*Function to record a voice message and return a buffer that contains it.") +(defvar mime-editor/voice-recorder + (function mime-editor/voice-recorder-for-sun) + "*Function to record a voice message and encode it. [tm-edit.el]") (defvar mime/editor-mode-hook nil "*Hook called when enter MIME mode.") @@ -745,10 +745,10 @@ User customizable variables (not documented all of them): Hide a non-textual body message encoded in base64 after insertion if non-nil. - mime-voice-recorder - Specifies a function to record a voice message and return a buffer - that contains it. The function mime-voice-recorder-for-sun is for - Sun SparcStations. + mime-editor/voice-recorder + Specifies a function to record a voice message and encode it. + The function `mime-editor/voice-recorder-for-sun' is for Sun + SparcStations. mime/editor-mode-hook Turning on MIME mode calls the value of mime/editor-mode-hook, if @@ -888,7 +888,7 @@ Charset is automatically obtained from the `mime/lc-charset-alist'." ")" )) ": ") - mime-encoding-method-alist nil t nil)))) + mime-file-encoding-method-alist nil t nil)))) (if (string-equal encoding "") (setq encoding default)) (if (or (consp parameters) (stringp disposition-type)) @@ -950,12 +950,21 @@ Charset is automatically obtained from the `mime/lc-charset-alist'." (defun mime-editor/insert-voice () "Insert a voice message." (interactive) - (mime-editor/insert-tag "audio" "basic" nil) - (let ((buffer (funcall mime-voice-recorder))) - (unwind-protect - (mime-editor/insert-binary-buffer buffer "base64") - (kill-buffer buffer) - ))) + (let ((encoding + (completing-read + "What transfer encoding: " + mime-file-encoding-method-alist nil t nil))) + (mime-editor/insert-tag "audio" "basic" nil) + (mime-editor/define-encoding encoding) + (save-restriction + (narrow-to-region (1- (point))(point)) + (unwind-protect + (funcall mime-editor/voice-recorder encoding) + (progn + (insert "\n") + (invisible-region (point-min)(point-max)) + (goto-char (point-max)) + ))))) (defun mime-editor/insert-signature (&optional arg) "Insert a signature file." @@ -1021,66 +1030,34 @@ If nothing is inserted, return nil." ) )) -;; Insert the binary content after MIME tag. -;; modified by MORITA Masahiro -;; for x-uue (defun mime-editor/insert-binary-file (file &optional encoding) "Insert binary FILE at point. Optional argument ENCODING specifies an encoding method such as base64." - (let ((tmpbuf (get-buffer-create " *MIME insert*"))) - (save-excursion - (set-buffer tmpbuf) - (erase-buffer) - (as-binary-input-file (insert-file-contents file)) - ) - (prog1 - (if (and (stringp encoding) - (string-equal (downcase encoding) "x-uue")) - (progn - (require 'mel-u) - (let ((uuencode-external-encoder - (cons (car uuencode-external-encoder) - (list (file-name-nondirectory file)) - ))) - (mime-editor/insert-binary-buffer tmpbuf encoding) - )) - (mime-editor/insert-binary-buffer tmpbuf encoding)) - (kill-buffer tmpbuf)))) - -;; Insert the binary content after MIME tag. -;; modified by MORITA Masahiro -;; for x-uue -(defun mime-editor/insert-binary-buffer (buffer &optional encoding) - "Insert binary BUFFER at point. -Optional argument ENCODING specifies an encoding method such as base64." (let* ((tagend (1- (point))) ;End of the tag (hide-p (and mime-auto-hide-body (stringp encoding) - (let ((en (downcase encoding))) - (or (string-equal en "base64") - (string-equal en "x-uue") - )))) + (not + (let ((en (downcase encoding))) + (or (string-equal en "7bit") + (string-equal en "8bit") + (string-equal en "binary") + ))))) ) (save-restriction - (narrow-to-region (1- (point)) (point)) - (let ((start (point)) - (emx-binary-mode t)) ;Stop LF to CRLF conversion in OS/2 - (insert-buffer-substring buffer) - ;; Encode binary message if necessary. - (if encoding - (mime-encode-region start (point-max) encoding) - )) + (narrow-to-region tagend (point)) + (mime-insert-encoded-file file encoding) (if hide-p (progn (invisible-region (point-min) (point-max)) (goto-char (point-max)) - ) - )) + )) + ) ;; Define encoding even if it is 7bit. (if (stringp encoding) (save-excursion - (goto-char tagend) ;Make sure which line the tag is on. - (mime-editor/define-encoding encoding))) + (goto-char tagend) ; Make sure which line the tag is on. + (mime-editor/define-encoding encoding) + )) )) @@ -2049,46 +2026,11 @@ Content-Transfer-Encoding: 7bit ;; Sun implementations -(defun mime-voice-recorder-for-sun () - "Record voice in a buffer using Sun audio device, and return the buffer. -If the environment variable AUDIOHOST is defined, its value is used as -a recording host instead of local host." - (let ((buffer (get-buffer-create " *MIME audio*")) - (host (getenv "AUDIOHOST"))) - (message "Start the recording on %s. Type C-g to finish the recording..." - (or host (system-name))) - (save-excursion - (set-buffer buffer) - (erase-buffer) - (condition-case errorcode - (let ((selective-display nil) ;Disable ^M to nl translation. - (mc-flag nil) ;Mule - (kanji-flag nil)) ;NEmacs - ;; If AUDIOHOST is defined, use the value as recording host. - (cond ((not (null host)) - ;; Disable automatic conversion of coding system if Mule. - (if (featurep 'mule) - (define-program-coding-system nil "rsh" *noconv*)) - (call-process "rsh" - nil - buffer - nil - host - "cat" - "/dev/audio" - )) - (t - ;; Disable automatic conversion of coding system if Mule. - (if (featurep 'mule) - (define-program-coding-system nil "cat" *noconv*)) - (call-process "cat" - "/dev/audio" - buffer - nil - )))) - (quit (message "Type C-g to finish recording... done.") - buffer ;Return the buffer - ))))) +(defun mime-editor/voice-recorder-for-sun (encoding) + "Record voice in a buffer using Sun audio device, +and insert data encoded as ENCODING. [tm-edit.el]" + (mime-insert-encoded-file "/dev/audio" encoding) + ) ;;; @ Other useful commands.