Gnus development mailing list
 help / color / mirror / Atom feed
From: Niklas Morberg <niklas.morberg@axis.com>
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	[thread overview]
Message-ID: <uy91go3o2.fsf_-_@axis.com> (raw)
In-Reply-To: <uwuhi6gy2.fsf@axis.com> (Niklas Morberg's message of "Fri, 25 Apr 2003 11:53:57 +0200")

[-- Attachment #1: Type: text/plain, Size: 724 bytes --]

Niklas Morberg <niklas@axis.com> 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?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Use shell-command-on-region in pgg-gpg-process-region --]
[-- Type: text/x-patch, Size: 910 bytes --]

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

[-- Attachment #3: Type: text/plain, Size: 221 bytes --]


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

  reply	other threads:[~2003-05-09  9:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-13 14:07 Getting gpg (or is it pgg?) to play nice with proxy Niklas Morberg
2003-04-17  8:57 ` Niklas Morberg
2003-04-25  9:53   ` Niklas Morberg
2003-05-09  9:44     ` Niklas Morberg [this message]
2003-05-13 18:09       ` [PATCH] Use shell-command-on-region in pgg-gpg.el Lars Magne Ingebrigtsen
2003-05-14  7:15         ` Niklas Morberg
2003-05-14  8:31           ` Simon Josefsson
2003-05-14  9:51             ` Niklas Morberg
2003-05-14  9:59               ` Simon Josefsson
2003-05-16 16:41         ` Dave Love
2003-05-10  8:03   ` Getting gpg (or is it pgg?) to play nice with proxy Simon Josefsson
2003-05-12  9:16     ` Niklas Morberg
2003-05-12 12:05       ` Simon Josefsson
2003-05-13  7:43         ` Niklas Morberg

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=uy91go3o2.fsf_-_@axis.com \
    --to=niklas.morberg@axis.com \
    /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).