emacs > texiファイルからinfoファイルを作成して使う

info ディレクトリ作成

mkdir ~/.emacs.d/info

Gauche

$ cd Gauche-*.*.*/doc
$ makeinfo gauche-refj.texi
$ mv gauche-refj.info gauche-refj.info-1 gauche-refj.info-2 gauche-refj.info-3 gauche-refj.info-4 gauche-refj.info-5 gauche-refj.info-6 gauche-refj.info-7 gauche-refj.info-8 gauche-refj.info-9 gauche-refj.info-10 gauche-refj.info-11 ~/.emacs.d/info/

※ makeinfo が入ってなかったら、
$ sudo apt install texinfo

Emacs Lisp 日本語 info の作製

elisp-ja用のinfoディレクトリ作る

$ mkdir ~/.emacs.d/info/elisp-ja
$ cd ~/.emacs.d/info/elisp-ja/

elisp-ja-manual の 21-2-8 をダウンロード

utf-8に変換

$ find -name '*.texi' | xargs nkf -w --overwrite

パッチを当てる

$ find -name "*.texi" | xargs sed -i -e "s/\(@xref{.*}\)/\1./g; \
s/@sc{\(.*\)}/@sc{\L\1\E}/; \
s/@sc{ASCII}/@sc{ascii}/g; \
s/\([^@]\)var{/\1@var{/g; \
s/^var{/@var{/g; \
s/\([^@]\)code{/\1@code{/g"
$ sed -i -e "s/@@mail/(at)mail/g" -e "s/@end ifnottex/@end ifinfo/g" elisp.texi
$ sed -i -e "s/@r{対応する開く文字は{$}である}/@r{対応する開く文字は@samp{$}である}/g" syntax.texi
$ sed -i -e "s/^GNU Emacs マニュアル}。$/GNU Emacs マニュアル}.。/g" modes.texi
$ sed -i -e "s/@deffn Command auto-save-mode arg//; s/^GNU Emacs マニュアル}。$/GNU Emacs マニュアル}.。/g" backups.texi

texi -> info に変換する

$ makeinfo elisp.texi

とここまでやったが、@node の記述が足りないのか。例えば Images というメニューに対応する、node なり anchor なりが存在しない。

結局無理やり変換
$ makeinfo --force elisp.texi

Emacs Lisp 日本語 info はこっちの方がいいかも

wget http://www.bookshelf.jp/2.20/packages/gnujdoc-20040106-2-pkg.tar.gz
tar xf gnujdoc-20040106-2-pkg.tar.gz
cd packages/info/
cp elisp-ja.info* ~/.emacs.d/info/elisp-ja/

優しい Emacs-Lisp 講座 info の作製

$ wget http://www.gentei.org/~yuuji/elisp/elisplec.tex
$ nkf -w --overwrite elisplec.tex
$ emacs elisplec.tex
↓変更
@setfilename elisplec.info
@settitle Lecture to Emacs Lisp
↓追記(最初の@nodeより上に
@dircategory Texinfo documentation system
@direntry
* Elisp-lesson: (elisplec).    Lecture to Emacs Lisp.
@end direntry
 
M-x makeinfo-buffer
エラーの出る行の
{ を @{ に
} を @} に
M-x makeinfo-buffer
$ mv elisplec.info ~/.emacs.d/info/

ついでにemacs lisp 24 manual と emacs 24 manual

$ cd ~/.emacs.d/info/emacs-info/
$ wget https://www.gnu.org/software/emacs/manual/info/elisp.info.gz
$ gunzip elisp.info.gz
$ wget https://www.gnu.org/software/emacs/manual/info/emacs.info.gz
$ gunzip emacs.info.gz

~/.emacs.d/info/dir の作成

This is the file .../info/dir, which contains the
topmost node of the Info hierarchy, called (dir)Top.
The first time you invoke Info you start off looking at this node.
^_
File: dir,	Node: Top	This is the top of the INFO tree
 
* Menu:
Emacs
* Gauche refj: (gauche-refj.info).	Gauche ref (Japanese)
* Elisp-ja: (elisp-ja/elisp-ja).	Elisp20 日本語マニュアル.
* ELisp Lesson: (elisplec).	やさしい Emacs lisp 講座
* Emacs Lisp: (emacs-info/elisp).	Emacs Lisp24 Manual.
* Emacs: (emacs-info/emacs).	Emacs24 Manual.
 
 
dirファイルの最後に改行がないと、C+h i したとき、とっても見づらいので注意。

.emacs の設定

  1. ;; -----------------------------------------------------------
  2. ;;; Info
  3. ;; -----------------------------------------------------------
  4. (require 'info)
  5. (add-to-list 'Info-default-directory-list "~/.emacs.d/info/")
  6. (add-to-list 'Info-default-directory-list "~/.emacs.d/info/emacs-info/")
  7.  

使ってみる

C+h i
キー 説明
i 入力された文字列にマッチする見出しを含むノードへ移動
, 直近のiの次の候補
I 入力された文字列にマッチする見出しをメニュー形式で表示する
s info内を正規表現検索する

参考






最終更新:2018年01月09日 00:47