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

Re: Line number monstrosity



On Jul 11, 12:53pm, Peter Stephenson wrote:
}
} % autoload flubba
} % flubba
} flubba:104: flubba: function definition file not found
} 
} The only problem is the `flubba:104:' at the start of the error message.
} It's not in the function yet, so shouldn't print that.

It should be possible to fix that by temporarily decrementing locallevel
in loadautofn().  The question is whether to decrement it just for that
particular error message, or for the entire duration of that C function
(including errors such as "function not defined by file").

On a related note, I'm a little puzzled by this behavior:

zagzig% cat < nonexistent         
zagzig% echo < nonexistent
zsh: no such file or directory: nonexistent
zagzig% cat < nonexistent 
zagzig% 

Why is there no error message for the bad redirection when the command is
not a builtin?

On Jul 11,  9:40am, Clint Adams wrote:
}
} In a vaguely similar vein, the 14 in
} cat:14: no such file or directory: nonexistent
} isn't particularly useful.

Why not?  You don't get line numbers for commands issued from the PS1
prompt, so you must be referring to something in a function or script;
and it's possible to have more than one "cat" in the same script, and to
need to know which of those failed.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



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