From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: mailcap viewers in dired; gnus-dired.el, mailcap.el Date: Thu, 11 Oct 2007 02:43:23 +0300 Organization: JURTA Message-ID: <877iluv99o.fsf@jurta.org> References: <87bqbhkhc6.fsf@baldur.tsdh.de> <58152.128.165.0.81.1191330286.squirrel@webmail.lanl.gov> <878x6ljwb4.fsf@baldur.tsdh.de> <87fy0r2u3z.fsf@baldur.tsdh.de> <87wsu1sear.fsf@baldur.tsdh.de> <878x6gqqfa.fsf@baldur.tsdh.de> <87abqt2x52.fsf@jurta.org> <87bqb8rmk2.fsf@jurta.org> <87ejg3q51o.fsf@jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1192060144 20735 80.91.229.12 (10 Oct 2007 23:49:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 10 Oct 2007 23:49:04 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 11 01:49:01 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IflIS-0000ut-4T for ged-emacs-devel@m.gmane.org; Thu, 11 Oct 2007 01:49:00 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IflIM-0005cZ-7W for ged-emacs-devel@m.gmane.org; Wed, 10 Oct 2007 19:48:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IflII-0005bX-9y for emacs-devel@gnu.org; Wed, 10 Oct 2007 19:48:50 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IflIH-0005ap-EG for emacs-devel@gnu.org; Wed, 10 Oct 2007 19:48:49 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IflIH-0005am-9O for emacs-devel@gnu.org; Wed, 10 Oct 2007 19:48:49 -0400 Original-Received: from mailman.kiev.sovam.com ([89.162.150.100]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IflIG-00037k-Pc for emacs-devel@gnu.org; Wed, 10 Oct 2007 19:48:49 -0400 Original-Received: from relay01.kiev.sovam.com ([62.64.120.200]) by mailman.kiev.sovam.com with esmtp (Exim 4.63 (FreeBSD)) (envelope-from ) id 1Ifo5P-00093z-FN for emacs-devel@gnu.org; Thu, 11 Oct 2007 02:47:43 +0000 Original-Received: from [83.170.232.243] (helo=smtp.svitonline.com) by relay01.kiev.sovam.com with esmtp (Exim 4.67) (envelope-from ) id 1IflIC-000KTf-LX for emacs-devel@gnu.org; Thu, 11 Oct 2007 02:48:45 +0300 In-Reply-To: (Reiner Steib's message of "Wed\, 10 Oct 2007 23\:20\:44 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux) X-Scanner-Signature: e7d6a74e6a41bfc4865bf8c76b21c35c X-DrWeb-checked: yes X-SpamTest-Envelope-From: juri@jurta.org X-SpamTest-Group-ID: 00000000 X-SpamTest-Header: Not Detected X-SpamTest-Info: Profiles 1581 [Oct 10 2007] X-SpamTest-Info: helo_type=3 X-SpamTest-Info: {HEADERS: header Content-Type found without required header Content-Transfer-Encoding} X-SpamTest-Method: none X-SpamTest-Rate: 25 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0255], KAS30/Release X-Detected-Kernel: FreeBSD 6.x (1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:80563 Archived-At: > In Emacs 22 (branch), ... > emacs22 -Q -l mailcap -l gnus-dired -f dired -f turn-on-gnus-dired-mode > ... loads more than 50 gnusy packages... > > ELISP> (length '(gnus-dired gnus-msg gnus-art mm-uu mml2015 pgg > pgg-parse pgg-def mm-view gnus-sum nnoo gnus-group gnus-undo nnmail > mail-source format-spec gnus-start gnus-spec gnus-int gnus-range > gnus-win message rfc822 mml mml-sec mml-smime smime dig mm-decode > mm-bodies mm-encode mailabbrev gmm-utils mailheader canlock sha1 > hex-util gnus nnheader gnus-util netrc mail-utils gnus-ems dired > regexp-opt mailcap mail-parse rfc2231 rfc2047 rfc2045 qp ietf-drums > mm-util mule-util time-date mail-prsvr)) > ==> 56 > > With these changes, only mailcap and gnus-dired are loaded. Most of these packages get loaded only for the function `gnus-dired-attach' in gnus-dired.el which is unrelated to running programs using the mailcap mechanism. When I manually eval `gnus-dired-find-file-mailcap' without loading gnus-dired.el, then the list of loaded packages is much smaller, maybe only the necessary packages get loaded. >> Thanks. Do you see any problems with this? > > I did only very limited testing. I tested that > `gnus-dired-find-file-mailcap' still works without loading unnecessary > gnusy packages. See the preliminary patches (against Gnus trunk) > below. I think the goal is not to fix gnus-dired.el to not load unnecessary packages when only one function is needed from this file, because this file is already ad-hoc and contains unrelated commands. I think we should only look at this file as an example of using the mailcap mechanism and create a more general commands not in the gnus directory. > Not a problem, but a TODO: `mailcap-mime-data' should be splitted. > IMHO, it should be composed of... > > (a) entries from a customizable variable > > (b) the data from MAILCAPS (`mailcap-parse-mailcaps') > > (c) Emacs-wide fallback entries for external viewers (e.g. for > Windows), cf. `mailcap-poor-system-types'. > > Of course, mailcap.el should prefer (a) over (b), and (b) over (c). I agree. This would be a good priority system. >> gnus-dired.el has a function `gnus-dired-attach' that is Gnus-specific. > > I think it could work with any message composition package that > supports using MML (Emacs MIME). I don't know if any other exists > beside (Gnus) Message mode. But it's MML-specific, yes. `gnus-dired-attach' already works well for attaching files to the Gnus messages, so I see no reason to change gnus-dired.el. What is more useful to do is to see whether calling mailcap-related functions (not in gnus-dired.el) will load too many packages. >> So I think it would be better to leave gnus-dired.el alone, and implement >> new commands in dired.el or dired-aux.el > > I don't use dired often, so I don't have a strong opinion how to > integrate mailcap functionality there. `gnus-dired-find-file-mailcap' has a serious deficiency: it always starts the program that happens to be the first in the list of equal mailcap alternatives without allowing the user to select the preferable program and possibly edit its command line. > I think the other functions `gnus-dired-attach' and `gnus-dired-print' > could be useful as well (cf. (info "(gnus)Other modes")). But they > surely need to be modified for if no other Gnus features should be > loaded. `P' (`dired-do-print') could provide a list of available printing commands from the mailcap file. >> (and maybe take into account the command guessing behaviour of ! in >> dired-x.el). > > `!' (`dired-do-shell-command') is not exactly what > `gnus-dired-find-file-mailcap' does. In mailcap.el you can also > specify Emacs-internal handling, IIRC. This is an interesting problem. It seems that Emacs-internal handling in mailcap-mime-data mostly duplicates auto-mode-alist, isn't it? -- Juri Linkov http://www.jurta.org/emacs/