unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Tim X <timx@spamto.devnul.com>
Subject: Re: Emacs pager?
Date: 20 Dec 2002 09:36:24 +1100	[thread overview]
Message-ID: <878yylzlef.fsf@blind-bat.une.edu.au> (raw)
In-Reply-To: 84isxqjlof.fsf@lucy.cs.uni-dortmund.de

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

  reply	other threads:[~2002-12-19 22:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-18 23:26 Emacs pager? Da Witch
2002-12-18 23:30 ` David Kastrup
2002-12-19  6:49 ` Tim X
2002-12-19 11:24   ` Kai Großjohann
2002-12-19 22:36     ` Tim X [this message]
2002-12-22 19:42 ` Lowell Gilbert
2002-12-22 19:49   ` Kai Großjohann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878yylzlef.fsf@blind-bat.une.edu.au \
    --to=timx@spamto.devnul.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).