From: David Kastrup Newsgroups: comp.os.msdos.djgpp,comp.emacs Subject: Re: "shell" command in DJGPP Emacs? Date: 09 Oct 2002 09:51:26 +0200 Organization: T-Online Lines: 36 Sender: dak AT tupik DOT goethe DOT zz Message-ID: References: <3da26e84 DOT 3476875 AT news-server DOT optonline DOT net> <3da2bdfe DOT 2802949 AT news-server DOT optonline DOT net> <3da2c999 DOT 5774704 AT news-server DOT optonline DOT net> <3da36202 DOT 44798149 AT news-server DOT optonline DOT net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.t-online.com 1034149888 02 28447 0CR2bf4GSrAZrs 021009 07:51:28 X-Complaints-To: abuse AT t-online DOT com X-Sender: 520018396234-0001 AT t-dialin DOT net X-Face: 2FEFf>]>q>2iw=B6,xrUubRI>pR&Ml9=ao AT P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN;i";/yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP AT J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com dmcg6174 AT yahoo DOT com (daniel gerard mcgrath) writes: > On 8 Oct 2002 12:59:28 GMT, Dave Pearson wrote: > > >* daniel gerard mcgrath : > > > >> OK! Well, actually, I need a function that works something like this: > >> > >> (count-lines-in-file FILENAME) > >> > >> where FILENAME is some sort of path name, like > >> "/windows/dansstuf.txt", and the result being that the number of lines > >> (i.e. newline characters) in DANSSTUF.TXT (or whatever) is returned > >> from the "count-lines-in-file" function. > > > >(defun count-lines-in-file (file) > > "Count lines in FILE. > > > >If called as an interactive command, also display the count." > > (interactive "fFile: ") > > (with-temp-buffer > > (insert-file-contents-literally file) > > (let ((count (count-lines (point-min) (point-max)))) > > (when (interactive-p) > > (message "%d" count)) > > count))) > > > I don't have a "with-temp-buffer" function. Obviously. But your version of Emacs might. Which is it, BTW? Anything below 21.2 is certainly worth upgrading (21.2 is a bug fix release for 21.1, and 21.1 is certainly a vast improvement over 20.x). -- David Kastrup, Kriemhildstr. 15, 44793 Bochum Email: David DOT Kastrup AT t-online DOT de