BTS

Message1513

Author ft
Recipients kiste, mika
Date 2008-09-28.22:05:05
Content
Kai Wilke <bts@bts.grml.org>:
> Kai Wilke <kiste@netzworkk.de> added the comment:
> So ich habe mal ein neues diff erstellt. Die datei sieht im Kopf
> jetzt etwas anders aus, da ich die zshrc von grml nach
> zshrc-grml.orig umbenannt habe.

Danke, mal durchsehen...

> Wie schon geschrieben ist in den Hash Tabellen der Verzeichnisse
> der name von sdoc wieder auf doc zurück gesetzt worden.
> 
> An dem Namen log wird noch gerätselt. Ich würde den Namen nicht
> benutzen, aber ich benutze auch log in zlogin z. B..
> myzlogin:
> -----------------Snip--------------------------
> stty dec cr0 -tabs
> ttyctl -f  # freeze the terminal modes... can't change without a ttyctl -u
> mesg y
> uptime
> log
> from 2>/dev/null
> -------------------------Snap-----------------------

Wird allein schon durch Mikas Veto nichts werden.
Bei mir würde das in der zlogin auch locker gehen, da ich kein auto_cd
und kein cdable_vars setze. Bei grmls Default mit auto_cd aber ohne
cdable_vars sollte das auch keine Umstände machen.

> Der unsägliche ls-Hack wurde auch berichtigt.

Gut.

> --- zshrc-grml.orig	2008-09-11 12:13:12.000000000 +0200
> +++ zshrc	2008-09-28 21:03:01.768996988 +0200
> @@ -87,7 +87,7 @@
>  
>  # zsh profiling {{{
>  # just execute 'ZSH_PROFILE_RC=1 zsh' and run 'zprof' to get the details
> -if [[ -n $ZSH_PROFILE_RC ]] ; then
> +if [[ $ZSH_PROFILE_RC -gt 0 ]] ; then

ACK.

>      zmodload zsh/zprof
>  fi
>  # }}}
> @@ -431,9 +431,10 @@
>      [[ -d /etc/zsh/completion.d ]] && fpath=( $fpath /etc/zsh/completion.d )
>      if [[ -d /etc/zsh/functions.d ]] ; then
>          fpath+=( /etc/zsh/functions.d )
> -        for func in /etc/zsh/functions.d/[^_]*[^~] ; do
> +        for func in /etc/zsh/functions.d/[^_]*[^~](N.) ; do
>              zrcautoload -U ${func:t}
>          done
> +        unsetopt nonomatch
>      fi
>  fi
>  
> @@ -805,7 +806,7 @@
>      tmpargs=(
>          a   stat
>          a   zpty
> -        ap  zprof
> +        #ap  zprof

Hier die Zeile einfach löschen.
'zprof' wird oben geladen, wenn es gebraucht wird. Ich bezweifele das
Nutzer zprof oft auf der Kommando Zeile nutzen. Sollte tatsächlich
gejammert werden lasse ich mir etwas einfallen. Kurz: nicht
auskommentieren, löschen.

>          ap  mapfile
>      )
>  
> @@ -1003,16 +1004,26 @@
>  # }}}
>  
>  # {{{ display battery status on right side of prompt via running 'BATTERY=1 zsh'
> -if [[ -n "$BATTERY" ]] ; then
> -    if check_com -c acpi ; then
> -        PERCENT="${(C)${(s| |)$(acpi 2>/dev/null)}[4]}"
> -        [[ -z "$PERCENT" ]] && PERCENT='acpi not present'
> +if [[ $BATTERY -gt 0 ]] ; then
> +    if ! check_com -c acpi ; then
> +        BATTERY=0
> +    fi
> +fi

ACK.

>  
> -        if [[ "${PERCENT%%%}" -lt 20 ]] ; then
> -            PERCENT="warning: ${PERCENT}%"
> +battery() {
> +if [[ $BATTERY -gt 0 ]] ; then
> +    PERCENT="${${"$(acpi 2>/dev/null)"}/(#b)[[:space:]]##Battery <->: [^0-9]##, (<->)%*/${match[1]}}"
> +    if [[ -z "$PERCENT" ]] ; then
> +        PERCENT='acpi not present'
> +    else
> +        if [[ "$PERCENT" -lt 20 ]] ; then
> +            PERCENT="warning: ${PERCENT}%%"
> +        else
> +            PERCENT="${PERCENT}%%"
>          fi
>      fi
>  fi
> +}

ACK.

