From 2b8cb40752a0b56cb802b936687f90232782536d Mon Sep 17 00:00:00 2001 From: Sameer Rahmani Date: Sun, 25 Jun 2023 19:22:23 +0100 Subject: [PATCH] Fix all the linter issues --- README.org | 6 +++--- noether-test.el | 41 ----------------------------------------- noether.el | 10 +++++++--- noether.example.el | 2 +- 4 files changed, 11 insertions(+), 48 deletions(-) delete mode 100644 noether-test.el diff --git a/README.org b/README.org index ce4a868..7045766 100644 --- a/README.org +++ b/README.org @@ -20,10 +20,10 @@ to jump around in a view. * View Each view represents a frame in Emacs literature (controlled by [[https://github.com/tumashu/posframe][posframe]] under the hood). A view -can be defined using the =defview= macro like: +can be defined using the =noether-defview= macro like: #+BEGIN_SRC emacs-lisp - (defview example-bar + (noether-defview example-bar "Just a test view" ;; Name of the buffer to be used for the view. It will be managed by Noether @@ -108,7 +108,7 @@ While *Noether* comes with a few units, you can define you own like: ;; The unit definition of the unit - (defunit projectile-project-unit + (noether-defunit projectile-project-unit "Show the current project name in the view." ;; The format of this unit would be like: "P: " ;; the free space will be filled with the project name diff --git a/noether-test.el b/noether-test.el deleted file mode 100644 index 09cfd0f..0000000 --- a/noether-test.el +++ /dev/null @@ -1,41 +0,0 @@ -;;; noether.el --- A modeline which plays hide and seek -*- lexical-binding: t; -*- -;; -;; Copyright (c) 2023 Sameer Rahmani -;; -;; Author: Sameer Rahmani -;; URL: https://devheroes.codes/lxsameer/noether -;; Version: 0.1.0 -;; Keywords: frames, modeline -;; Package-Requires: (posframe seq) -;; -;; 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: -;;; Change Log: -;;; Code: -(require 'ert) -(require 'noether) - -(ert-deftest test-noether/update () - "Update should call the :f function and pass the state correctly." - (let* ((f (lambda (_) (error "Expected" :type 'ex))) - (view (list :foo (list :cell '(0 . 2) :unit (list :f f))))) - - (should-error (noether/update view :foo) - :type 'ex) - )) - - -(provide 'noether-test) -;;; noether-test.el ends here diff --git a/noether.el b/noether.el index 17367d8..06a79fe 100644 --- a/noether.el +++ b/noether.el @@ -6,7 +6,7 @@ ;; URL: https://devheroes.codes/lxsameer/noether ;; Version: 0.1.0 ;; Keywords: frames, modeline -;; Package-Requires: (posframe (emacs "26.1")) +;; Package-Requires: ((posframe "1.4.2") (emacs "27.1")) ;; ;; 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 @@ -22,6 +22,8 @@ ;; along with this program. If not, see . ;; ;;; Commentary: +;; A simple frame manager framework that can be utilized to create a mode line +;; alternative. ;;; Change Log: ;;; Code: (require 'seq) @@ -37,6 +39,7 @@ You should adding your views to this var, so noether can activate them on demand.") + (defvar noether-on-buffer-change-hook () "A hook that runs whenever noether detects focus change on buffers.") @@ -103,7 +106,7 @@ function." :fn #',(intern (format "%s--format-final-result" (symbol-name name))))))) -(defmacro defview (name docs &rest body) +(defmacro noether-defview (name docs &rest body) "Create a new view with the given NAME with the given DOCS and BODY. BODY will be parsed in a way that any starting pair of keyword and value will be used as the view properties and the rest will be the body of @@ -129,7 +132,7 @@ the show function." (put ',name :initial-content ,initial-content) t))) -(defmacro defunit (name docs &rest props) +(defmacro noether-defunit (name docs &rest props) "Define a unit with the given NAME, DOCS and a set of PROPS. It will define a function with the given NAME that accepts any parameter in form of key/values that will override any original @@ -330,6 +333,7 @@ E.g. the updaters list." (mapc #'noether--teardown-views noether-views)) +;;;###autoload (define-minor-mode noether-global-mode "A minor mode that keep tracks of different status blocks. It reports them back in a status bar like frame." diff --git a/noether.example.el b/noether.example.el index fb4566e..8eb8ebc 100644 --- a/noether.example.el +++ b/noether.example.el @@ -29,7 +29,7 @@ (require 'noether-units) ;;(debug-on-entry 'noether--update-buffer-name) -(defview example-bar +(noether-defview example-bar "Just a test view" :managed? t :buffer "*mainview*"