Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!labrea!mcnc!rti!xyzzy!godel!biesack From: biesack@godel.dg.com (Dave Biesack) Newsgroups: gnu.emacs Subject: Re: GNU Emacs Result Codes on Exit Message-ID: <3194@xyzzy.UUCP> Date: 2 Feb 89 12:39:43 GMT References: <8901301528.AA13322@rutgers.edu> <8901301143.AA09165@lxn.UUCP> Sender: usenet@xyzzy.UUCP Reply-To: biesack@godel.UUCP (Dave Biesack) Distribution: gnu Organization: Data General Corporation, Research Triangle Park, NC. Lines: 57 In article <8901301143.AA09165@lxn.UUCP> lehi3b15!lxn!chris@bpa.bell-atl.com (Christopher D. Orr) writes: > > >Can anybody tell me what the following line does in GNU Emacs when it > >exits: > > > > exit ((XTYPE (arg) == Lisp_Int) ? XINT (arg) > > What I am seeking is information as to *what* XTYPE(arg)==Lisp_Int is > comparing and what it means. I also am interested in finding out what > XINT(arg) is actually doing (although I can make an assumption). XINT is a macro (defined in lisp.h) which extracts the integer value of a lisp object. In this case, arg is a lisp object, which means it can be a cons, a string, and array, a symbol, an integer, and many other things. Lisp_Int is an enumerated literal from the type enum Lisp_Type, also defined in lisp.h. XTYPE(arg) is a macro which extracts the type tag of a lisp object. So, the code is checking to see that the lisp object 'arg' is an integer. If it is, the integer value is extracted and returned, otherwise, something else (1 for vms, 0 otherwise) is returned. I missed your original posting... are you running GNU Emacs under VMS? > The problem I am having is that GNU Emacs exits every oncce in a while > with a return code on one (1). Why is the question. I don't seem > able to reproduce is, so I'm not sure what the problem is. > There are many other places where GNU Emacs does an exit(1): grep -n 'exit (' *.c callproc.c:391: _exit (1); dispnew.c:1424: exit (1); emacs.c:521: exit ((XTYPE (arg) == Lisp_Int) ? XINT (arg) lread.c:1359: exit (1); lread.c:1412: exit (1); regex.c:1794: exit (1); sysdep.c:560: _exit (1); sysdep.c:1074: exit (1); sysdep.c:2218: exit (1); sysdep.c:3498: exit (1); sysdep.c:3587: exit (1); term.c:1215: exit (1); termcap.c:139: exit (1); Most/all of these print a message before calling exit(). Do you get a message before Emacs exits? > -Chris > > --- > Christopher D. Orr | US MAIL: Electronic Data Systems (EDS) > UUCP: vu-vlsi!lxn!chris | Lanark Building > or chris%lxn.uucp@rutgers.edu | Center Valley, PA 18034 > or lehi3b15!lxn!chris | Voice: (215) 282-1213 > djb David J. Biesack Data General {seismo, ...}!mcnc!rti!dg-rtp!biesack Research Triangle Park, NC biesack@dg-rtp.dg.com (919) 248-5989