[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [nmh-workers] can comp return the filename of the newly created draf
From: |
Ralph Corderoy |
Subject: |
Re: [nmh-workers] can comp return the filename of the newly created draft? |
Date: |
Fri, 15 Jun 2018 15:38:15 +0100 |
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 <address@hidden>
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