* Emacs pager?
@ 2002-12-18 23:26 Da Witch
2002-12-18 23:30 ` David Kastrup
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Da Witch @ 2002-12-18 23:26 UTC (permalink / raw)
Many of the commands to move around a buffer viewed with less are the
same as vi commands. It would be nice to have a less-like pager that
felt like Emacs. Is there such a thing?
(Of course, one *could* just use Emacs as a pager, but Emacs takes too
long to load up to be convenient.)
Thanks!
-H
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Emacs pager?
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-22 19:42 ` Lowell Gilbert
2 siblings, 0 replies; 7+ messages in thread
From: David Kastrup @ 2002-12-18 23:30 UTC (permalink / raw)
Da Witch <heather710101@yahoo.com> writes:
> Many of the commands to move around a buffer viewed with less are the
> same as vi commands. It would be nice to have a less-like pager that
> felt like Emacs. Is there such a thing?
>
> (Of course, one *could* just use Emacs as a pager, but Emacs takes too
> long to load up to be convenient.)
emacsclient
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Emacs pager?
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-22 19:42 ` Lowell Gilbert
2 siblings, 1 reply; 7+ messages in thread
From: Tim X @ 2002-12-19 6:49 UTC (permalink / raw)
Da Witch <heather710101@yahoo.com> writes:
> (Of course, one *could* just use Emacs as a pager, but Emacs takes too
> long to load up to be convenient.)
What! You mean you don't always have emacs running anyway?
Come on - after all, emacs IS the kitchen sink. Forget about wandering
around in some boring shell like bash, tcsh, csh etc and typing cd, ls
and less/more - just use dired, eshell and friends.
Actually, on a serious note, if you do maintain an emacs session (I
start mine at boot and only close it down when I turn-off/reboot -
about 2-4 times a year), you should be able to setup the emacs server
or gnuserv and a fake "more/less" so that the file is sent to emacs
and you can do your paging there.
Of course, probably the easiest solution is to use the lesskey program
which allows you to define the key bindings for less and set them to
mimic emacs key bindings.
Tim
--
Tim X.
tcross (at) northnet com au
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Emacs pager?
2002-12-19 6:49 ` Tim X
@ 2002-12-19 11:24 ` Kai Großjohann
2002-12-19 22:36 ` Tim X
0 siblings, 1 reply; 7+ messages in thread
From: Kai Großjohann @ 2002-12-19 11:24 UTC (permalink / raw)
Tim X <timx@spamto.devnul.com> writes:
> Actually, on a serious note, if you do maintain an emacs session (I
> start mine at boot and only close it down when I turn-off/reboot -
> about 2-4 times a year), you should be able to setup the emacs server
> or gnuserv and a fake "more/less" so that the file is sent to emacs
> and you can do your paging there.
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.
--
~/.signature is: umop ap!sdn (Frank Nobis)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Emacs pager?
2002-12-19 11:24 ` Kai Großjohann
@ 2002-12-19 22:36 ` Tim X
0 siblings, 0 replies; 7+ messages in thread
From: Tim X @ 2002-12-19 22:36 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Emacs pager?
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-22 19:42 ` Lowell Gilbert
2002-12-22 19:49 ` Kai Großjohann
2 siblings, 1 reply; 7+ messages in thread
From: Lowell Gilbert @ 2002-12-22 19:42 UTC (permalink / raw)
Da Witch <heather710101@yahoo.com> writes:
> Many of the commands to move around a buffer viewed with less are the
> same as vi commands. It would be nice to have a less-like pager that
> felt like Emacs. Is there such a thing?
less(1) provides a mechanism for redefining the key maps.
I wouldn't be surprised if somebody had done one for emacs
style commands.
> (Of course, one *could* just use Emacs as a pager, but Emacs takes too
> long to load up to be convenient.)
emacsclient (or gnuclient) would solve that problem.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Emacs pager?
2002-12-22 19:42 ` Lowell Gilbert
@ 2002-12-22 19:49 ` Kai Großjohann
0 siblings, 0 replies; 7+ messages in thread
From: Kai Großjohann @ 2002-12-22 19:49 UTC (permalink / raw)
Lowell Gilbert <lowell@be-well.ilk.org> writes:
> less(1) provides a mechanism for redefining the key maps.
> I wouldn't be surprised if somebody had done one for emacs
> style commands.
My less groks C-n, C-p, C-v and M-v. I haven't configured it. I'm
surprised it doesn't work this way for others.
--
~/.signature is: umop ap!sdn (Frank Nobis)
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2002-12-22 19:49 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2002-12-22 19:42 ` Lowell Gilbert
2002-12-22 19:49 ` Kai Großjohann
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).