Path: utzoo!utgpu!water!watmath!clyde!cbosgd!mandrill!hal!ncoast!axcess!allbery From: allbery@axcess.UUCP (Brandon S. Allbery) Newsgroups: comp.emacs Subject: Re: Is there a cleaner way to check for a narrowed buffer? Summary: That's what I wanted: (buffer-size). Maybe I should just print out and read the entire lisp/ directory.... Message-ID: <142@axcess.UUCP> Date: 24 Jan 88 12:48:12 GMT References: <138@axcess.UUCP> <2336@bloom-beacon.MIT.EDU> <5959@sol.ARPA> Organization: aXcess Company, Mentor, Ohio Lines: 33 In article <5959@sol.ARPA>, quiroz@cs.rochester.edu (Cesar Quiroz) writes: +--------------- | page, for instance. The original idea (to check if either point-min | or point-max changed) is better. A possible implementation, | although I suspect Brandon doesn't need this code: > ... | (if (and (= min 1) (= max (1+ (buffer-size)))) > ... | This still fails if the restriction coincides with the whole | buffer... +--------------- As far as I can see, if the narrowed region is the whole buffer the C code doesn't consider it narrowed. (At least, the mode line doesn't.) In any case, I just want to know if the whole buffer is visible or not, and narrowing isn't pushed/popped in the C code, so everything works for my purposes. (I'm not upset about narrowing not being pushed/popped; looks like a Lisp wrapper around narrow-to-region and widen would provide that easily if I wanted it.) Yes, I was thinking of a C primitive. However, (buffer-size) looks like it will do the job. Tell me, is there any more complete way to find out all these little functions (the partially complete gnu functions manual isn't really useful and the help stuff virtually requires you to know what you're looking for beforehand) than to sit down and start reading ALL the Emacs code? Anyway, thanks for the help. Someone might want to replace my gross hack to do this if they saved a copy of the yacc-mode I sent out. -- ___ ________________, Brandon S. Allbery cbosgd \ ' \/ __ __, __, aXcess Company mandrill| __ | /__> <__ <__ 6615 Center St. #A1-105 !ncoast! / ` | \__. .__> .__> Mentor, OH 44060-4101 necntc | axcess!allbery \___/\________________. Moderator, comp.sources.misc hoptoad/