ein-subpackages.el 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. ;;; ein-subpackages.el --- Subpacakge management
  2. ;; Copyright (C) 2012- Takafumi Arakaki
  3. ;; Author: Takafumi Arakaki <aka.tkf at gmail.com>
  4. ;; This file is NOT part of GNU Emacs.
  5. ;; ein-subpackages.el 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 3 of the License, or
  8. ;; (at your option) any later version.
  9. ;; ein-subpackages.el is distributed in the hope that it will be useful,
  10. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. ;; GNU General Public License for more details.
  13. ;; You should have received a copy of the GNU General Public License
  14. ;; along with ein-subpackages.el. If not, see <http://www.gnu.org/licenses/>.
  15. ;;; Commentary:
  16. ;;
  17. ;;; Code:
  18. (eval-when-compile (defvar ein:ac-config-once-called)
  19. (defvar ein:smartrep-config-once-called))
  20. (declare-function ein:ac-config-once "ein-ac")
  21. (declare-function ein:smartrep-config-once "ein-smartrep")
  22. (defcustom ein:use-auto-complete nil
  23. "Set to `t' to use preset auto-complete configuration.
  24. Use `ein:use-auto-complete-superpack' when you need more powerful
  25. auto completion."
  26. :type 'boolean
  27. :group 'ein)
  28. (defcustom ein:use-auto-complete-superpack nil
  29. "Set to `t' to use preset a little bit hacky auto-complete configuration.
  30. When this option is enabled, cached omni completion is available."
  31. :type 'boolean
  32. :group 'ein)
  33. (defcustom ein:use-smartrep nil
  34. "Set to `t' to use preset smartrep configuration.
  35. .. warning:: When used with MuMaMo (see `ein:notebook-modes'),
  36. keyboard macro which manipulates cell (add, remove, move,
  37. etc.) may start infinite loop (you need to stop it with
  38. ``C-g``). Please be careful using this option if you are a
  39. heavy keyboard macro user. Using keyboard macro for other
  40. commands is fine.
  41. .. (Comment) I guess this infinite loop happens because the three
  42. modules (kmacro.el, mumamo.el and smartrep.el) touches to
  43. `unread-command-events' in somehow inconsistent ways."
  44. :type 'boolean
  45. :group 'ein)
  46. (defcustom ein:load-dev nil
  47. "Load development helper."
  48. :type 'boolean
  49. :group 'ein)
  50. (defun ein:subpackages-load ()
  51. "Load sub-packages depending on configurations."
  52. (when (or ein:use-auto-complete
  53. ein:use-auto-complete-superpack)
  54. (require 'ein-ac)
  55. (ein:ac-config-once ein:use-auto-complete-superpack))
  56. (when ein:use-smartrep
  57. (require 'ein-smartrep)
  58. (ein:smartrep-config-once))
  59. (when ein:load-dev
  60. (require 'ein-dev)))
  61. (defun ein:subpackages-reload ()
  62. "Reload sub-packages."
  63. (interactive)
  64. (setq ein:ac-config-once-called nil)
  65. (setq ein:smartrep-config-once-called nil)
  66. (ein:subpackages-load))
  67. (provide 'ein-subpackages)
  68. ;;; ein-subpackages.el ends here