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

Re: Prompt escape sequences.



> I wanted to add a new escape sequence %${varname} to print the
> content of a variable. Looking at putpromptchar, I found some
> bugs...

Thank you for the bugfix.  But I really do not see the usefullness of the
%${varnane} feature.  The same can be achieved using the promptsubst
option.  The %${...} syntax can create confusion since it is identical to
the parameter expansion syntax.

> print -P %-%7-
> 	outputs '%-%-' instead of '%-%7-'.
> 	I did not correct this behaviour.
> 	It may be easy to do.

I do not think it is a bug.  %% should always be used to put a % into the
prompt since future versions may introduce new % sequences.

After looking at this patch I thought that a new point to the
Util/zsh-development-guide might be useful.  I think that this should go
under Etc.  Richard, why did you put it into Util when you created it?


 6) Please try not using lines longer than 79 characters.  The coding style
    is Kernighan and Ritchie with 4 characters indentations.  This means
    that the opening brace is the last character in the line of the
    if/while/for/do statement and the closing brace has its own line:
 
        if (foo) {
 	   do that
        }
 
    Put only one command in a line (this also means that the body of an
    if/while/for/do statement has its own line with 4 characters indentation
    even if there are no braces).  Do not use space between the function
    name and the opening parenthesis.  Use space after if/for/while.  Use
    space after type casts.  Do not use (unsigned char) casts since some
    compilers do not handle them properly.  Use the provided STOUC(X) macro
    instead.
 
    If you use emacs 19.30 or newer you can put the following line to your
    ~/.emacs file to make these formatting rules the default:
 
    (add-hook 'c-mode-common-hook (function (lambda () (c-set-style "BSD"))))
 
    A global function declaration must look like this:
 
 /**/
 int
 foo(char *s, char **p)
 {
     function body
 }
 
     There must be an empty line, a line with /**/, a line with the type of
     the function and finally the name of the function with typed arguments.
     These lines should not be indented.  This rule is a must because the
     script generating function prototypes and the ansi2knr program depends
     on this format.

Zoltan



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