From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/24547 Path: main.gmane.org!not-for-mail From: Eric Marsden Newsgroups: gmane.emacs.gnus.general Subject: Re: Pterodactyl Gnus v0.92 is released Date: 29 Jul 1999 13:46:32 +0200 Organization: LAAS-CNRS http://www.laas.fr/ Sender: owner-ding@hpc.uh.edu Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1035162095 9329 80.91.224.250 (21 Oct 2002 01:01:35 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 01:01:35 +0000 (UTC) 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 HAA29301 for ; Thu, 29 Jul 1999 07:50:42 -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.3/8.9.3) with ESMTP id GAB21877; Thu, 29 Jul 1999 06:47:09 -0500 (CDT) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Thu, 29 Jul 1999 06:47:45 -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 GAA15402 for ; Thu, 29 Jul 1999 06:47:32 -0500 (CDT) Original-Received: from laas.laas.fr (root@laas.laas.fr [140.93.0.15]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id HAA29275 for ; Thu, 29 Jul 1999 07:46:24 -0400 (EDT) Original-Received: from liszt.laas.fr (liszt [140.93.21.56]) by laas.laas.fr (8.9.3/8.9.3) with ESMTP id NAA28063 for ; Thu, 29 Jul 1999 13:46:19 +0200 (MET DST) Original-Received: (from emarsden@localhost) by liszt.laas.fr (8.9.3/8.9.3) id NAA07354; Thu, 29 Jul 1999 13:46:33 +0200 (MET DST) Original-To: ding@gnus.org X-Eric-Conspiracy: there is no conspiracy X-Attribution: ecm X-URL: http://www.chez.com/emarsden/ In-Reply-To: Eric Marsden's message of Mon, 12 Jul 1999 11:54:19 GMT Original-Lines: 57 X-Mailer: Gnus v5.3/Emacs 19.34 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:24547 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:24547 >>>>> "ecm" == Eric Marsden writes: ssr> Someone who is better with Gnus' innards should take a look at ssr> the new babel, I think: larsi> Yeah. And someone who is more familiar with babel.el. :-) larsi> larsi> The babel code in Gnus is very, very straightforward -- larsi> article-babel and article-babel-prompt in gnus-art.el. ecm> ok, I will have a look at it. this seems to work with XEmacs 20.4 and pgnus 0.95. --- gnus-art.el-orig Sat Jul 10 00:22:56 1999 +++ gnus-art.el Thu Jul 29 13:37:34 1999 @@ -1529,17 +1529,9 @@ (while (re-search-forward banner nil t) (delete-region (match-beginning 0) (match-end 0)))))))))) -(defun article-babel-prompt () - "Prompt for a babel translation." - (require 'babel) - (completing-read "Translate from: " - babel-translations nil t - (car (car babel-translations)) - babel-history)) - -(defun article-babel (translation) - "Translate article according to TRANSLATION using babelfish." - (interactive (list (article-babel-prompt))) +(defun article-babel () + "Translate article using an online translation service." + (interactive) (require 'babel) (save-excursion (set-buffer gnus-article-buffer) @@ -1547,14 +1539,12 @@ (let* ((buffer-read-only nil) (start (point)) (end (point-max)) - (msg (buffer-substring start end))) + (orig (buffer-substring start end)) + (trans (babel-as-string orig))) (save-restriction (narrow-to-region start end) (delete-region start end) - (babel-fetch msg (cdr (assoc translation babel-translations))) - (save-restriction - (narrow-to-region start (point-max)) - (babel-wash))))))) + (insert trans)))))) (defun article-hide-signature (&optional arg) "Hide the signature in the current article.