From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Tim X Newsgroups: gmane.emacs.help Subject: Re: Emacs pager? Date: 20 Dec 2002 09:36:24 +1100 Organization: University of New England, NSW, Australia Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <878yylzlef.fsf@blind-bat.une.edu.au> References: <84isxqjlof.fsf@lucy.cs.uni-dortmund.de> Reply-To: timx@spamto.devnul.com NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1040337673 13211 80.91.224.249 (19 Dec 2002 22:41:13 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 19 Dec 2002 22:41:13 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18P9LX-0003Pm-00 for ; Thu, 19 Dec 2002 23:40:51 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18P9LC-0001AT-0B for gnu-help-gnu-emacs@m.gmane.org; Thu, 19 Dec 2002 17:40:30 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news1.optus.net.au!optus!news.usyd.edu.au!news.une.edu.au!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 44 Original-NNTP-Posting-Host: blind-bat.une.edu.au User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Original-Xref: shelby.stanford.edu gnu.emacs.help:108312 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:4841 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:4841 kai.grossjohann@uni-duisburg.de (Kai Großjohann) writes: > I like to use eshell. Very nifty. Here is my version of less for > eshell: > > (defun eshell/less (&rest args) > "Invoke `view-file' on the file. > \"less +42 foo\" also goes to line 42 in the buffer." > (while args > (if (string-match "\\`\\+\\([0-9]+\\)\\'" (car args)) > (let* ((line (string-to-number (match-string 1 (pop args)))) > (file (pop args))) > (view-file file) > (goto-line line)) > (view-file (pop args))))) > > The voodoo is for the line numbers. If you don't need it, this should > do, as well: > > (defun eshell/less (&rest args) > "Invoke `view-file' on the given file(s)." > (while args (view-file (pop args)))) > > You can configure the key bindings of view-file, too. view-mode-map > is the variable I believe. Kai, very nice. I had something similar to your second version, but I like the addition with the line numbering. That one is going into my emacs library today! You just gotta love eshell. Although I've not done it, I've heard there is even some out there who are using eshell as their default loging shell on their linux boxes. Sometime, when I'm a bit bored, I might even start looking at that myself... Then again, with emacs and elisp, when do you get the chance to get bored! Tim -- Tim X. tcross (at) northnet com au