From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 118255255552 X-Google-Groups: supmua X-Google-Thread: 3030fda1bf,de37ab03d5293e7 X-Google-Attributes: gid3030fda1bf,domainid0,public,googlegroup X-Google-NewGroupId: yes X-Received: by 10.112.167.165 with SMTP id zp5mr224484lbb.9.1410979612527; Wed, 17 Sep 2014 11:46:52 -0700 (PDT) X-BeenThere: supmua@googlegroups.com Received: by 10.152.2.194 with SMTP id 2ls147786law.108.gmail; Wed, 17 Sep 2014 11:46:51 -0700 (PDT) X-Received: by 10.152.26.225 with SMTP id o1mr7340lag.4.1410979611957; Wed, 17 Sep 2014 11:46:51 -0700 (PDT) Return-Path: Received: from mail-wg0-x22a.google.com (mail-wg0-x22a.google.com [2a00:1450:400c:c00::22a]) by gmr-mx.google.com with ESMTPS id cd14si8285wib.1.2014.09.17.11.46.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Sep 2014 11:46:51 -0700 (PDT) Received-SPF: pass (google.com: domain of matthieu.rakotojaona@gmail.com designates 2a00:1450:400c:c00::22a as permitted sender) client-ip=2a00:1450:400c:c00::22a; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of matthieu.rakotojaona@gmail.com designates 2a00:1450:400c:c00::22a as permitted sender) smtp.mail=matthieu.rakotojaona@gmail.com; dkim=pass header.i=@gmail.com; dmarc=pass (p=NONE dis=NONE) header.from=gmail.com Received: by mail-wg0-f42.google.com with SMTP id x12so1835735wgg.25 for ; Wed, 17 Sep 2014 11:46:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:in-reply-to:references:date:message-id:user-agent :content-transfer-encoding:mime-version:content-type; bh=GZZIyY6dD3fJ4Z5wGl2uuwTLjDeon00y+rLOSeubl+w=; b=jj8vsHcgsl9aLHMWr674o30wWlRFiAH8Lk4OpI4XtF4/Znogk009vI/9cjdcCc3Ik9 beuczByB1cxtWQ4+8ToY6dPFSSYyOzXoDRW75Q84Qxb/u69BFTE21pIiPTnxQEwj5RDp /miG0MzBEPbYpPonbJYePzPWCc+jT8Q8kHbD4/WOxiQ/P+Px1lIAwzbZD/DYeW8okKcg b/+Gg9kaob1dDVULwvaJtq2Wd41qu9Vz/k6Mc5j/lmFUDhLtueiR0269vVouyNZU0rUK QQhGg/5aZczQaScUY0Gg92xqSY9urj0XE1ZsJqpnMzrjNT7dsq4dtu/wKKwuNJKYbAZ2 yOJg== X-Received: by 10.180.36.84 with SMTP id o20mr15552689wij.9.1410979611863; Wed, 17 Sep 2014 11:46:51 -0700 (PDT) Return-Path: Received: from localhost.localdomain (155-29-190-109.dsl.ovh.fr. [109.190.29.155]) by mx.google.com with ESMTPSA id bt9sm23079510wjc.44.2014.09.17.11.46.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Sep 2014 11:46:50 -0700 (PDT) Received: from localhost (localhost.localdomain [IPv6:::1]); by localhost.localdomain (OpenSMTPD) with ESMTP id 78674ae3; for ; Wed, 17 Sep 2014 18:46:47 +0000 (UTC) From: Matthieu Rakotojaona To: supmua Subject: Re: [sup] how to write interactive hook In-reply-to: <1410717805-sup-9254@ruthard-lappi> References: <1410717805-sup-9254@ruthard-lappi> X-pgp-key: http://otokar.looc2011.eu/static/matthieu.rakotojaona.asc Date: Wed, 17 Sep 2014 20:46:40 +0200 Message-Id: <1410977422-sup-7119@kpad> User-Agent: Sup/0.19.0 Content-Transfer-Encoding: 8bit MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; boundary="=-1410979606-674667-17408-1135-2-=" --=-1410979606-674667-17408-1135-2-= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Excerpts from Ruthard Baudach's message of 2014-09-14 20:07:27 +0200: > Dear list, > = > I'd like to activate the signature hook. I have got two email addresses= > that I put for both private colloquial and privat formal use as well as= occasional > professional use. > = > Therefor I have to base the signature of the mail currently composed on= > the content of the mail and not on the From: header. > = > But how can I write an interactive hook? > = > puts puts a string in the status line, but gets crashes the hook > = > I'd like to have a prompt: > Choose signature [1* 2 3 4] > and to be able to enter the appropriate key to choose > = > Yours, Ruthard Hello, I'm afraid you're not going to be able to do this with a hook; you're gonna have to change the core of sup. At a quick glance, the most straightforward thing for you to do is to play with the selectors in edit_message_mode; these are the choices you get at the top of the mode. See @account_selector and @crypto_selector in edit_message_mode.initialize. What you can do is add a @signature_selector, displaying all possible signatures associated to your account and allowing you to choose the one you want. You'll certainly have to then re-call edit_message_mode.sig_lines depending on the choice you make, and maybe other parts in edit_message_mode too. >From a config point of view, here's what you'd have to change: - add a "signatures" setting, with a folder that has a list of files; each file would contain a different signature and the selector I mentioned earlier will offer a choice between file names: $ head ~/.config/sup/signatures/* =3D=3D> work <=3D=3D Serious Business Inc. =3D=3D> family <=3D=3D Matthieu Rakotojaona =3D=3D> friends <=3D=3D rakoo This particular setting would give me a choice between "work", "family" and "friends" when editing a message - keep a possibilty to set a "signature" in the account for backwards compatibility (and people with only 1 signature) Good luck ! (Also random idea, slightly related to the subject: if neither signature nor signatures is specified in the account, put a default signature that contains the name of the user as specified in the account ? That default sounds reasonable enough to me) -- = Matthieu Rakotojaona --=-1410979606-674667-17408-1135-2-= Content-Disposition: attachment; filename="signature.asc" Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJUGdcWXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQwNkQ3NDcxMDJFRUU4MEYwRTY4MzQwMkEz QTc0RTE5NDVDM0Q5NzIyAAoJEDp04ZRcPZcisl8P/2Mn+KbsApPaDfC0klNOaG57 RHepqe5jjR/XdBEy4/MN7QOPjfy9qf11ayHY8txJpDqJx6aOwkuJoJnyAbGAQ9oe vJKob7WZ3Lgyxcsp4/lg15x4uRwknv8t4d7bt0z7pmhAg8MfrEMHCWzF1OP7DNzJ DFJF8oUIV2dGAkkNAHnxHhRMiiPvKIF08sB3rfooVPN5WQLaTUQ/B6M8/RS4sC0+ 8ZnGKhnAv/c2W3M8CzNfDpzjrqxSe20DEdB8sQWUN4X+AC4BElzg8IDygjnBZBW2 LllqBVossjA1O+FI052PlRKtijc69Xncbnpa6BSuQ07GSWNQgTXcCJFba6JevEID e2QXFEeNL2BvYjwr38DaghsFJH6ZcYL1Je+vxeYlD4GRTVpUK6ldu1Q3GmgVyh9s 1ERY5d92e9ufeoBMa0Zy+APHFUgva/vy29smLyF+MHxpzrUxTRWmPfoZpBu/VE6T XP87Ud0GK1+Fju19qQ9iwUFV7oygWhb9R9TYBqDTTXNmuKEG1YbRMdLNHYdeRPtb 0jIPXnJjrsJwsriOn+6KtLQT6UECcLcd6GEQTscDqhzB7q2BOT7bwM8hBmRZUPkP ohR30rwpNIn77hQK5HcrEbAMyIGq8dPu8DlTErE6q2bKQSFiAs2/tDTpQF14azfb wYY0qQi16odbLa7a8lOb =RzG6 -----END PGP SIGNATURE----- --=-1410979606-674667-17408-1135-2-=--