Gnus development mailing list
 help / color / mirror / Atom feed
* Minor patches for CVS Gnus
@ 2003-02-08 16:08 Satyaki Das
  2003-02-08 18:53 ` Simon Josefsson
  0 siblings, 1 reply; 3+ messages in thread
From: Satyaki Das @ 2003-02-08 16:08 UTC (permalink / raw)



We have recently started using Gnus' MIME display code to display
messages in MH-E (the Emacs frontend to MH). It works quite nicely.
While working on this I came across a few potential bugs. Here they
are along with patches to fix them:

1. The function mm-display-external could leaks buffers. In this
   function assume that method is mailcap-save-binary-file. Then a
   new temporary buffer is generated and method is set to nil. That
   means that the cleanup forms in the unwind-protect doesn't free
   the buffer. I think the following patch fixes it.

Index: lisp/mm-decode.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/mm-decode.el,v
retrieving revision 6.87
diff -u -r6.87 mm-decode.el
--- lisp/mm-decode.el	3 Feb 2003 19:37:57 -0000	6.87
+++ lisp/mm-decode.el	8 Feb 2003 15:44:58 -0000
@@ -660,8 +660,7 @@
 		  (if method
 		      (funcall method)
 		    (mm-save-part handle))
-		(when (and (not non-viewer)
-			   method)
+		(when (not non-viewer)
 		  (mm-handle-set-undisplayer handle mm)))))
 	;; The function is a string to be executed.
 	(mm-insert-part handle)



2. The function mm-inline-emacs-image inserts a new line every
   time it is called. This means that if images are shown as
   buttons then a new line is inserted every cycle (show followed
   by hide). I think, this is only a problem for GNU Emacs. So I
   essentially copied the code for XEmacs and that seems to fix
   the problem. The following patch is what I did.

Index: lisp/mm-view.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/mm-view.el,v
retrieving revision 6.48
diff -u -r6.48 mm-view.el
--- lisp/mm-view.el	30 Oct 2002 07:54:59 -0000	6.48
+++ lisp/mm-view.el	8 Feb 2003 15:44:59 -0000
@@ -77,7 +77,10 @@
     (put-image (mm-get-image handle) b)
     (mm-handle-set-undisplayer
      handle
-     `(lambda () (remove-images ,b (1+ ,b))))))
+     `(lambda ()
+        (remove-images ,b (1+ ,b))
+        (delete-region ,(set-marker (make-marker) b)
+                       ,(set-marker (make-marker) (point)))))))
 
 (defun mm-inline-image-xemacs (handle)
   (insert "\n")



3. This isn't really a bug just a minor thing. I use pgg and don't
   like the way it blinks when used. Basically the contents of the
   buffer with the raw message is shown for a moment and then
   replaced with the buttons and all. I think this is caused
   because pgg calls gpg asynchronously with start-process. Since
   pgg then waits for the process to terminate any way I replaced
   start-process with call-process and the flashing goes away. I
   have used this for only a day or so, hence it is likely that
   this might cause other problems (there must be a reason why
   start-process was used in the first place).

Thanks,
Satyaki

Index: lisp/pgg-gpg.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/pgg-gpg.el,v
retrieving revision 6.8
diff -u -r6.8 pgg-gpg.el
--- lisp/pgg-gpg.el	2 Nov 2002 04:27:00 -0000	6.8
+++ lisp/pgg-gpg.el	8 Feb 2003 15:45:00 -0000
@@ -59,27 +59,22 @@
 	 (errors-buffer pgg-errors-buffer)
 	 (orig-mode (default-file-modes))
 	 (process-connection-type nil)
-	 process status exit-status)
+	 exit-status)
     (with-current-buffer (get-buffer-create errors-buffer)
       (buffer-disable-undo)
       (erase-buffer))
     (unwind-protect
 	(progn
 	  (set-default-file-modes 448)
-	  (let ((coding-system-for-write 'binary))
-	    (setq process
-		  (apply #'start-process "*GnuPG*" errors-buffer
-			 program args)))
-	  (set-process-sentinel process #'ignore)
-	  (when passphrase
-	    (process-send-string process (concat passphrase "\n")))
-	  (process-send-region process start end)
-	  (process-send-eof process)
-	  (while (eq 'run (process-status process))
-	    (accept-process-output process 5))
-	  (setq status (process-status process)
-		exit-status (process-exit-status process))
-	  (delete-process process)
+          (let* ((coding-system-for-write 'binary)
+                 (input (buffer-substring-no-properties start end)))
+            (with-temp-buffer
+              (when passphrase
+                (insert passphrase "\n"))
+              (insert input)
+              (setq exit-status
+                    (apply #'call-process-region (point-min) (point-max) program
+                           nil errors-buffer nil args))))
 	  (with-current-buffer (get-buffer-create output-buffer)
 	    (buffer-disable-undo)
 	    (erase-buffer)
@@ -87,12 +82,8 @@
 		(let ((coding-system-for-read 'raw-text-dos))
 		  (insert-file-contents output-file-name)))
 	    (set-buffer errors-buffer)
-	    (if (memq status '(stop signal))
-		(error "%s exited abnormally: '%s'" program exit-status))
-	    (if (= 127 exit-status)
-		(error "%s could not be found" program))))
-      (if (and process (eq 'run (process-status process)))
-	  (interrupt-process process))
+	    (if (not (equal exit-status 0))
+		(error "%s exited abnormally: '%s'" program exit-status))))
       (if (file-exists-p output-file-name)
 	  (delete-file output-file-name))
       (set-default-file-modes orig-mode))))



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

* Re: Minor patches for CVS Gnus
  2003-02-08 16:08 Minor patches for CVS Gnus Satyaki Das
@ 2003-02-08 18:53 ` Simon Josefsson
  2003-02-08 19:24   ` Satyaki Das
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Josefsson @ 2003-02-08 18:53 UTC (permalink / raw)
  Cc: ding

Satyaki Das <satyaki@chicory.stanford.edu> writes:

> 3. This isn't really a bug just a minor thing. I use pgg and don't
>    like the way it blinks when used.

Thanks alot, this was a known bug.

> Basically the contents of the buffer with the raw message is shown
> for a moment and then replaced with the buttons and all. I think
> this is caused because pgg calls gpg asynchronously with
> start-process. Since pgg then waits for the process to terminate any
> way I replaced start-process with call-process and the flashing goes
> away. I have used this for only a day or so, hence it is likely that
> this might cause other problems (there must be a reason why
> start-process was used in the first place).

I have committed it, thanks.  I think this patch was big enough to
require papers, would you be willing to fill out the form below?  Your
current assignment doesn't seem to cover Gnus.  Thanks.

Please email the following information to assign@gnu.org, and we will
send you the assignment form that covers the changes you have already
written.  That form will cover subsequent corrections to those
changes, but it will not cover other unrelated future changes to the
same program.

Please use your full legal name (in ASCII characters) as the subject line of the m
essage.
---------------------------------------------------------------------
REQUEST:  SEND FORM FOR CHANGES ALREADY MADE

[What is the name of the program or package you're contributing to?]


[Did you copy any files or text written by someone else in these changes?
Even if that material is free software, we need to know about it.]


[Do you have an employer who might have a basis to claim to own
your changes?  Do you attend a school which might make such a claim?]


[For the copyright registration, what country are you a citizen of?]


[What year were you born?]


[Please write your email address here.]


[Please write your postal address here.]





[Which files have you changed so far, and which new files have you written
so far?]




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

* Re: Minor patches for CVS Gnus
  2003-02-08 18:53 ` Simon Josefsson
@ 2003-02-08 19:24   ` Satyaki Das
  0 siblings, 0 replies; 3+ messages in thread
From: Satyaki Das @ 2003-02-08 19:24 UTC (permalink / raw)


Simon Josefsson <jas@extundo.com> writes:

> Satyaki Das <satyaki@chicory.stanford.edu> writes:
> 
> > 3. This isn't really a bug just a minor thing. I use pgg and don't
> >    like the way it blinks when used.
> 
> Thanks alot, this was a known bug.

You are welcome :-). Another thing I forgot to mention in my
previous mail. Changes along similar lines could be required in
pgg-pgp5-process-region and pgg-pgp-process-region. I don't have
PGP (or PGP5) installed so I haven't tried those.

> I have committed it, thanks.  I think this patch was big enough to
> require papers, would you be willing to fill out the form below?

Yes.

>                                                                   Your
> current assignment doesn't seem to cover Gnus.  Thanks.

I think my current assignment is only for MH-E. I will mail in the
assignment form ASAP.

Satyaki



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

end of thread, other threads:[~2003-02-08 19:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-08 16:08 Minor patches for CVS Gnus Satyaki Das
2003-02-08 18:53 ` Simon Josefsson
2003-02-08 19:24   ` Satyaki Das

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