>  # }}}
>  
>  # set colors for use in prompts {{{
> @@ -1630,8 +1641,8 @@
>  # make sure to use right prompt only when not running a command
>  is41 && setopt transient_rprompt
>  
> -is4 && [[ -z $NOPRECMD ]] && precmd () {
> -    [[ -n $NOPRECMD ]] && return 0
> +is4 && [[ $NOPRECMD -lt 1 ]] && precmd () {

Wie in meiner anderen Mail gesagt:
Bitte nicht -lt 1 sondern -eq 0; ich halte folgende Semantik für
sinnvoll:
    + Parameter gleich 0: false
    + Parameter größer 0: true

Daher: [[ $PARAM -gt 0 ]] und [[ $PARAM -eq 0 ]] als Tests.

> +    [[ $NOPRECMD -gt 0 ]] && return 0
>      # update VCS information
>      vcs_info
>  
> @@ -1641,8 +1652,10 @@
>          # return 0
>      fi
>      # just use DONTSETRPROMPT=1 to be able to overwrite RPROMPT
> -    if [[ -z $DONTSETRPROMPT ]] ; then
> -        if [[ -n $BATTERY ]] ; then
> +    if [[ $DONTSETRPROMPT -lt 1 ]] ; then

-eq 0

> +        if [[ $BATTERY -gt 0 ]] ; then
> +            # update BATTERY information
> +            battery
>              RPROMPT="%(?..:()% ${PERCENT}${SCREENTITLE}"
>              # RPROMPT="${PERCENT}${SCREENTITLE}"
>          else

Ansonsten ACK.

> @@ -1660,9 +1673,9 @@
>  }
>  
>  # preexec() => a function running before every command
> -is4 && [[ -z $NOPRECMD ]] && \
> +is4 && [[ $NOPRECMD -lt 1 ]] && \

-eq 0

>  preexec () {
> -    [[ -n $NOPRECMD ]] && return 0
> +    [[ $NOPRECMD -gt 0 ]] && return 0
>  # set hostname if not running on host with name 'grml'
>      if [[ -n "$HOSTNAME" ]] && [[ "$HOSTNAME" != $(hostname) ]] ; then
>         NAME="@$HOSTNAME"
> @@ -1704,7 +1717,7 @@
>  else
>      # only if $GRMLPROMPT is set (e.g. via 'GRMLPROMPT=1 zsh') use the extended prompt
>      # set variable identifying the chroot you work in (used in the prompt below)
> -    if [[ -n $GRMLPROMPT ]] ; then
> +    if [[ $GRMLPROMPT -gt 0 ]] ; then

ACK.

>          PROMPT="${RED}${EXITCODE}${CYAN}[%j running job(s)] ${GREEN}{history#%!} ${RED}%(3L.+.) ${BLUE}%* %D
>  ${BLUE}%n${NO_COLOUR}@%m %40<...<%B%~%b%<< %# "
>      else
> @@ -1728,7 +1741,7 @@
>  hash -d deb=/var/cache/apt/archives
>  hash -d doc=/usr/share/doc
>  hash -d linux=/lib/modules/$(command uname -r)/build/
> -hash -d log=/var/log
> +hash -d vlog=/var/log

NACK, siehe oben in der Mail.

>  hash -d slog=/var/log/syslog
>  hash -d src=/usr/src
>  hash -d templ=/usr/share/doc/grml-templates
> @@ -1888,7 +1901,7 @@
>  the zsh yet. :)
>  
>    "NOCOR=1    zsh" => deactivate automatic correction
> -  "NOMENU=1   zsh" => do not use menu completion (note: use strg-d for completion instead!)
> +  "NOMENU=1   zsh" => do not use auto menu completion (note: use ctrl-d for completion instead!)

ACK.

>    "NOPRECMD=1 zsh" => disable the precmd + preexec commands (set GNU screen title)
>    "BATTERY=1  zsh" => activate battery status (via acpi) on right side of prompt'
>  
> @@ -2054,7 +2067,7 @@
>      zstyle ':completion:*:matches'         group 'yes'
>      zstyle ':completion:*'                 group-name ''
>  
> -    if [[ -z "$NOMENU" ]] ; then
> +    if [[ "$NOMENU" -lt 1 ]] ; then

-eq 0

>          # if there are more than 5 options allow selecting from a menu
>          zstyle ':completion:*'               menu select=5
>      else
> @@ -2069,7 +2082,8 @@
>      zstyle ':completion:*:options'         description 'yes'
>  
>      # on processes completion complete all user processes
> -    zstyle ':completion:*:processes'       command 'ps -au$USER'
> +    #zstyle ':completion:*:processes'       command 'ps -au$USER'
> +    zstyle ':completion:*:processes' command 'ps --forest -u $USER -o pid,cmd'

Semi-NACK. Grundsätzlich ist die baumartige Anzeige erstrebenswert,
ich nehme mich dessen in den nächsten Tagen einmal an, und baue
verschiedene Styles für verschiedene Zugriffsrechte ein.

Kurz: erstmal raus lassen. Kommt aber in ähnlicher Form.

>  
>      # offer indexes before parameters in subscripts
>      zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters
> @@ -2108,7 +2122,7 @@
>  
>      ## correction
>      # some people don't like the automatic correction - so run 'NOCOR=1 zsh' to deactivate it
> -    if [[ -n "$NOCOR" ]] ; then
> +    if [[ "$NOCOR" -gt 0 ]] ; then

ACK.


Wir sind schon nah an dem, was man committen könnte.

Gruß, Frank

-- 
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
                                                  -- RFC 1925
History
Date User Action Args
2008-09-28 22:05:12ftsetrecipients: + kiste
2008-09-28 22:05:12ftlinkissue528 messages
2008-09-28 22:05:06ftcreate