zsh-workers
 help / color / mirror / code / Atom feed
* Bug in function in function
@ 2022-05-19 19:34 Klaus Ethgen
  2022-05-20 15:37 ` Bart Schaefer
  0 siblings, 1 reply; 9+ messages in thread
From: Klaus Ethgen @ 2022-05-19 19:34 UTC (permalink / raw)
  To: zsh-workers

[-- 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 --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-05-20 18:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-19 19:34 Bug in function in function Klaus Ethgen
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

Code repositories for project(s) associated with this public 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).