I would like to view man pages using emacs when invoking man command.
I modified the pager parameter in /etc/man.conf
PAGER to emacs
.
But, it doesn't work. Is there anything I should modify ?
I would like to view man pages using emacs when invoking man command.
I modified the pager parameter in /etc/man.conf
PAGER to emacs
.
But, it doesn't work. Is there anything I should modify ?
Indeed, emacs cannot read STDIN into a buffer, meaning
cat foobar | emacs
does not work in any case. So setting your PAGER variable to 'emacs', or 'emacs -nw' does not do the job.
Only way around I see is to write the man
output into a tmp-file and then load that file into emacs:
man find > tmp-file; emacs tmp-file
You could alias this.
For example, assuming a tc-shell, and a directory called 'tmp' in your home-path, you can put the following line into your ~/.tcshrc
file:
alias man '/usr/bin/man \!* > ~/tmp/tmp-file; emacs ~/tmp/tmp-file; rm ~/tmp/tmp-file'
So next time you call man find
, emacs will fire up.
Emacs has a "Man mode", which can be invoked by M-x man RET
and then typing in your command.
You can profit from emacs's function man
. Just define a function in bash that will run emacs that will call it:
function man () {
emacs -e '(man "'"$1"'")'
}
You might want to call emacs -nw
or even emacsclient
instead.
emacs -eval "(woman \"$1\")"
, which uses emacs' elisp based man instead of the external man program. –
Hemispheroid emacs -nw --eval '(progn (man "'$1'") (delete-window))';
–
Caesarean emacs -nw --eval "(progn (man \"$1\") (delete-window))"
–
Caesarean © 2022 - 2024 — McMap. All rights reserved.