-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmi-gauche.el
95 lines (75 loc) · 3.25 KB
/
mi-gauche.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
;;; mi-gauche.el --- Mode-info backend for Gauche -*- coding: iso-2022-7bit -*-
;; Copyright (C) 2002,2003 TSUCHIYA Masatoshi <[email protected]>
;; Author: TSUCHIYA Masatoshi <[email protected]>
;; Keywords: gauche info
;; This file is a part of mode-info.
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, you can either send email to this
;; program's maintainer or write to: The Free Software Foundation,
;; Inc.; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
;;; Commentary:
;; This file provides mode-info backend stuffs to see the reference
;; manual of Gauche, which is a R5RS Scheme implementation developed
;; to be a handy script interpreter. It can be downloaded from:
;;
;; http://www.shiro.dreamhost.com/scheme/gauche/
;;; Code:
(require 'mode-info)
(require 'mi-scheme)
(eval-when-compile
(require 'cl)
(require 'mi-index))
(defgroup mode-info-gauche nil
"Various sorts of imporved help system for Gauche."
:group 'mode-info)
(defcustom mode-info-gauche-index-file
(expand-file-name "mi-gauche.idx" mode-info-index-directory)
"*Index file of functions and variables described in Info about Gauche."
:group 'mode-info-gauche
:type 'file)
(defcustom mode-info-gauche-titles
'(("gauche-refj" "gauche-refe"))
"*Info titles about Gauche."
:group 'mode-info-gauche
:type mode-info-titles-type)
(mode-info-defclass gauche scheme)
(defun mode-info-gauche-make-index ()
"Make index of Info files listed in `mode-info-gauche-titles'."
(interactive)
(let ((mode-info-index-node-regexp "\\($B:w0z(B\\|Index\\)\\'")
(mode-info-index-entry-suffix-regexp "\\([ \t]+of[ \t]+<[^>]+>\\)\\'"))
(mode-info-make-index 'gauche mode-info-gauche-titles nil nil)))
(mode-info-defmethod process-index-node ((class gauche) title nodename
functions variables)
(cond
((string-match "\\`\\(\\(Function and Syntax\\|Module\\|Class\\) Index\\|\
\\(Index +- +\\)?\\($B<jB3$-$H9=J8(B\\|$B%b%8%e!<%k(B\\|$B%/%i%9(B\\)$B:w0z(B\\)\\'"
nodename)
(while (re-search-forward
mode-info-index-entry-regexp nil t)
(let ((key (match-string 1))
(node (match-string 2))
(line (match-string 3)))
(while (string-match "`\\([-/<>+*=]+\\)'" key)
(setq key (concat (substring key 0 (match-beginning 0))
(match-string 1 key)
(substring key (match-end 0)))))
(mode-info-process-index-node-1 title functions key node line))))
((string-match "\\`\\(Variable Index\\|\\(Index +- +\\)?$BJQ?t:w0z(B\\)\\'"
nodename)
(while (re-search-forward mode-info-index-entry-regexp nil t)
(mode-info-process-index-node-1 title
variables
(match-string 1)
(match-string 2)
(match-string 3))))))
(provide 'mi-gauche)
;;; mi-gauche.el ends here