Gnus development mailing list
 help / color / mirror / Atom feed
From: Eric Marsden <emarsden@mail.dotcom.fr>
Subject: Re: Pterodactyl Gnus v0.92 is released
Date: 29 Jul 1999 13:46:32 +0200	[thread overview]
Message-ID: <wzik8rjvftz.fsf@mail.dotcom.fr> (raw)
In-Reply-To: Eric Marsden's message of Mon, 12 Jul 1999 11:54:19 GMT

>>>>> "ecm" == Eric Marsden <emarsden@mail.dotcom.fr> 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.



      reply	other threads:[~1999-07-29 11:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-07-06 11:04 Lars Magne Ingebrigtsen
1999-07-07  0:49 ` Stainless Steel Rat
1999-07-09 17:04   ` Lars Magne Ingebrigtsen
1999-07-12 11:53     ` Eric Marsden
1999-07-29 11:46       ` Eric Marsden [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=wzik8rjvftz.fsf@mail.dotcom.fr \
    --to=emarsden@mail.dotcom.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).