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

前端 未结 6 859
耶瑟儿~
耶瑟儿~ 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: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))
    

提交回复
热议问题