2009-12-17 51 views
34

C-x C-f blah.info以fundametal模式打開文件。我用apropos,發現Info-mode,我認爲它可能會從基本模式變爲信息模式,但會引發lisp錯誤。如何在info模式下打開emacs中的* .info文件?

我如何在Emacs打開一個外部/第三方* .info文件,使我得到同樣的花俏當我看着M-x infon明年,u達,超鏈接等。) ?我確信這很明顯,但我無法弄清楚。

回答

15

平原(信息'文件名')打開文件中的信息模式。 (信息)可能除了設置信息模式之外還有其他的功能。所以我會用這樣的:

(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)) 
+0

謝謝,這工作。 – Upgradingdave 2009-12-17 12:20:12

+1

看來'info'主要是作爲'info-setup'的跳板。這裏有一個類似的功能,儘管沒有原始的'info'功能的'互動'糖: '(defun info-find-file(file) (interactive「f」) (info-setup file (pop-to - 緩衝區同窗 (格式「* info * <%s>」 (file-name-sans-extension (file-name-nondirectory file)))))' – 2014-12-24 03:23:15

1

以下添加到您的.emacs初始化文件:

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

這種類型的工作,但是當我打開一個信息文件,沒有任何鏈接是「積極」,直到我導航一個,然後按「RET」。我認爲@rzab是正確的,似乎信息不僅僅是啓動信息模式。感謝您的建議。 – Upgradingdave 2009-12-17 12:15:42

56

嘗試C-u C-h i(即通常的信息調用用一個前綴參數)。

+2

這是最好的答案。 – 2013-11-21 22:15:32

9

當您的光標位於dired緩衝區中的文件名上時,請按Ishifti)。需要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. 
4

您可以使用組織模式。鍵入使用M-x org-mode已經設置了緩衝區中的以下內容:

info:path/to/blah 

然後通過將鼠標放在該擊中C-c C-o調用信息。或者,用鼠標點擊它。如果你的路徑包含空格,你也可以用雙方括號來設置整個事物。

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