Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] 2 modules, zsh/db, zsh/gdbm, bug-fixes



On Jun 25, 10:06am, Sebastian Gniazdowski wrote:
}
} As for folding, I attach Emacs screenshot, to show it really helps.
} Learned the folds from reading NERDTree source (vim plugin), it was
} huge, but had the folds and they helped.

Is this really more helpful than selective-display?

Ctrl-u 1 Ctrl-x $

Gives you e.g. (copied from builtin.c):

/* Print a builtin */

/**/
static void
printbuiltinnode(HashNode hn, int printflags)
{...
}

/**/
static void
freebuiltinnode(HashNode hn)
{...
}


I find that more useful than a comment with just the function name, and
it's easier to avoid redundancy or the comment being out of date with
respect to what's inside it, as well.  Also if the 4-space indentation
has been followed carefully enough, you incrementally unfold by adding
4 to the previous selective-display level, e.g.

Ctrl-u 5 Ctrl-x $

/* Print a builtin */

/**/
static void
printbuiltinnode(HashNode hn, int printflags)
{
    Builtin bn = (Builtin) hn;

    if (printflags & PRINT_WHENCE_WORD) {...
    }

    if (printflags & PRINT_WHENCE_CSH) {...
    }

    if (printflags & PRINT_WHENCE_VERBOSE) {...
    }

    /* default is name only */
    printf("%s\n", bn->node.nam);
}



Messages sorted by: Reverse Date, Date, Thread, Author