scel/el/sclang-minor-mode.el

88 lines
3.1 KiB
EmacsLisp
Raw Permalink Normal View History

2022-07-30 17:15:38 +00:00
;;; sclang-minor-mode.el --- IDE for working with SuperCollider -*- coding: utf-8;
;;
;; Copyright (c) 2007, Marije Baalman - nescivi <nescivi@gmail.com>
;;; License:
;;; 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 of the License, 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, write to the Free Software
;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2022-07-30 17:15:38 +00:00
;;; Commentary:
;;
;; sclang-minor-mode for use in help files
;;; Code:
(require 'sclang-util)
(require 'sclang-mode)
(easy-mmode-define-minor-mode sclang-minor-mode
"Toggle sclang-minor-mode.
With no argument, this command toggles the mode.
Non-null prefix argument turns on the mode.
Null prefix argument turns off the mode.
2022-07-30 17:15:38 +00:00
When sclang-minor-mode is enabled, you can use the key sequences
\\<sclang-minor-mode-map>\\[sclang-eval-region-or-line] or \\<sclang-minor-mode-map>\\[sclang-eval-region] to eval sclang code."
;; The initial value.
:init-value nil
;; The indicator for the mode line.
:lighter " sclang"
;; The minor mode bindings.
:keymap '(("\C-c\C-c" . sclang-eval-region-or-line)
("\C-c\C-d" . sclang-eval-region)
("\C-\M-x" . sclang-eval-defun)
("\C-c\C-h" . sclang-find-help)
("\C-\M-h" . sclang-goto-help-browser)
("\C-c\C-s" . sclang-main-stop)
("\C-c\C-k" . sclang-edit-dev-source)))
(provide 'sclang-minor-mode)
2022-07-30 17:15:38 +00:00
(easy-mmode-define-minor-mode sclang-help-minor-mode
"Toggle sclang-minor-mode.
With no argument, this command toggles the mode.
Non-null prefix argument turns on the mode.
Null prefix argument turns off the mode.
2022-07-30 17:15:38 +00:00
When sclang-help-minor-mode is enabled, you can use the key sequences
\\<sclang-minor-mode-map>\\[sclang-eval-region-or-line] or \\<sclang-minor-mode-map>\\[sclang-eval-region] to eval sclang code."
;; The initial value.
:init-value nil
;; The indicator for the mode line.
:lighter " sclang-help"
;; The minor mode bindings.
:keymap '(("\C-c\C-c" . sclang-eval-region-or-line)
("\C-c\C-d" . sclang-eval-region)
("\C-\M-x" . sclang-eval-defun)
("\C-c\C-h" . sclang-find-help)
("\C-c\C-s" . sclang-main-stop)
("\C-c\C-v" . sclang-edit-html-help-file)
("E" . sclang-edit-help-code)
("\C-c\C-k" . sclang-edit-dev-source)))
(provide 'sclang-help-minor-mode)
2022-07-30 17:15:38 +00:00
;; mode hooks
(defun sclang-minor-hooks ()
"Sclang minor mode hooks."
(sclang-init-document)
(sclang-make-document))
(add-hook 'sclang-help-minor-mode-hook 'sclang-minor-hooks)
(add-hook 'sclang-minor-mode-hook 'sclang-minor-hooks)
2022-07-30 17:15:38 +00:00
;;; sclang-minor-mode.el ends here