nmh-workers
[Top] [All Lists]

Re: [nmh-workers] can comp return the filename of the newly created draft?

2018-06-15 10:42:58
Hello Eduardo,

I've been toying with creating a vim frontend for nmh, taking as much
advantage The way I have currently envisioned the process is to call
comp within the editor (using -nowhatnow and -noedit), and have the
editor open a new buffer with the newly created draft. However, for
this to work I'd need to know the name of the newly created draft,
specially if there's more than one available draft. Is there a way to
receive this information from comp itself (or from any other nmh
tool)?

It's a bit fiddly, with edge cases.

    $ echo path: $PWD >profile
    $ export MH=$PWD/profile
    $ mhparam draft-folder
    $ comp -noedit -nowhatnowproc
    ========================================================================
    Welcome to nmh version 1.7+dev
...
    Press enter to continue: 

    $ ls
    context  draft  profile
    $ cat draft
    From: Ralph Corderoy <ralph@...inputplus.co.uk>
    To:
    cc:
    Fcc: +outbox
    Subject:
    --------
    $
    $ echo draft-folder: drafts >>profile
    $ mhparam draft-folder
    drafts
    $
    $ comp -noedit -nowhatnowproc
    Create folder "/home/tmp/1529073058.514439883/drafts"? yes
    $ mhpath +$(mhparam draft-folder) last
    /home/tmp/1529073058.514439883/drafts/1
    $ comp -noedit -nowhatnowproc
    $ comp -noedit -nowhatnowproc
    $ mhpath +$(mhparam draft-folder) last
    /home/tmp/1529073058.514439883/drafts/3
    $

-- 
Cheers, Ralph.
https://plus.google.com/+RalphCorderoy

-- 
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>