how to open *.info file in emacs in info mode?

前端 未结 6 848
耶瑟儿~
耶瑟儿~ 2021-01-31 15:36

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

相关标签:
6条回答
  • 2021-01-31 16:20

    You can use org mode. Type the following in a buffer already set using M-x org-mode:

    info:path/to/blah
    

    Then invoke info by placing the cursor over this and hitting C-c C-o. Alternatively, click on it with your mouse. You can also set the whole thing in double square brackets, if you path contains whitespace.

    0 讨论(0)
  • 2021-01-31 16:22

    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))
    
    0 讨论(0)
  • 2021-01-31 16:22

    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.
    
    0 讨论(0)
  • 2021-01-31 16:24
    (add-to-list 'auto-mode-alist '("\\.info\\'" . Info-on-current-buffer))
    
    0 讨论(0)
  • 2021-01-31 16:28

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

    0 讨论(0)
  • 2021-01-31 16:28

    Add the following to your .emacs initialization file:

    (setq auto-mode-alist 
          (append '(("\\.info" . Info-mode)) auto-mode-alist))
    
    0 讨论(0)
提交回复
热议问题