From 16c2ad9fe8383e28588ac86c69f609714794b745 Mon Sep 17 00:00:00 2001 From: Sameer Rahmani Date: Thu, 6 May 2021 09:29:34 +0100 Subject: [PATCH] Add pinentry and rcirc cubes --- core/cubes/editor.el | 10 +++++++++ core/cubes/irc.el | 39 +++++++++++++++++++++++++++++++++++ core/cubes/irc/core.el | 46 ++++++++++++++++++++++++++++++++++++++++++ core/fg42/utils.el | 8 +++++--- 4 files changed, 100 insertions(+), 3 deletions(-) create mode 100644 core/cubes/irc.el create mode 100644 core/cubes/irc/core.el diff --git a/core/cubes/editor.el b/core/cubes/editor.el index df5d3cd..1a64846 100644 --- a/core/cubes/editor.el +++ b/core/cubes/editor.el @@ -28,6 +28,16 @@ "Enable the support for font icones in FG42.") +(defcube fg42/pinentry-cube + (:docs "cubes/fg42/pinentry-cube.org" + :flag pinentry) + (fpkg/use pinentry + :init + (progn + (setq epa-pinentry-mode 'loopback) + (pinentry-start)))) + + (defcube fg42/exec-path-cube (:docs "cubes/fg42/exec-path-cube.org" :flag exec-path-from-shell) diff --git a/core/cubes/irc.el b/core/cubes/irc.el new file mode 100644 index 0000000..24f21aa --- /dev/null +++ b/core/cubes/irc.el @@ -0,0 +1,39 @@ +;;; IrcCubes --- The IRC related cubes for FG42 -*- lexical-binding: t; -*- +;; +;; Copyright (c) 2010-2021 Sameer Rahmani & Contributors +;; +;; Author: Sameer Rahmani +;; URL: https://gitlab.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) + + +(defcube fg42/rcirc-cube + (:docs "cubes/fg42/rcirc-cube.org" + :flag rcirc) + (autoload-cube 'fg42/rcirc-connect "irc/core.el" "Connect to IRC via RCIRC." t) + (defun fg42/connect-to-irc () + (interactive) + (fg42/rcirc-connect))) + + + +(provide 'cubes/irc) +;;; irc.el ends here diff --git a/core/cubes/irc/core.el b/core/cubes/irc/core.el new file mode 100644 index 0000000..222895a --- /dev/null +++ b/core/cubes/irc/core.el @@ -0,0 +1,46 @@ +;;; IrcCubes --- The IRC related cubes for FG42 -*- lexical-binding: t; -*- +;; +;; Copyright (c) 2010-2021 Sameer Rahmani & Contributors +;; +;; Author: Sameer Rahmani +;; URL: https://gitlab.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: + + +(defvar fg42/default-rcirc-servers + '(("chat.freenode.net" + :channels ("#fg42")))) + +(defun fg42/rcirc-connect () + "Connect to IRC servers." + (interactive) + (require 'rcirc) + + (let ((servers (or (plist-get fg42/rcirc-cube-params :server) + fg42/default-rcirc-servers))) + (setq rcirc-enable-authinfo-support t) + (setq rcirc-server-alist servers) + (add-hook 'rcirc-mode-hook + (lambda () + (rcirc-track-minor-mode 1))) + (irc nil))) + + +(provide 'cubes/irc/core) +;;; core.el ends here diff --git a/core/fg42/utils.el b/core/fg42/utils.el index b1ed1a4..a30ee57 100644 --- a/core/fg42/utils.el +++ b/core/fg42/utils.el @@ -163,10 +163,12 @@ last item in second form, etc." (load-file file))) -(defmacro autoload-cube (fn file docstring) +(defmacro autoload-cube (fn file docstring &optional interactive) "A wrapper for autloading FN at FILE with the given DOCSTRING. -This macro looks inside of the cubes directories." - `(autoload ,fn (expand-file-name (format "core/cubes/%s" ,file) fg42-home) ,docstring)) +This macro looks inside of the cubes directories. If the INTERACTIVE param +is non-nil value it means that the function can be called interactively." + `(autoload ,fn (expand-file-name (format "core/cubes/%s" ,file) fg42-home) + ,docstring ,interactive)) (provide 'fg42/utils)