zsh-workers
 help / color / mirror / code / Atom feed
From: Klaus Ethgen <Klaus@ethgen.ch>
To: zsh-workers@zsh.org
Subject: Bug in function in function
Date: Thu, 19 May 2022 20:34:05 +0100	[thread overview]
Message-ID: <YoabreuaHY2ZI9YW@ikki.ethgen.ch> (raw)

[-- Attachment #1: Type: text/plain, Size: 2034 bytes --]

Hi,

I had the following definition in my zshrc:
   rpg()
   {
      if whence rpg-cli >&-
      then
	 if ! functions cd >&-
	 then
	    cd()
	    {
	       CLICOLOR_FORCE=1 rpg-cli cd "$@" | sed -e 's/â\x96¡/o/g' -e 's/â\x9c\x94/ø/g' -e 's/\xf0\x9f\x92\x80/:-(/g' -e 's/\xf0\x9f\x93\xa6/\xa4/g' -e 's/\xf0\x9f\xaa\xa6/\xab/g' -e 's/\xe2\x9c\xa8/*/g' -e 's/\xf0\x9f\x94\xa5/\xbb\xab/g' -e 's/\xe2\x98\xa0\xef\xb8\x8f/\xa7/g'
	       builtin cd "$(rpg-cli pwd)"
	    }
	    ls()
	    {
	       command ls "$@"
	       if [ $# -eq 0 ]
	       then
		  CLICOLOR_FORCE=1 rpg-cli cd -f . | sed -e 's/â\x96¡/o/g' -e 's/â\x9c\x94/ø/g' -e 's/\xf0\x9f\x92\x80/:-(/g' -e 's/\xf0\x9f\x93\xa6/\xa4/g' -e 's/\xf0\x9f\xaa\xa6/\xab/g' -e 's/\xe2\x9c\xa8/*/g' -e 's/\xf0\x9f\x94\xa5/\xbb\xab/g' -e 's/\xe2\x98\xa0\xef\xb8\x8f/\xa7/g'
		  CLICOLOR_FORCE=1 rpg-cli ls | sed -e 's/â\x96¡/o/g' -e 's/â\x9c\x94/ø/g' -e 's/\xf0\x9f\x92\x80/:-(/g' -e 's/\xf0\x9f\x93\xa6/\xa4/g' -e 's/\xf0\x9f\xaa\xa6/\xab/g' -e 's/\xe2\x9c\xa8/*/g' -e 's/\xf0\x9f\x94\xa5/\xbb\xab/g' -e 's/\xe2\x98\xa0\xef\xb8\x8f/\xa7/g'
	       fi
	    }
	 fi
	 CLICOLOR_FORCE=1 rpg-cli "$@" | sed -e 's/â\x96¡/o/g' -e 's/â\x9c\x94/ø/g' -e 's/\xf0\x9f\x92\x80/:-(/g' -e 's/\xf0\x9f\x93\xa6/\xa4/g' -e 's/\xf0\x9f\xaa\xa6/\xab/g' -e 's/\xe2\x9c\xa8/*/g' -e 's/\xf0\x9f\x94\xa5/\xbb\xab/g' -e 's/\xe2\x98\xa0\xef\xb8\x8f/\xa7/g'
	 builtin cd "$(rpg-cli pwd)"
      else
	 echo "No rpg-cli installed"
	 return 1
      fi
   }

This was working fine until recent.

Now I get an error in the `ls()` line. It is even more strange that I
don't get an error when compiling it as zwc file!

Is there any recent that has changed?

My zsh is Version 5.9.

Please keep me in Cc as I am not registered to the list...

Regards
   Klaus
-- 
Klaus Ethgen                                       http://www.ethgen.ch/
pub  4096R/4E20AF1C 2011-05-16            Klaus Ethgen <Klaus@Ethgen.ch>
Fingerprint: 85D4 CA42 952C 949B 1753  62B3 79D0 B06F 4E20 AF1C

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 688 bytes --]

             reply	other threads:[~2022-05-19 19:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-19 19:34 Klaus Ethgen [this message]
2022-05-20 15:37 ` Bart Schaefer
2022-05-20 17:12   ` Klaus Ethgen
2022-05-20 17:16     ` Mikael Magnusson
2022-05-20 17:25       ` Klaus Ethgen
2022-05-20 17:46         ` Peter Stephenson
2022-05-20 17:47         ` Bart Schaefer
2022-05-20 18:14           ` Klaus Ethgen
2022-05-20 18:36             ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YoabreuaHY2ZI9YW@ikki.ethgen.ch \
    --to=klaus@ethgen.ch \
    --cc=zsh-workers@zsh.org \
    --subject='Re: Bug in function in function' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).