tags:

views:

156

answers:

4

C-x C-f blah.info opens the file in fundametal mode. I used apropos and found Info-mode which I thought might change from fundamental mode into Info mode, but that throws a lisp error.

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 M-x info (n for next, u for up, hyperlinks, etc..)? I'm sure this is obvious, but I can't figure it out.

A: 

Add the following to your .emacs initialization file:

(setq auto-mode-alist 
      (append '(("\\.info" . Info-mode)) auto-mode-alist))
pajato0
This sorta worked but when I open a info file, none of the links are "active" until I navigate over one and press `RET`. I think @rzab is correct, seems like info does other stuff than just starting Info-mode. Thanks for the suggestion.
Dave Paroulek
+5  A: 

Plain (info `file-name') opens file in info mode. (info) probably does something besides just setting 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))
rzab
thanks, this worked.
Dave Paroulek
+4  A: 

Try C-u C-h i (i.e., the usual info invocation with a prefix argument).

huaiyuan
+4  A: 

When your cursor is on the filename in the dired buffer, press I (shift and i). Requires dired-x, which is part of 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.
piyo