nmh-workers
[Top] [All Lists]

Re: folder-specific defaults?

2002-06-28 13:30:31

nmh(_at_)harkless(_dot_)org said:
5- Userflags and component escapes. A generalized version of -fcc. 
  '-userflag fcc=thisfolder' is identical to '-fcc thisfolder'.
Eh?  I don't follow on this one... 

If you want to use %dansflag, you can in my version of nmh, by
including '-userflag dansflag=value' on the commandline. When I
added the %fcc, I realized that a more generalized aproach might
have been nicer. With this userflag option you can add any flag
that you can use in your format files. I must admit that I don't
use it for anything currently, it's just a better implementation
of -fcc. :) I'm afraid I'm not very good at explaining stuff like
this.

If c code is easier to understand, the implementation for comp is:

---
#define USERFLAGSW              14
    { "userflag userflag", 0 },
---
                case USERFLAGSW:
                    if (!(cp = *argp++) || *cp == '-')
                        adios (NULL, "missing argument to %s", argp[-2]);
                    dp = NULL;
                    if (userflag)
                        userflag = add (" ", userflag);
                    userflag = add (cp, userflag);
                    if (dp)
                        free (dp);
                    continue;
---
        compout(drft,outputlinelen,form,fcc,folder,userflag);
---
    if (userflag) {
        kp=vp=userflag;
        uflen=strlen(userflag);
        for (i=0;i<=uflen;i++) {
            if((userflag[i]==' ') || (userflag[i]=='\0')) {
                userflag[i]='\0';
                FINDCOMP (cptr, kp);
                if (cptr)
                    cptr->c_text = getcpy (vp);
                kp=vp=&userflag[i+1];
            }
            if((userflag[i]=='=') && (kp==vp)) {
                userflag[i]='\0';
                vp=&userflag[i+1];
            }
        }
    }
---

I'll take my laptop on holiday and spend some time on cleaning the 5
parts of my modification up with docs, and I'll post them here. Expect
them around august 10. Will give me a nice excuse not to have to go
outside. My wife may get angry though. :)

Tob


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