Using Emacs for $PAGER?

前端 未结 1 1668
天命终不由人
天命终不由人 2021-02-13 03:56

There are lots of places in UNIX where programs call out to the program in $PAGER (usually less or some similar command) to display some output. It\'s certainly tru

1条回答
  •  清歌不尽
    2021-02-13 04:41

    For general use of $PAGER, you might be interested in e-sink.

    For the specific case of man pages, it's better to use Emacs's built-in man mode as you note. I have this in my .bashrc:

    man () 
    { 
        if [ "$TERM" == "eterm-color" ]; then
            emacsclient -e "(man \"$1\")";
        else
            command man "$@";
        fi
    }
    

    Since you use shell-mode rather than ansi-term-mode like I do you will either have to make this use emacsclient all the time, or do something like (setenv "WITHIN_EMACS" "1") in your .emacs file so you can switch on $WITHIN_EMACS instead.

    0 讨论(0)
提交回复
热议问题