Merge pull request #506 from andrewcsmith/patch-2
[supercollider.git] / editors / scel / el / sclang-minor-mode.el
blobcaf5416edeb897baa40b5d59f33d11d9a4f93fb2
1 ;;; sclang-minor-mode for use in help files
2 ;;; SuperCollider
3 ;;; (c) 2007, Marije Baalman - nescivi <nescivi@gmail.com>
4 ;;;
5 ;;; This program is free software; you can redistribute it and/or modify
6 ;;; it under the terms of the GNU General Public License as published by
7 ;;; the Free Software Foundation; either version 2 of the License, or
8 ;;; (at your option) any later version.
9 ;;;
10 ;;; This program is distributed in the hope that it will be useful,
11 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ;;; GNU General Public License for more details.
14 ;;;
15 ;;; You should have received a copy of the GNU General Public License
16 ;;; along with this program; if not, write to the Free Software
17 ;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 (eval-when-compile
20 (require 'sclang-util)
21 (require 'sclang-mode)
25 (easy-mmode-define-minor-mode sclang-minor-mode
26 "Toggle sclang-minor-mode.
27 With no argument, this command toggles the mode.
28 Non-null prefix argument turns on the mode.
29 Null prefix argument turns off the mode.
31 When sclang-minor-mode is enabled, you can execute
32 sclang code with the normal command C-c C-c and C-c C-d."
33 ;; The initial value.
34 nil
35 ;; The indicator for the mode line.
36 " sclang"
37 ;; The minor mode bindings.
38 '(("\C-c\C-c" . sclang-eval-region-or-line)
39 ("\C-c\C-d" . sclang-eval-region)
40 ("\C-\M-x" . sclang-eval-defun)
41 ("\C-c\C-h" . sclang-find-help)
42 ("\C-\M-h" . sclang-goto-help-browser)
43 ("\C-c\C-s" . sclang-main-stop)
44 ("\C-c\C-k" . sclang-edit-dev-source)
47 (provide 'sclang-minor-mode)
49 (easy-mmode-define-minor-mode sclang-help-minor-mode
50 "Toggle sclang-minor-mode.
51 With no argument, this command toggles the mode.
52 Non-null prefix argument turns on the mode.
53 Null prefix argument turns off the mode.
55 When sclang-help-minor-mode is enabled, you can execute
56 sclang code with the normal command C-c C-c and C-c C-d."
57 ;; The initial value.
58 nil
59 ;; The indicator for the mode line.
60 " sclang-help"
61 ;; The minor mode bindings.
62 '(("\C-c\C-c" . sclang-eval-region-or-line)
63 ("\C-c\C-d" . sclang-eval-region)
64 ("\C-\M-x" . sclang-eval-defun)
65 ("\C-c\C-h" . sclang-find-help)
66 ("\C-c\C-s" . sclang-main-stop)
67 ("\C-c\C-v" . sclang-edit-html-help-file)
68 ("E" . sclang-edit-help-code)
69 ("\C-c\C-k" . sclang-edit-dev-source)
72 (provide 'sclang-help-minor-mode)
74 (add-hook 'sclang-help-minor-mode-hook 'sclang-minor-hooks)
75 (add-hook 'sclang-minor-mode-hook 'sclang-minor-hooks)
77 (defun sclang-minor-hooks ()
78 (sclang-init-document)
79 (sclang-make-document)