无法直接从终端在 Emacs 中打开手册

发布于 2024-07-18 06:05:33 字数 212 浏览 3 评论 0原文

我想直接在终端中打开 Emacs 手册,但

man man

我将以下代码作为别名放入 .zshrc 中,但未成功

alias man=x
unalias man  
man() { emacs ^x man }

如何打开 emacs 手册?

I want to open manuals directly in Terminal to Emacs by

man man

I put the following code as an alias in .zshrc unsuccessfully

alias man=x
unalias man  
man() { emacs ^x man }

How can you open manuals to emacs?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

满地尘埃落定 2024-07-25 06:05:33

也许这就是您的意思:

function man() { emacs -eval "(progn (setq Man-notify-method 'bully) (man \"$1\"))" }

setq 只是为了使手册页隐藏 *scratch* 缓冲区; 如果你不想这样,那么就足够了。

function man() { emacs -eval "(man \"$1\")" }

如果你想从命令行调用Emacs函数,你必须在elisp中编写函数调用; 你不能只在命令行上给出 Emacs 按键序列。

Perhaps this is what you mean:

function man() { emacs -eval "(progn (setq Man-notify-method 'bully) (man \"$1\"))" }

The setq is there just to make the manual page hide the *scratch* buffer; if you don't want that, it is enough to do

function man() { emacs -eval "(man \"$1\")" }

If you want to call Emacs functions from the command line, you must write the function call in elisp; you can't just give Emacs key sequences on the command line.

焚却相思 2024-07-25 06:05:33

我不确定我完全理解你的问题,但你可以通过简单地执行 Mx man 后跟你想要查看的手册页来在 emacs 中打开一个手册页。 如果您想直接从命令行执行此操作,我想设置一个脚本来执行此操作不会太困难。

I'm not sure I completely understand your question, but you can open a man page in emacs by simply doing M-x man followed by the man page you want to view. If you want to do this directly from the command line I imagine it would not be too difficult to set up a script to do this.

初熏 2024-07-25 06:05:33
alias man 'emacs -e man'

查看信息页面的部分(以及以下部分)了解更多信息。

alias man 'emacs -e man'

Check out this part of the info pages (and the following sections) for more information.

夜深人未静 2024-07-25 06:05:33

有几种可能性,具体取决于您希望手册页的格式如何:

man man > /tmp/man
emacs /tmp/man

zcat `man -w man` | nroff > /tmp/man
emacs /tmp/man

emacs `man -w man`

A few possibilities, depending on how you want the man pages formatted:

man man > /tmp/man
emacs /tmp/man

or

zcat `man -w man` | nroff > /tmp/man
emacs /tmp/man

or

emacs `man -w man`
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文