From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/23342 Path: main.gmane.org!not-for-mail From: Jan Vroonhof Newsgroups: gmane.emacs.gnus.general Subject: Re: MIME attachments? Date: Tue, 15 Jun 1999 20:52:19 +0200 Sender: owner-ding@hpc.uh.edu Message-ID: <19990615205219.A7475@riesz.math.ethz.ch> References: <6w7lp55yc1.fsf@lucent.com> <6wbteh4is3.fsf@lucent.com> <6w3dzt4ijg.fsf@lucent.com> <6wemjd32c1.fsf@lucent.com> <6w674pa2mg.fsf@lucent.com> <861zfde5hn.fsf@kramer.in.aventail.com> <19990615194329.A7407@rie Reply-To: vroonhof@math.ethz.ch, ding@gnus.org NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035161092 1452 80.91.224.250 (21 Oct 2002 00:44:52 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 00:44:52 +0000 (UTC) Cc: Jan Vroonhof , ding@gnus.org, xemacs-patches@xemacs.org, efs-bugs@hplb.hpl.hp.com Return-Path: Original-Received: from farabi.math.uh.edu (farabi.math.uh.edu [129.7.128.57]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id OAA27394 for ; Tue, 15 Jun 1999 14:57:16 -0400 (EDT) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by farabi.math.uh.edu (8.9.1/8.9.1) with ESMTP id NAB15596; Tue, 15 Jun 1999 13:56:41 -0500 (CDT) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Tue, 15 Jun 1999 13:57:02 -0500 (CDT) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id NAA00769 for ; Tue, 15 Jun 1999 13:56:49 -0500 (CDT) Original-Received: from frege.math.ethz.ch (daemon@frege-d-math-north-g-west.math.ethz.ch [129.132.145.3]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id OAA27286 for ; Tue, 15 Jun 1999 14:55:52 -0400 (EDT) Original-Received: (from daemon@localhost) by frege.math.ethz.ch (8.9.1/8.9.1) id UAA17135; Tue, 15 Jun 1999 20:52:23 +0200 (MET DST) Original-Received: from riesz(129.132.144.7), claiming to be "riesz.math.ethz.ch" via SMTP by frege, id smtpdAAAa004Bc; Tue Jun 15 20:52:21 1999 Original-Received: (vroonhof@localhost) by riesz.math.ethz.ch (8.6.12/D-MATH-client) id UAA07498; Tue, 15 Jun 1999 20:52:19 +0200 Original-To: "William M. Perry" X-Mailer: Mutt 0.95.1i In-Reply-To: <86vhcpcpb4.fsf@kramer.in.aventail.com>; from William M. Perry on Tue, Jun 15, 1999 at 11:05:19AM -0700 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:23342 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:23342 > > > You have to use insert-file-contents if you want to be able to attach files > > > through efs / ange-ftp / rcp / whatever. > > > > That is a bug in insert-file-contents-literally, it really should be made > > a file-handler method. Apperently FSF Emacs 20.4 already contains a a > > I don't think I quite understand how you would make > insert-file-contents-literally work for EFS files and yet not let things > like jka-compr and friends get at it. Simply let jka-compr and friends not implement it, like this (note the absence of any patch to jka-comp.el). Only kai has get to work to do this for rcp.el: 1999-06-15 Jan Vroonhof * efs.el (efs-insert-file-contents-general): Generalized i-f-c function derived from old i-f-c function. (efs-insert-file-contents): Use it. (efs-insert-file-contents-literally): Use it. * files.el (insert-file-contents-literally): Use binary coding system (from Morioka san). (insert-file-contents-literally): Make file-name-handler method. Index: lisp/files.el =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs-20/lisp/files.el,v retrieving revision 1.31 diff -u -u -r1.31 files.el --- files.el 1999/05/13 12:19:37 1.31 +++ files.el 1999/06/16 02:26:06 @@ -874,23 +874,31 @@ (defun insert-file-contents-literally (filename &optional visit beg end replace) "Like `insert-file-contents', q.v., but only reads in the file. A buffer may be modified in several ways after reading into the buffer due -to advanced Emacs features, such as file-name-handlers, format decoding, -find-file-hooks, etc. +to advanced Emacs features, such as format decoding, character code +conversion,find-file-hooks, automatic uncompression, etc. + This function ensures that none of these modifications will take place." - (let ((file-name-handler-alist nil) - (format-alist nil) - (after-insert-file-functions nil) - (find-buffer-file-type-function - (if (fboundp 'find-buffer-file-type) - (symbol-function 'find-buffer-file-type) - nil))) - (unwind-protect - (progn - (fset 'find-buffer-file-type (lambda (filename) t)) - (insert-file-contents filename visit beg end replace)) - (if find-buffer-file-type-function - (fset 'find-buffer-file-type find-buffer-file-type-function) - (fmakunbound 'find-buffer-file-type))))) + (let ((wrap-func (find-file-name-handler filename + 'insert-file-contents-literally))) + (if wrap-func + (funcall wrap-func 'insert-file-contents-literally filename + visit beg end replace) + (let ((file-name-handler-alist nil) + (format-alist nil) + (after-insert-file-functions nil) + (coding-system-for-read 'binary) + (coding-system-for-read 'binary) + (find-buffer-file-type-function + (if (fboundp 'find-buffer-file-type) + (symbol-function 'find-buffer-file-type) + nil))) + (unwind-protect + (progn + (fset 'find-buffer-file-type (lambda (filename) t)) + (insert-file-contents filename visit beg end replace)) + (if find-buffer-file-type-function + (fset 'find-buffer-file-type find-buffer-file-type-function) + (fmakunbound 'find-buffer-file-type))))))) (defun find-file-noselect (filename &optional nowarn rawfile) "Read file FILENAME into a buffer and return the buffer. diff -u /scratch/vroonhof/cvs/xemacs-20/xemacs-packages/lisp/efs/efs.el~ /scratch/vroonhof/cvs/xemacs-20/xemacs-packages/lisp/efs/efs.el --- /scratch/vroonhof/cvs/xemacs-20/xemacs-packages/lisp/efs/efs.el~ Tue Jun 15 20:45:13 1999 +++ /scratch/vroonhof/cvs/xemacs-20/xemacs-packages/lisp/efs/efs.el Tue Jun 15 20:45:13 1999 @@ -88,6 +88,7 @@ ;;; get-file-buffer ;;; insert-directory ;;; insert-file-contents +;;; insert-file-contents-literally ;;; list-directory ;;; make-directory-internal ;;; rename-file @@ -7011,10 +7012,21 @@ (efs-set-buffer-mode)) (error "efs-write-region called for a local file"))))) -(defun efs-insert-file-contents (filename &optional visit &rest args) +(defun efs-insert-file-contents (filename &rest args) ;; Inserts file contents for remote files. ;; The additional ARGS covers V19 BEG and END. Should also handle the ;; CODING-SYSTEM arg for mule. Hope the two don't trip over each other. + (apply 'efs-insert-file-contents-general 'insert-file-contents filename args)) + +(defun efs-insert-file-contents-literally (filename &rest args) + ;; Inserts file contents for remote files. + ;; The additional ARGS covers V19 BEG and END. Should also handle the + ;; CODING-SYSTEM arg for mule. Hope the two don't trip over each other. + (apply 'efs-insert-file-contents-general 'insert-file-contents-literally + filename args)) + +(defun efs-insert-file-contents-general + (handled-func filename &optional visit &rest args) (barf-if-buffer-read-only) (unwind-protect (let* ((filename (expand-file-name filename)) @@ -7055,7 +7067,7 @@ (format "Retrieving %s" abbr) (efs-cont (result line cont-lines) (filename visit buffer host-type - temp args) + temp handled-func args) (if result (signal 'ftp-error (list "Opening input file" @@ -7073,7 +7085,7 @@ (file-readable-p temp)) (setq i-f-c-size - (nth 1 (apply 'insert-file-contents + (nth 1 (apply handled-func temp visit args))) (signal 'ftp-error (list @@ -10449,6 +10461,7 @@ ;; I/O (put 'insert-file-contents 'efs 'efs-insert-file-contents) +(put 'insert-file-contents-literally 'efs 'efs-insert-file-contents-literally) (put 'write-region 'efs 'efs-write-region) (put 'directory-files 'efs 'efs-directory-files) (put 'list-directory 'efs 'efs-list-directory)