diff --git a/core/cubes/cpp.el b/core/cubes/cpp.el index 3890a44..e46775f 100644 --- a/core/cubes/cpp.el +++ b/core/cubes/cpp.el @@ -26,7 +26,7 @@ (require 'fg42/utils) (defcube fg42/cmake-cube - "This cube enable CMake integration with FG42" + "This cube enables CMake integration with FG42" (:title "CMake cube" :flag-default t :flag cmake) @@ -35,11 +35,22 @@ (fpkg/use eldoc-cmake)) + +(defcube fg42/ninja-cube + "This cube enables Ninja integration with FG42. For more info checkout: +https://github.com/ninja-build/ninja/blob/master/misc/ninja-mode.el" + (:title "Ninja cube" + :flag-default t + :flag ninja) + (fpkg/use ninja-mode)) + + (defcube fg42/c++-cube "C++ cube" (:title "C++ cube" :no-flag t) (fg42/cmake-cube) + (fg42/ninja-cube) (add-to-list 'auto-mode-alist '("\\.h\\'" . c++-mode)) (add-hook 'c++-mode-hook (lambda () (lsp) diff --git a/core/cubes/meissa.el b/core/cubes/meissa.el new file mode 100644 index 0000000..a189512 --- /dev/null +++ b/core/cubes/meissa.el @@ -0,0 +1,80 @@ +;;; MeissaCube --- Meissa client for FG42 -*- lexical-binding: t; -*- +;; +;; Copyright (c) 2010-2022 Sameer Rahmani & Contributors +;; +;; Author: Sameer Rahmani +;; URL: https://ziglab.com/FG42/FG42 +;; Version: 3.0.0 +;; +;; 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 3 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, see . +;; +;;; Commentary: +;;; Code: +(require 'fpkg) +(require 'fg42/cube) +(require 'fg42/utils) +(require 'fg42/x) + +(defcube fg42/meissa-cube + "Integrate FG42 with Meissa" + (:title "Meissa cube" + :flag-default t + :flag meissa) + + (fpkg/use msgpack) + + (autoload 'msgpack-encode "msgpack") + (let ((host (or (plist-get fg42/meissa-cube-params :host) "127.0.0.1")) + (port (or (plist-get fg42/meissa-cube-params :port) "6666"))) + + (defun fg42/meissa-sentinel (process event) + (message "[Meissa] %s: %s" process event)) + + (defun fg42/meissa-send-command (command payload cb) + (let* ((encoded-command (msgpack-encode `((command . ,command) (payload . ,payload)))) + (decoded-response nil) + (process (make-network-process :name "meissa-client" + :buffer "*Meissa*" + :host host + :service port + :family 'ipv4 + :coding 'binary + :filter (lambda (_process data) + (setq decoded-response + (msgpack-read-from-string data))) + ;;(lambda (_process _event) (delete-process process)) + :sentinel #'fg42/meissa-sentinel))) + (process-send-string process encoded-command) + (setq command-response-timer + (run-with-timer 0 nil + (lambda (cb) + (while (not decoded-response) + (accept-process-output process)) + (funcall cb decoded-response)) + cb)))) + + + (defun fg42/meissa-process-response (response) + (message "[Meissa]: %s" response)) + + (defun fg42/meissa-speech (txt) + (fg42/meissa-send-command "enqueue" `((text . ,txt)) #'fg42/meissa-process-response)) + + (defun read-this-for-me () + (interactive) + (fg42/meissa-speech (fg42/get-x11-selection-text))))) + + +(provide 'cubes/meissa) +;;; meissa.el ends here diff --git a/core/cubes/python.el b/core/cubes/python.el index 9d3a860..e2120da 100644 --- a/core/cubes/python.el +++ b/core/cubes/python.el @@ -99,6 +99,16 @@ interactive `pyvenv-workon' function before `lsp'" (require 'lsp-pyright) (lsp))))) +(defcube fg42/poetry-cube + "Poetry support for FG42. To use it, just use `M-x poetry'." + (:title "Python cube" + :flag poetry + :flag-default t) + (fpkg/use poetry + :config + (poetry-tracking-mode 1))) + + (defcube fg42/python-cube "Python support cube." (:title "Python cube" diff --git a/core/fg42/x.el b/core/fg42/x.el new file mode 100644 index 0000000..ff116d9 --- /dev/null +++ b/core/fg42/x.el @@ -0,0 +1,31 @@ +;;; FG42 --- The mighty editor for the emacsians -*- lexical-binding: t; -*- +;; +;; Copyright (c) 2010-2022 Sameer Rahmani +;; +;; Author: Sameer Rahmani +;; URL: https://devheroes.codes/FG42/FG42 +;; Version: 3.0.0 +;; +;; 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 3 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, see . +;; +;;; Commentary: +;;; Code: + +(defun fg42/get-x11-selection-text () + "Return the X11 selection paste text." + (interactive) + (x-get-selection 'PRIMARY)) + +(provide 'fg42/x) +;;; x.el ends here