Fix all the linter issues

This commit is contained in:
Sameer Rahmani 2023-06-25 19:22:23 +01:00
parent 46e0eea75a
commit 2b8cb40752
Signed by: lxsameer
GPG Key ID: B0A4AF28AB9FD90B
4 changed files with 11 additions and 48 deletions

View File

@ -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

View File

@ -1,41 +0,0 @@
;;; noether.el --- A modeline which plays hide and seek -*- lexical-binding: t; -*-
;;
;; Copyright (c) 2023 Sameer Rahmani <lxsameer@gnu.org>
;;
;; Author: Sameer Rahmani <lxsameer@gnu.org>
;; 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 <http://www.gnu.org/licenses/>.
;;
;;; 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

View File

@ -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 <http://www.gnu.org/licenses/>.
;;
;;; 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."

View File

@ -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*"