How do I pipe a man page into emacs for searching, or how do I make grep mimic an html anchor?

I'm not familiar with either of those two methodologies, but I set PAGER to

Code:

/usr/ports/sysutils/lookat

because of its "s key" dialogs as well as other keybindings seem to work better from this perspective at least. Edit: forgot to explain HOW to set pager: in one's shell rc file this may work (not a usually seen construct...)

Code:

alias man='env PAGER=lookat man $1'

__________________FreeBSD 11.0-CURRENT

Last edited by jb_daefo; 24th October 2011 at 03:31 AM.
Reason: Forgot the howto

I'm sorry, I said it wrong. I corrected the original post. What I meant was:

Using % man cat | less is exactly the same as just using %man cat.

Pager does indeed works on OpenBSD. But search / doesn't work properly
(it seems that I can input search word but it doesn't get highlighted) With% man cat|less it does get highlighted. I just checked this on Devio server as I am typing this message from a Windows machine. Actually OpenBSD man command doesn't have switch -P but the pager is on by default.

If you want to read a manual page in emacs, use M-x man and it will prompt you for the name of the man page. It will then open a window with the manual page all nicely formatted for you. If you use emacs a lot, avoid leaving it for crap like manual pages.

If you really want to pipe it *into* emacs without running it through emacs, you will need an external program to simulate the effect of `man ls > tmp-file && emacs tmp-file && rm tmp-file`, because emacs is not really a UNIX program and like the original vi, not entirely friendly to being piped a file on stdin. You can find solutions on emacs wiki or Google.

less generally presents a vi style interface for navigation, or at least it responds to my muscle memory. So if someone is asking to use emacs, probably not going to want /wtf searches. Sometimes I even use vim just for a better known target. I don't know how man -P emacs works on OpenBSD but my Linux work station doesn't work with it either.