From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/52465 Path: main.gmane.org!not-for-mail From: Niklas Morberg Newsgroups: gmane.emacs.gnus.general Subject: [PATCH] Use shell-command-on-region in pgg-gpg.el (was: Getting gpg (or is it pgg?) to play nice with proxy) Date: Fri, 09 May 2003 11:44:13 +0200 Sender: ding-owner@lists.math.uh.edu Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1052473424 24474 80.91.224.249 (9 May 2003 09:43:44 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 9 May 2003 09:43:44 +0000 (UTC) Original-X-From: ding-owner+M1009@lists.math.uh.edu Fri May 09 11:43:43 2003 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19E4Pg-0006Ls-00 for ; Fri, 09 May 2003 11:43:36 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 19E4Qe-0004EM-00; Fri, 09 May 2003 04:44:36 -0500 Original-Received: from sclp3.sclp.com ([64.157.176.121]) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 19E4QT-0004EE-00 for ding@lists.math.uh.edu; Fri, 09 May 2003 04:44:25 -0500 Original-Received: (qmail 20000 invoked by alias); 9 May 2003 09:44:24 -0000 Original-Received: (qmail 19995 invoked from network); 9 May 2003 09:44:24 -0000 Original-Received: from krynn.se.axis.com (193.13.178.10) by sclp3.sclp.com with SMTP; 9 May 2003 09:44:24 -0000 Original-Received: from PCNIKLAS (dh10-13-8-222.se.axis.com [10.13.8.222]) by krynn.se.axis.com (8.12.8p1/8.12.8/Debian-2woody1) with ESMTP id h499iEO5023832 for ; Fri, 9 May 2003 11:44:14 +0200 Original-To: ding@gnus.org In-Reply-To: (Niklas Morberg's message of "Fri, 25 Apr 2003 11:53:57 +0200") Mail-Followup-To: ding@gnus.org User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3.50 (windows-nt) Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:52465 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:52465 --=-=-= Niklas Morberg writes: >> In pgg-gpg.el, the function pgg-gpg-process-region uses >> call-process-region. My guess is that call-process-region >> does not use my proxy settings (defined in .emacs with >> setenv). >> >> Would it be possible to use shell-command-on-region instead? >> I think that this would work better, but I don't quite know >> how to change the function to test this as s-c-o-r takes >> different arguments than call-process-region. > > Would using shell-command-on-region break something else? With the following patch it is possible to get keys from servers through my proxy. The implementation probably sucks, but it works on my system. Does this break anything on other systems? --=-=-= Content-Type: text/x-patch Content-Disposition: attachment Content-Description: Use shell-command-on-region in pgg-gpg-process-region cd h:/pgnus/lisp/ diff -u -b "h:/pgnus/lisp/pgg-gpg.el.orig" "h:/pgnus/lisp/pgg-gpg.el" --- h:/pgnus/lisp/pgg-gpg.el.orig 2003-05-09 11:31:24.000000000 +0200 +++ h:/pgnus/lisp/pgg-gpg.el 2003-05-09 11:31:45.000000000 +0200 @@ -73,8 +73,12 @@ (insert passphrase "\n")) (insert input) (setq exit-status - (apply #'call-process-region (point-min) (point-max) program - nil errors-buffer nil args)))) + (shell-command-on-region (point-min) (point-max) + ;; call program with arguments + (let ((value program)) + (dolist (element args value) + (setq value (concat value " " element)))) + nil nil errors-buffer)))) (with-current-buffer (get-buffer-create output-buffer) (buffer-disable-undo) (erase-buffer) Diff finished at Fri May 09 11:31:56 --=-=-= I haven't been able to test the original implementation (since call-process-region does not use my proxy settings) and don't know if the output from the command is supposed to pop up in a new frame. Now it does. Niklas --=-=-=--