Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Re: nntp-encode-text corrupts text
       [not found]   ` <873ck926eg.fsf@eureka.mobilon>
@ 2003-04-23  9:20     ` Simon Josefsson
  2003-04-24 15:57       ` Ilya Goz
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Josefsson @ 2003-04-23  9:20 UTC (permalink / raw)


Ilya Goz <ivg@mobilon.ktk.ru> writes:

>  SJ> Could you try a more recent Emacs version?
>
> I'm using 21.2. Can anybody please confirm that it had been fixed in 21.3?
> I'd rather avoid a twenty-megabytes download...

I'm not sure it has been fixed in 21.3.  I remember that it was fixed
for CVS though.  The patch 21.2->21.3 is probably not very large,
perhaps you can get it instead.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: nntp-encode-text corrupts text
  2003-04-23  9:20     ` nntp-encode-text corrupts text Simon Josefsson
@ 2003-04-24 15:57       ` Ilya Goz
  2003-04-25 12:42         ` Simon Josefsson
  0 siblings, 1 reply; 3+ messages in thread
From: Ilya Goz @ 2003-04-24 15:57 UTC (permalink / raw)


 Simon Josefsson <jas@extundo.com> 11:20 23/4/2003 writes:

 SJ> I'm not sure it has been fixed in 21.3.  

Okay, I've got my hands at 21.3. It has been fixed. 

Meanwhile, I put into my .emacs the following hack, which, strangely
enough, do the work:

(require 'nntp)
(defun nntp-encode-text ()
  "Encode the text in the current buffer."
  (save-excursion
    ;; Replace "." at beginning of line with "..".
    (goto-char (point-min))
;    (while (re-search-forward "^\\." nil t)
;     (insert "."))
    ;; work around bug in re-search-forward
    (while (not (eobp)) 
      (if (looking-at "^\\.") (insert "."))
      (forward-line 1))
    (goto-char (point-max))
    ;; Insert newline at the end of the buffer.
    (unless (bolp)
      (insert "\n"))
    ;; Insert `.' at end of buffer (end of text mark).
    (goto-char (point-max))
    (insert ".\n")
    (goto-char (point-min))
    (while (not (eobp))
      (end-of-line)
      (delete-char 1)
      (insert nntp-end-of-line))))

What would be a proper way to replace definition of the function?

-- 
Ilya V. Goz


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: nntp-encode-text corrupts text
  2003-04-24 15:57       ` Ilya Goz
@ 2003-04-25 12:42         ` Simon Josefsson
  0 siblings, 0 replies; 3+ messages in thread
From: Simon Josefsson @ 2003-04-25 12:42 UTC (permalink / raw)


Ilya Goz <ivg@mobilon.ktk.ru> writes:

> What would be a proper way to replace definition of the function?

I think defadvice can do this.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-04-25 12:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <8765p6jvap.fsf@eureka.mobilon>
     [not found] ` <ilu1xzu1grh.fsf@latte.josefsson.org>
     [not found]   ` <873ck926eg.fsf@eureka.mobilon>
2003-04-23  9:20     ` nntp-encode-text corrupts text Simon Josefsson
2003-04-24 15:57       ` Ilya Goz
2003-04-25 12:42         ` Simon Josefsson

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).