From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Reiner Steib Newsgroups: gmane.emacs.devel Subject: Re: pgg-encrypt is a pain in the neck Date: Sun, 31 Dec 2006 15:07:50 +0100 Message-ID: References: <6662a3b9-1148-4aa0-bd2d-29a67be38d76@well-done.deisui.org> <5a520e06-4ee3-4c4f-9345-d49a666516f9@well-done.deisui.org> <7f60c21d-2f66-4c4b-9abb-e377ca24a153@well-done.deisui.org> <844cd50a-ec18-4b09-a057-35bdfb5173fd@well-done.deisui.org> <8ba25607-9381-4a27-ae53-8b0f3ccc3ac1@well-done.deisui.org> <366fa6ab-42a0-4df5-a17f-4ac3d1744d78@well-done.deisui.org> Reply-To: Reiner Steib NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1167574102 19440 80.91.229.12 (31 Dec 2006 14:08:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 31 Dec 2006 14:08:22 +0000 (UTC) Cc: Daiki Ueno , rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 31 15:08:20 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1H11MG-0000e0-0X for ged-emacs-devel@m.gmane.org; Sun, 31 Dec 2006 15:08:16 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H11MF-0006oZ-HF for ged-emacs-devel@m.gmane.org; Sun, 31 Dec 2006 09:08:15 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H11M0-0006nY-OJ for emacs-devel@gnu.org; Sun, 31 Dec 2006 09:08:00 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H11Ly-0006lJ-Qm for emacs-devel@gnu.org; Sun, 31 Dec 2006 09:08:00 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H11Ly-0006lE-Li for emacs-devel@gnu.org; Sun, 31 Dec 2006 09:07:58 -0500 Original-Received: from [134.60.1.1] (helo=mail.uni-ulm.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1H11Lv-0000NH-2y; Sun, 31 Dec 2006 09:07:55 -0500 Original-Received: from bridgekeeper.physik.uni-ulm.de (bridgekeeper.physik.uni-ulm.de [134.60.10.123]) by mail.uni-ulm.de (8.13.8/8.13.8) with ESMTP id kBVE7p76012787; Sun, 31 Dec 2006 15:07:52 +0100 (MET) Original-Received: from viandante.physik.uni-ulm.de (bridgekeeper.physik.uni-ulm.de [134.60.10.123]) by bridgekeeper.physik.uni-ulm.de (Postfix) with SMTP id 8F69F1236D; Sun, 31 Dec 2006 15:07:51 +0100 (CET) Original-Received: (nullmailer pid 2162 invoked by uid 170); Sun, 31 Dec 2006 14:07:51 -0000 Original-To: Sascha Wilde X-Face: /U7=m^"/-Dn61mAl{g9e3>\G5Tp,oEX|V)g2I1hBk\ML; )7A?6cmB-y7y?'NA^J<=oz7syB =(McAwIHgLX!.B?R3X}98d@?>CrT094KLWh]WU4gDpnL/")MS(XoQTv`Oq225uL>+; CpPXo$N5e>N> $tPd-gbB^F{gQS#1ase]XO~D4p4M"3+F-7~u]dy3I?Pb8RO*H-EFeWDUf?Rf, d]pv\Jvh2Cht!A=im yKAS2Z%Ao^;}W/qzMvMm Mail-Followup-To: Sascha Wilde , Daiki Ueno , emacs-devel@gnu.org, rms@gnu.org In-Reply-To: (Sascha Wilde's message of "Sun\, 31 Dec 2006 13\:27\:28 +0100") User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.92 (gnu/linux) X-DCC-dcc.uncw.edu-Metrics: gemini 1201; Body=4 Fuz1=4 Fuz2=4 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:64563 Archived-At: On Sun, Dec 31 2006, Sascha Wilde wrote: > Daiki Ueno wrote: > >> I think it's not a bad idea to make pgg-encrypt (not pgg-encrypt-region) >> use such a heuristics, and actually it's not hard to implement. > > I agree, but don't know if it's TRTTD before the release. How about adding two simple wrapper functions to `sendmail.el'? `mail-encrypt-body' and `mail-decrypt-body'? Something *similar* to the commands below. I don't use Rmail and I'm not sure if the use of PGG especially in `mail-decrypt-body' is the right thing. And probably there should be a command to replace the encryped text with the decrypted text. --8<---------------cut here---------------start------------->8--- (defun mail-narrow-to-body () "Narrow to mail body, excluding mail headers." (goto-char (point-min)) (narrow-to-region (progn (mail-text) (point)) ;; Or (cf. `message-goto-body') ... ;; (or (search-forward (concat "\n" mail-header-separator "\n") nil t) ;; (search-forward-regexp "[^:]+:\\([^\n]\\|\n[ \t]\\)+\n\n" nil t)) (point-max))) (defun mail-encrypt-body () (interactive) (save-excursion (save-restriction (mail-narrow-to-body) (call-interactively 'pgg-encrypt)))) (defun mail-decrypt-body (&optional passphrase) (interactive) (save-excursion (save-restriction (mail-narrow-to-body) (if (apply 'pgg-decrypt-region (point-min) (point-max) passphrase) (pop-to-buffer pgg-output-buffer) (pgg-display-error-buffer))))) --8<---------------cut here---------------end--------------->8--- Bye, Reiner. -- ,,, (o o) ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/