Skip to content

Commit

Permalink
Fix byte-compilation warnings (#621)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZharMeny committed Aug 7, 2024
1 parent 369014f commit 0ae8f41
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 36 deletions.
23 changes: 13 additions & 10 deletions meow-command.el
Original file line number Diff line number Diff line change
Expand Up @@ -1293,9 +1293,10 @@ with UNIVERSAL ARGUMENT, search both side."
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defun meow-search (arg)
" Search and select with the car of current `regexp-search-ring'.
"Search and select with the car of current `regexp-search-ring'.
If the contents of selection doesn't match the regexp, will push it to `regexp-search-ring' before searching.
If the contents of selection doesn't match the regexp, will push
it to `regexp-search-ring' before searching.
To search backward, use \\[negative-argument]."
(interactive "P")
Expand Down Expand Up @@ -1359,11 +1360,13 @@ Argument REVERSE if selection is reversed."
"Read a string from minibuffer, then find and select it.
The input will be pushed into `regexp-search-ring'. So
\\[meow-search] can be used for further searching with the same condition.
\\[meow-search] can be used for further searching with the same
condition.
A list of words and symbols in the current buffer will be provided for completion.
To search for regexp instead, set `meow-visit-sanitize-completion' to nil.
In that case, completions will be provided in regexp form, but also covering
A list of words and symbols in the current buffer will be
provided for completion. To search for regexp instead, set
`meow-visit-sanitize-completion' to nil. In that case,
completions will be provided in regexp form, but also covering
the words and symbols in the current buffer.
To search backward, use \\[negative-argument]."
Expand Down Expand Up @@ -1750,17 +1753,17 @@ This command is a replacement for built-in `kmacro-end-macro'."
(setq mouse-secondary-start next-marker)
(meow--cancel-selection))))

(defun meow-describe-key (key-list &optional buffer up-event)
(defun meow-describe-key (key-list &optional buffer)
(interactive (list (help--read-key-sequence)))
(if (= 1 (length key-list))
(let* ((key (format-kbd-macro (cdar key-list)))
(cmd (key-binding key)))
(if-let ((dispatch (and (commandp cmd)
(get cmd 'meow-dispatch))))
(describe-key (kbd dispatch) buffer up-event)
(describe-key key-list buffer up-event)))
(describe-key (kbd dispatch) buffer)
(describe-key key-list buffer)))
;; for mouse events
(describe-key key-list buffer up-event)))
(describe-key key-list buffer)))

;; aliases
(defalias 'meow-backward-delete 'meow-backspace)
Expand Down
1 change: 1 addition & 0 deletions meow-esc.el
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"Mode that ensures ESC works in the terminal"
:init-value nil
:global t
:group 'meow
:keymap nil
(if meow-esc-mode
(progn
Expand Down
18 changes: 9 additions & 9 deletions meow-helpers.el
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,19 @@ string SUFFIX. Then, convert this string into a symbol."
Example usage:
(meow-define-keys
;; state
'normal
\\='normal
;; bind to a command
'(\"a\" . meow-append)
\\='(\"a\" . meow-append)
;; bind to a keymap
(cons \"x\" ctl-x-map)
;; bind to a keybinding which holds a keymap
'(\"c\" . \"C-c\")
\\='(\"c\" . \"C-c\")
;; bind to a keybinding which holds a command
'(\"q\" . \"C-x C-q\"))"
\\='(\"q\" . \"C-x C-q\"))"
(declare (indent 1))
(let ((map (alist-get state meow-keymap-alist)))
(pcase-dolist (`(,key . ,def) keybinds)
Expand All @@ -70,16 +70,16 @@ Example usage:
Example usage:
(meow-normal-define-key
;; bind to a command
'(\"a\" . meow-append)
\\='(\"a\" . meow-append)
;; bind to a keymap
(cons \"x\" ctl-x-map)
;; bind to a keybinding which holds a keymap
'(\"c\" . \"C-c\")
\\='(\"c\" . \"C-c\")
;; bind to a keybinding which holds a command
'(\"q\" . \"C-x C-q\"))"
\\='(\"q\" . \"C-x C-q\"))"
(apply #'meow-define-keys 'normal keybinds))

(defun meow-leader-define-key (&rest keybinds)
Expand Down Expand Up @@ -196,7 +196,7 @@ Example usage:
(meow-define-state mystate
\"My meow state\"
:lighter \" [M]\"
:keymap 'my-keymap
:keymap \\='my-keymap
(message \"toggled state\"))
Also see meow-register-state, which is used internally by this
Expand All @@ -209,7 +209,7 @@ This function produces several items:
2. meow-NAME-mode-p: a predicate for whether the state is active.
3. meow-cursor-type-NAME: a variable for the cursor type for the state.
4. meow--update-cursor-NAME: a function that sets the cursor type to 3.
and face FACE or 'meow-unknown cursor if FACE is nil."
and face FACE or \\='meow-unknown cursor if FACE is nil."
(declare (indent 1))
(let ((name (symbol-name name-sym))
(init-value (plist-get body :init-value))
Expand Down
18 changes: 13 additions & 5 deletions meow-shims.el
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ Argument ENABLE non-nil means turn on."
(advice-add 'diff-hl-show-hunk-inline-popup :before 'meow--switch-to-motion)
(advice-add 'diff-hl-show-hunk-posframe :before 'meow--switch-to-motion)
(advice-add 'diff-hl-show-hunk-hide :after 'meow--switch-to-normal))
(advice-remove diff-hl-show-hunk-inline-popup 'meow--switch-to-motion)
(advice-remove diff-hl-show-hunk-posframe 'meow--switch-to-motion)
(advice-remove diff-hl-show-hunk-hide 'meow--switch-to-normal)))
(advice-remove 'diff-hl-show-hunk-inline-popup 'meow--switch-to-motion)
(advice-remove 'diff-hl-show-hunk-posframe 'meow--switch-to-motion)
(advice-remove 'diff-hl-show-hunk-hide 'meow--switch-to-normal)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; wgrep
Expand Down Expand Up @@ -272,6 +272,10 @@ Argument ENABLE non-nil means turn on."
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; which-key

(defvar which-key-mode)
(declare-function which-key--create-buffer-and-show "which-key"
(&optional prefix-keys from-keymap filter prefix-title))

(defvar meow--which-key-setup nil)

(defun meow--which-key-describe-keymap ()
Expand All @@ -293,7 +297,9 @@ Argument ENABLE non-nil means turn on."
(defvar meow--input-method-setup nil)

(defun meow--input-method-advice (fnc key)
"Intended to be advice for quail-input-method. Only use the input method in insert mode."
"Advice for `quail-input-method'.
Only use the input method in insert mode."
(funcall (if (and (boundp 'meow-mode) meow-mode (not (meow-insert-mode-p))) #'list fnc) key))

(defun meow--setup-input-method (enable)
Expand All @@ -305,6 +311,8 @@ Argument ENABLE non-nil means turn on."
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ddskk

(defvar skk-henkan-mode)

(defvar meow--ddskk-setup nil)
(defun meow--ddskk-skk-previous-candidate-advice (fnc &optional arg)
(if (and (not (eq skk-henkan-mode 'active))
Expand All @@ -314,7 +322,7 @@ Argument ENABLE non-nil means turn on."
(seq-first (car (where-is-internal
'meow-prev
meow-normal-state-keymap)))))
(previous-line)
(forward-line -1)
(funcall fnc arg)))

(defun meow--setup-ddskk (enable)
Expand Down
20 changes: 10 additions & 10 deletions meow-thing.el
Original file line number Diff line number Diff line change
Expand Up @@ -252,15 +252,15 @@ SYMBOL is a symbol represent a builtin thing.
Example: url
(meow-thing-register 'url 'url 'url)
(meow-thing-register \\='url \\='url \\='url)
SYNTAX-EXPR contains a syntax description used by `skip-syntax-forward'
Example: non-whitespaces
(meow-thing-register 'non-whitespace
'(syntax . \"^-\")
'(syntax . \"^-\"))
(meow-thing-register \\='non-whitespace
\\='(syntax . \"^-\")
\\='(syntax . \"^-\"))
You can find the description for syntax in current buffer with
\\[describe-syntax].
Expand All @@ -272,9 +272,9 @@ REGEXP-EXPR contains two regexps, the first is used for
Example: quoted
(meow-thing-register 'quoted
'(regexp \"`\" \"`\\\\|'\")
'(regexp \"`\" \"`\\\\|'\"))
(meow-thing-register \\='quoted
\\='(regexp \"\\=`\" \"\\=`\\\\|\\='\")
\\='(regexp \"\\=`\" \"\\=`\\\\|\\='\"))
PAIR-EXPR contains two string token lists. The tokens in first
list are used for finding beginning, the tokens in second list
Expand All @@ -283,9 +283,9 @@ PAIR-EXPR contains two string token lists. The tokens in first
Example: do/end block
(meow-thing-register 'do/end
'(pair (\"do\") (\"end\"))
'(pair (\"do\") (\"end\")))"
(meow-thing-register \\='do/end
\\='(pair (\"do\") (\"end\"))
\\='(pair (\"do\") (\"end\")))"
(let ((inner-fn (meow--thing-parse inner t))
(bounds-fn (meow--thing-parse bounds nil)))
(meow--thing-register thing inner-fn bounds-fn)))
Expand Down
4 changes: 3 additions & 1 deletion meow-util.el
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,15 @@ Looks up the state in meow-replace-state-name-list"
(meow--update-cursor)))

(defun meow--switch-state (state &optional no-hook)
"Switch to STATE execute 'meow-switch-state-hook unless NO-HOOK is non-nil."
"Switch to STATE execute `meow-switch-state-hook' unless NO-HOOK is non-nil."
(unless (eq state (meow--current-state))
(let ((mode (alist-get state meow-state-mode-alist)))
(funcall mode 1))
(unless (bound-and-true-p no-hook)
(run-hook-with-args 'meow-switch-state-hook state))))

(defvar meow--beacon-apply-command "meow-beacon")

(defun meow--exit-keypad-state ()
"Exit keypad state."
(meow-keypad-mode -1)
Expand Down
2 changes: 1 addition & 1 deletion meow-var.el
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ Nil means find the command by key binding."
To integrate WhichKey-like features with keypad.
Currently, keypad is not working well with which-key,
so Meow ships a default `meow-describe-keymap'.
Use (setq meow-keypad-describe-keymap-function 'nil) to disable popup.")
Use (setq meow-keypad-describe-keymap-function \\='nil) to disable popup.")

(defvar meow-keypad-get-title-function 'meow-keypad-get-title
"The function used to get the title of a keymap or command.")
Expand Down

0 comments on commit 0ae8f41

Please sign in to comment.