Discussions of development and use of the Sup email client
 help / color / mirror / Atom feed
From: Matthieu Rakotojaona <matthieu.rakotojaona@gmail.com>
To: supmua <supmua@googlegroups.com>
Subject: Re: [sup] how to write interactive hook
Date: Wed, 17 Sep 2014 20:46:40 +0200	[thread overview]
Message-ID: <1410977422-sup-7119@kpad> (raw)
In-Reply-To: <1410717805-sup-9254@ruthard-lappi>

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

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/*
  ==> work <==
  Serious Business Inc.

  ==> family <==
  Matthieu Rakotojaona

  ==> friends <==
  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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 949 bytes --]

  reply	other threads:[~2014-09-17 18:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-14 18:07 Ruthard Baudach
2014-09-17 18:46 ` Matthieu Rakotojaona [this message]
2014-09-18  5:51   ` [sup] " Gaute Hope
2014-09-18 17:46   ` Ruthard Baudach
2014-09-18 18:58     ` Gaute Hope
2014-09-18  9:34 ` Eric Weikl
2014-09-18 20:06 ` Ruthard Baudach
2014-09-18 20:15 ` Ruthard Baudach
2014-09-18 21:10   ` [sup] " Gaute Hope
2014-09-19 18:41     ` Ruthard Baudach
2014-09-21 17:20       ` Gaute Hope
2014-10-01 20:46         ` Ruthard Baudach
2014-10-06 12:05           ` Gaute Hope

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=1410977422-sup-7119@kpad \
    --to=matthieu.rakotojaona@gmail.com \
    --cc=supmua@googlegroups.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