简体   繁体   English

如何在信息模式下打开emacs中的* .info文件?

[英]how to open *.info file in emacs in info mode?

Cx Cf blah.info opens the file in fundametal mode. Cx Cf blah.infoCx Cf blah.info模式打开文件。 I used apropos and found Info-mode which I thought might change from fundamental mode into Info mode, but that throws a lisp error. 我使用了apropos并发现了Info-mode ,我认为它可能会从基本模式变为Info模式,但是会引发一个lisp错误。

How can I open a external/thirdparty *.info file in emacs so that I get the same bells and whistles as when I'm looking at Mx info ( n for next, u for up, hyperlinks, etc..)? 如何在emacs中打开外部/第三方* .info文件,这样我就可以得到与我查看Mx info时相同的花里胡哨( n代表接下来, u代表,超链接等等)? I'm sure this is obvious, but I can't figure it out. 我确信这很明显,但我无法弄明白。

尝试Cu Ch i (即通常的带有前缀参数的信息调用)。

Plain (info `file-name') opens file in info mode. Plain(info`file-name')以信息模式打开文件。 (info) probably does something besides just setting Info-mode. (info)除了设置Info-mode之外,可能会做一些事情。 So I would use something like this: 所以我会使用这样的东西:

(defun info-mode ()
  (interactive)
  (let ((file-name (buffer-file-name)))
    (kill-buffer (current-buffer))
    (info file-name)))
(add-to-list 'auto-mode-alist '("\\.info\\'" . info-mode))

When your cursor is on the filename in the dired buffer, press I ( shift and i ). 当光标位于dired缓冲区中的文件名时,按Ishifti )。 Requires dired-x, which is part of GNU Emacs. 需要dired-x,它是GNU Emacs的一部分。

I runs the command dired-info
  which is an interactive compiled Lisp function in `dired-x.el'.
It is bound to I.
(dired-info)

Run info on this file.

You can use org mode . 您可以使用组织模式 Type the following in a buffer already set using Mx org-mode : 在已使用Mx org-mode设置的缓冲区中键入以下内容:

info:path/to/blah

Then invoke info by placing the cursor over this and hitting Cc Co . 然后将光标放在此上并点击Cc Co调用信息 Alternatively, click on it with your mouse. 或者,用鼠标单击它。 You can also set the whole thing in double square brackets, if you path contains whitespace. 如果路径包含空格,也可以在双方括号中设置整个事物。

(add-to-list 'auto-mode-alist '("\\.info\\'" . Info-on-current-buffer))

Add the following to your .emacs initialization file: 将以下内容添加到.emacs初始化文件中:

(setq auto-mode-alist 
      (append '(("\\.info" . Info-mode)) auto-mode-alist))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM