Fix all the compilation warns and errors
This commit is contained in:
parent
2b8cb40752
commit
9c55995d76
|
@ -25,6 +25,14 @@
|
|||
;;; Code:
|
||||
(require 'noether)
|
||||
|
||||
(eval-when-compile
|
||||
(defvar line-unit)
|
||||
(defvar buffer-name-unit)
|
||||
(defvar time-unit)
|
||||
(defvar mode-name-unit)
|
||||
(defvar projectile-project-unit)
|
||||
(declare-function projectile-project-name "projectile-project-name" ()))
|
||||
|
||||
;; ============================================================================
|
||||
;; line number indicator
|
||||
;; ============================================================================
|
||||
|
@ -41,7 +49,7 @@
|
|||
(format "%4d:%4d" (car v) (cadr v)))
|
||||
|
||||
|
||||
(defunit line-unit
|
||||
(noether-defunit line-unit
|
||||
"Show the line number."
|
||||
:label (propertize "L" 'face 'highlight)
|
||||
:len 9
|
||||
|
@ -72,13 +80,13 @@
|
|||
(string-trim v))))
|
||||
|
||||
|
||||
(defunit buffer-name-unit
|
||||
(noether-defunit buffer-name-unit
|
||||
"Show the current buffer name in the viwe.
|
||||
|
||||
The format of the unit is like: `(*|-)(*|-)BUFFER-NAME'.
|
||||
The first char will be an asterisk if the buffer contains unsaved changes and
|
||||
the second char will be an asterisk if the file changed on the disk without Emacs
|
||||
knowing."
|
||||
the second char will be an asterisk if the file changed on the disk without
|
||||
Emacs knowing."
|
||||
:label ""
|
||||
:len 32
|
||||
:init (lambda ()
|
||||
|
@ -104,7 +112,7 @@ knowing."
|
|||
v)
|
||||
|
||||
|
||||
(defunit time-unit
|
||||
(noether-defunit time-unit
|
||||
"just the time for your bar."
|
||||
:label "T:"
|
||||
:len 8
|
||||
|
@ -141,12 +149,12 @@ knowing."
|
|||
v)
|
||||
|
||||
|
||||
(defunit projectile-project-unit
|
||||
(noether-defunit projectile-project-unit
|
||||
"just the time for your bar."
|
||||
:label "P:"
|
||||
:len 30
|
||||
:init (lambda ()
|
||||
(if (and (featurep 'projectile) projectile-mode)
|
||||
(if (and (featurep 'projectile) (boundp 'projectile-mode))
|
||||
(add-hook 'noether-on-buffer-change-hook #'noether--set-project)
|
||||
(warn "Can't find feature `projectile'")))
|
||||
:deinit (lambda ()
|
||||
|
|
16
noether.el
16
noether.el
|
@ -29,10 +29,16 @@
|
|||
(require 'seq)
|
||||
(require 'posframe)
|
||||
|
||||
(defgroup noether nil
|
||||
"The customization group for the noether-mode."
|
||||
:group 'convenience)
|
||||
|
||||
;; ============================================================================
|
||||
;; Vars
|
||||
;; ============================================================================
|
||||
(eval-when-compile
|
||||
(defvar noether-global-mode-map))
|
||||
|
||||
(defvar noether-views ()
|
||||
"A list of views that noether should manage.
|
||||
|
||||
|
@ -90,7 +96,7 @@ function."
|
|||
(string-trim ,new-var-sym))
|
||||
|
||||
|
||||
(defunit ,name
|
||||
(noether-defunit ,name
|
||||
,docs
|
||||
:label ,label
|
||||
:len ,len
|
||||
|
@ -214,7 +220,7 @@ It will pass WATCH-PARAMS to the unit's `:fn'"
|
|||
(replace-region-contents
|
||||
(+ 1 start-point)
|
||||
(+ 1 start-point len)
|
||||
(lambda () (string-pad (truncate-string-to-width res len) len))))))))
|
||||
(lambda () (string-pad txt len))))))))
|
||||
|
||||
|
||||
(defun noether--make-updater (buf f start-point len)
|
||||
|
@ -303,7 +309,8 @@ E.g. the updaters list."
|
|||
|
||||
|
||||
(defun noether--teardown-unit (unit)
|
||||
"Tear down the given UNIT by calling the `:deinit' function and removing possible watches."
|
||||
"Tear down the given UNIT by calling the `:deinit' fn.
|
||||
It removes any possible watch function."
|
||||
(let ((deinit (noether--unit-get unit :deinit (lambda ()))))
|
||||
(funcall deinit)))
|
||||
|
||||
|
@ -338,7 +345,8 @@ E.g. the updaters list."
|
|||
"A minor mode that keep tracks of different status blocks.
|
||||
It reports them back in a status bar like frame."
|
||||
:global t
|
||||
:lighter " ST42"
|
||||
:lighter " N"
|
||||
:group 'noether
|
||||
:keymap (make-sparse-keymap)
|
||||
(if noether-global-mode
|
||||
(noether--enable)
|
||||
|
|
Loading…
Reference in New Issue