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

Re: vi editting troubles

> Neither `r' or `fc -e -' work, and give me this error.
> fc: can't open temp file: bad address

Do you have TMPPREFIX set to something invalid?  The chunk of code in
question is this.  The questions are whether we need to make gettempname()
more robust about this, and why to goodness the system has decided to set
errno to EFAULT instead of ENOENT, which would make the error message
rather more understandable.

	fil = gettempname();
	if (((tempfd = open(fil, O_WRONLY | O_CREAT | O_EXCL | O_NOCTTY, 0600))
	    == -1) ||
		((out = fdopen(tempfd, "w")) == NULL)) {
	    zwarnnam("fc", "can't open temp file: %e", NULL, errno);

> Another strange thing I notice when I turn on shell tracing is that my
> TRAPZERR function runs in the middle of _history_complete_word -- is
> there something I should be doing to avoid this?

Oh, yuk.  We really need some way of getting the effect of `setopt
localtraps; unfunction TRAPZERR' in all completion functions.  I suppose
that means adding it everywhere we already have `setopt localoptions'
or `emulate -L zsh' (the latter already sets localtraps).  If anybody sees
this as their mission in life...

Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR Ltd., Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070

The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
If you received this in error, please contact the sender and 
delete the material from any computer.

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