From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/77230 Path: news.gmane.org!not-for-mail From: Hobbit Newsgroups: gmane.emacs.gnus.general Subject: Re: Attach file improvement Date: Wed, 23 Feb 2011 23:14:52 +0200 Message-ID: <87ei6y4fn7.fsf@myhost.localdomain> References: <87d3mkb7bu.fsf@myhost.localdomain> <8762scb5ea.fsf@myhost.localdomain> <87aahnaijh.fsf@myhost.localdomain> <871v2z2hyj.fsf@gnus.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1298495535 14890 80.91.229.12 (23 Feb 2011 21:12:15 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 23 Feb 2011 21:12:15 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M25562@lists.math.uh.edu Wed Feb 23 22:12:11 2011 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PsM0H-0006Lq-BF for ding-account@gmane.org; Wed, 23 Feb 2011 22:12:09 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1PsLzz-00066h-Mk; Wed, 23 Feb 2011 15:11:51 -0600 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1PsLzx-00066K-9M for ding@lists.math.uh.edu; Wed, 23 Feb 2011 15:11:49 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1PsLzt-0003uz-47 for ding@lists.math.uh.edu; Wed, 23 Feb 2011 15:11:49 -0600 Original-Received: from forward6.mail.yandex.net ([77.88.60.125]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1PsLzr-0007AL-NH for ding@gnus.org; Wed, 23 Feb 2011 22:11:43 +0100 Original-Received: from smtp9.mail.yandex.net (smtp9.mail.yandex.net [77.88.61.35]) by forward6.mail.yandex.net (Yandex) with ESMTP id 661A7F820AD for ; Thu, 24 Feb 2011 00:11:38 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1298495498; bh=Zv2HI5xmASbktSZKRYQa/hDUPRPtTs+E/1iHt/bf+Q4=; h=From:To:Subject:References:Date:In-Reply-To:Message-ID: MIME-Version:Content-Type; b=wtVa2+i7okMA3uj2wPViIv3Gr36AsoJe5ct5KpgmKrBsBdLHKBgRQn2sKQaWcgOCJ Hnp48xZH/pINuZ6Gbtoga5WUCvaZV9frtRJu6i4d1I0p6BVkUM9Hd08IqIghi8Ou2J LQWbhrp8KuiRdeWltwhU2chCBsoLkFqowsw8w1AQ= Original-Received: from myhost.localdomain (114-20-95-178.pool.ukrtel.net [178.95.20.114]) by smtp9.mail.yandex.net (Yandex) with ESMTPSA id 3C9224BA00BC for ; Thu, 24 Feb 2011 00:11:31 +0300 (MSK) In-Reply-To: <871v2z2hyj.fsf@gnus.org> (Lars Ingebrigtsen's message of "Wed, 23 Feb 2011 01:55:32 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Spam-Score: 0.3 (/) X-Spam-Report: SpamAssassin (3.3.1 2010-03-16) analysis follows Bayesian score: 0.0000 Ham tokens: 0.000-1729--4315h-0s--0d--H*u:Emacs, 0.000-1660--4144h-0s--0d--H*u:Gnus, 0.000-1602--3999h-0s--0d--H*u:linux, 0.000-1602--3999h-0s--0d--H*UA:linux, 0.000-1544--3855h-0s--0d--H*UA:gnu Spam tokens: 0.998-22280--199h-271676s--0d--UD:ru, 0.987-1--0h-1s--0d--yandexru, 0.987-1--0h-1s--0d--UD:yandex.ru, 0.987-1--0h-1s--0d--yandex.ru, 0.987-1--0h-1s--0d--H*r:sk:forward Autolearn status: no 0.0 FREEMAIL_FROM Sender email is freemail (werehobbit[at]yandex.ru) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, low trust [77.88.60.125 listed in list.dnswl.org] 2.3 FSL_RU_URL URI: FSL_RU_URL -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 T_TO_NO_BRKTS_FREEMAIL T_TO_NO_BRKTS_FREEMAIL List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:77230 Archived-At: Lars Ingebrigtsen writes: > This patch is more than 10 lines long, so we'll need FSF copyright > assignment papers. Do you have assignment papers on file with the > FSF? Well, if you compare my patch with the original file mml.el you'd see that it mostly consists of mere copy of old Gnus code: For example, fragments from mml.el: ;; mml.el line #1197 (defun mml-minibuffer-read-disposition (type &optional default filename) (unless default (setq default (mml-content-disposition type filename))) (let ((disposition (completing-read ;; <-- look (format "Disposition (default %s): " default) '(("attachment") ("inline") ("")) nil t nil nil default))) (if (not (equal disposition "")) disposition default))) ;;mml.el line #1280 (defun mml-attach-file (file &optional type description disposition) ;;mml.el line #1296 (list file type description disposition))) ;; mml.el line #491 (if (and (not raw) (member (car (split-string type "/")) '("text" "message"))) And this is the patch: +(defun mml-minibuffer-read-charset (&optional default);; copy&rename + (let ((charset (completing-read ;;<----- variable renamed + (format "Charset: " default) ;; <-- prompt changed + mm-mime-mule-charset-alist + nil t nil nil default))) ;; just copied + (if (not (equal charset "")) ;; just copied + charset ;; just copied + default))) ;; just copied +(defun mml-attach-file (file &optional type description ;; copied + disposition charset);; <- param added +body) or \"attachment\" (separate from the body). CHARSET is file +charset." + (charset (when (member (car (split-string type "/")) + '("text" "message")) ;; partial copy + (mml-minibuffer-read-charset)));; from line #491 + (list file type description disposition charset)));; var added + 'charset charset ;; var added So my autorship is much smaller than it could seem. "Real" weight of the patch is near 10 lines (if not less). >> | C-c C-a >> | Attach file: ~/file.txt >> | Content type (default text/plain): >> | Charset: cp855 > > The other thing I don't quite understand is that Emacs is usually > able to tell what the charset is automatically, so why does the user > need to be prompted here? Unfortunately, in the cyrillic world things are much more difficult, because there are several popular charsets which use same codes for different cyrillic letters. For example, a file with contents (in hex codes) 0xCE, 0xC5, 0xD4 could be read using charset koi8-r as CYRILLIC SMALL LETTER EN CYRILLIC SMALL LETTER IE CYRILLIC SMALL LETTER TE whereas in charset windows-1251 it's CYRILLIC CAPITAL LETTER O CYRILLIC CAPITAL LETTER IE CYRILLIC CAPITAL LETTER EF So how could we know what charset to use without asking a user?