From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/40857 Path: main.gmane.org!not-for-mail From: ShengHuo ZHU Newsgroups: gmane.emacs.gnus.general Subject: Re: request feedback on new function gnus-dired-attach Date: Sat, 15 Dec 2001 01:12:00 -0500 Sender: owner-ding@hpc.uh.edu Message-ID: <2ny9k52erz.fsf@zsh.cs.rochester.edu> References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035176344 3111 80.91.224.250 (21 Oct 2002 04:59:04 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 04:59:04 +0000 (UTC) Return-Path: Original-Received: (qmail 12385 invoked from network); 15 Dec 2001 06:13:32 -0000 Original-Received: from malifon.math.uh.edu (mail@129.7.128.13) by mastaler.com with SMTP; 15 Dec 2001 06:13:32 -0000 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 16F84D-0001jF-00; Sat, 15 Dec 2001 00:13:01 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Sat, 15 Dec 2001 00:12:47 -0600 (CST) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id AAA21399 for ; Sat, 15 Dec 2001 00:12:33 -0600 (CST) Original-Received: (qmail 12376 invoked by alias); 15 Dec 2001 06:12:40 -0000 Original-Received: (qmail 12371 invoked from network); 15 Dec 2001 06:12:40 -0000 Original-Received: from roc-24-95-193-9.rochester.rr.com (HELO zsh.2y.net) (@24.95.193.9) by gnus.org with SMTP; 15 Dec 2001 06:12:40 -0000 Original-Received: (from zsh@localhost) by zsh.2y.net (8.11.6/8.11.2) id fBF6C1b17468; Sat, 15 Dec 2001 01:12:01 -0500 Original-To: ding@gnus.org X-Attribution: ZSH X-Face: 'IF:e51ib'Qbl^(}l^&4-J`'P!@[4~O|&k#:@Gld#b/]oMq&`&FVY._3+b`mzp~Jeve~/#/ ERD!OTe<86UhyN=l`mrPY)M7_}`Ktt\K+58Z!hu7>qU,i.N7TotU[FYE(f1;}`g2xj!u*l`^&=Q!g{ *q|ddto|nkt"$r,K$[)"|6,elPH= GJ6Q Mail-Copies-To: never In-Reply-To: (Benjamin Rutt's message of "Fri, 14 Dec 2001 19:19:44 -0500") Original-Lines: 63 User-Agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1.50 (i686-pc-linux-gnu) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:40857 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:40857 Benjamin Rutt writes: [...] > 2) whether and how to integrate this code into gnus. You'll note that > the last line: > > (define-key dired-mode-map [(control c) (control a)] 'gnus-dired-attach) > > is somewhat ugly, since we are defining a dired keymap in another > area of code. Paul Jarc, on the above g.e.g thread, suggested that > we define a gnus-dired minor mode which can contain the keymap. > But I'm not sure if that's better, since ultimately we're still > stealing a possible future dired keybinding (C-c C-a currently > isn't defined in dired-mode). Maybe that last line should simply > go in users ~/.gnus so the users control the keybinding override? Why not do both? We can steal a special (or customizable) prefix for gnus-dired minor mode. Users still can set C-c C-a in dired-mode-map to the function. This would be less intrusive. > 3) whether you think this should exist as a separate file that isn't > included in gnus. It is better to add a separate file, say gnus-dired.el, for gnus-dired minor mode. If you'd like to add your code to Gnus package, you'd better send an assignment form to FSF (unless you've signed the form). I can send you the request form. In addition, I have a piece of code to open file (in dired-mode) according to mailcap. I'd like to include it too. > Here begins the code. It should be enough to place this code in your > ~~/.gnus, evaluate it, and then start attaching files from dired > buffers via C-c C-a (with or without starting message compositions > first). Thanks. > > ---------------------------------------------------------------------- > > (defun gnus-dired-attach () > "Attach dired's marked files to a gnus message composition." > (interactive) > (let* ((files-to-attach > ;; don't attach directories > (delq nil > (mapcar > (lambda (f) (if (file-directory-p f) nil f)) > (nreverse (dired-map-over-marks (dired-get-filename) nil))))) How about use files-to-attach as an argument? So the function can be called from other codes too. (defun gnus-dired-attach (files-to-attach) "Attach dired's marked files to a gnus message composition." (interactive (list (delq nil (mapcar (lambda (f) (if (file-directory-p f) nil f)) (nreverse (dired-map-over-marks (dired-get-filename) nil)))))) ...) ShengHuo