mirror of
https://github.com/abo-abo/avy.git
synced 2025-10-14 05:43:04 +00:00
Run checkdoc
* avy-jump.el (cl-lib): Is already required in avy. (avy-keys-alist): Fix doc. (avy--with-avy-keys): Add doc. (avy-word-punc-regexp): Fix doc. (avy--process): Fix doc. (avy--overlay-at): Fix doc. (avy--overlay-post): Fix doc. (avy--line): Fix doc. (avy-goto-line): Fix doc. Fixes #25
This commit is contained in:
parent
cc822c1aad
commit
9e6561b646
29
avy-jump.el
29
avy-jump.el
@ -26,7 +26,6 @@
|
|||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
;;* Requires
|
;;* Requires
|
||||||
(require 'cl-lib)
|
|
||||||
(require 'avy)
|
(require 'avy)
|
||||||
|
|
||||||
;;* Customization
|
;;* Customization
|
||||||
@ -40,7 +39,7 @@
|
|||||||
:type '(repeat :tag "Keys" character))
|
:type '(repeat :tag "Keys" character))
|
||||||
|
|
||||||
(defcustom avy-keys-alist nil
|
(defcustom avy-keys-alist nil
|
||||||
"Alist of avy-jump commands to avy-keys overriding the default avy-keys."
|
"Alist of avy-jump commands to `avy-keys' overriding the default `avy-keys'."
|
||||||
:type '(alist :key-type (choice :tag "Command"
|
:type '(alist :key-type (choice :tag "Command"
|
||||||
(const avy-goto-char)
|
(const avy-goto-char)
|
||||||
(const avy-goto-char-2)
|
(const avy-goto-char-2)
|
||||||
@ -56,6 +55,7 @@
|
|||||||
:value-type (repeat :tag "Keys" character)))
|
:value-type (repeat :tag "Keys" character)))
|
||||||
|
|
||||||
(defmacro avy--with-avy-keys (command &rest body)
|
(defmacro avy--with-avy-keys (command &rest body)
|
||||||
|
"Set `avy-keys' according to COMMAND and execute BODY."
|
||||||
(declare (indent 1))
|
(declare (indent 1))
|
||||||
`(let ((avy-keys (or (cdr (assq ',command avy-keys-alist))
|
`(let ((avy-keys (or (cdr (assq ',command avy-keys-alist))
|
||||||
avy-keys)))
|
avy-keys)))
|
||||||
@ -66,8 +66,8 @@
|
|||||||
:type 'boolean)
|
:type 'boolean)
|
||||||
|
|
||||||
(defcustom avy-word-punc-regexp "[!-/:-@[-`{-~]"
|
(defcustom avy-word-punc-regexp "[!-/:-@[-`{-~]"
|
||||||
"Regexp of punctuation characters that should be matched when calling
|
"Regexp of punctuation chars that count as word starts for `avy-goto-word-1.
|
||||||
`avy-goto-word-1' command. When nil, punctuation chars will not be matched.
|
When nil, punctuation chars will not be matched.
|
||||||
|
|
||||||
\"[!-/:-@[-`{-~]\" will match all printable punctuation chars."
|
\"[!-/:-@[-`{-~]\" will match all printable punctuation chars."
|
||||||
:type 'regexp)
|
:type 'regexp)
|
||||||
@ -113,7 +113,8 @@ POS is either a position or (BEG . END)."
|
|||||||
(goto-char pt))))
|
(goto-char pt))))
|
||||||
|
|
||||||
(defun avy--process (candidates overlay-fn)
|
(defun avy--process (candidates overlay-fn)
|
||||||
"Select one of CANDIDATES using `avy-read'."
|
"Select one of CANDIDATES using `avy-read'.
|
||||||
|
Use OVERLAY-FN to visualize the decision overlay."
|
||||||
(unwind-protect
|
(unwind-protect
|
||||||
(cl-case (length candidates)
|
(cl-case (length candidates)
|
||||||
(0
|
(0
|
||||||
@ -193,9 +194,9 @@ When PRED is non-nil, it's a filter for matching point positions."
|
|||||||
(push ol avy--overlays-lead))))
|
(push ol avy--overlays-lead))))
|
||||||
|
|
||||||
(defun avy--overlay-pre (path leaf)
|
(defun avy--overlay-pre (path leaf)
|
||||||
"Create an overlay with STR at LEAF.
|
"Create an overlay with PATH at LEAF.
|
||||||
PATH is a list of keys from tree root to LEAF.
|
PATH is a list of keys from tree root to LEAF.
|
||||||
LEAF is ((BEG . END) . WND)."
|
LEAF is normally ((BEG . END) . WND)."
|
||||||
(avy--overlay
|
(avy--overlay
|
||||||
(propertize (apply #'string (reverse path))
|
(propertize (apply #'string (reverse path))
|
||||||
'face 'avy-lead-face)
|
'face 'avy-lead-face)
|
||||||
@ -210,9 +211,9 @@ LEAF is ((BEG . END) . WND)."
|
|||||||
(selected-window))))
|
(selected-window))))
|
||||||
|
|
||||||
(defun avy--overlay-at (path leaf)
|
(defun avy--overlay-at (path leaf)
|
||||||
"Create an overlay with STR at LEAF.
|
"Create an overlay with PATH at LEAF.
|
||||||
PATH is a list of keys from tree root to LEAF.
|
PATH is a list of keys from tree root to LEAF.
|
||||||
LEAF is ((BEG . END) . WND)."
|
LEAF is normally ((BEG . END) . WND)."
|
||||||
(let ((str (propertize
|
(let ((str (propertize
|
||||||
(string (car (last path)))
|
(string (car (last path)))
|
||||||
'face 'avy-lead-face))
|
'face 'avy-lead-face))
|
||||||
@ -234,9 +235,9 @@ LEAF is ((BEG . END) . WND)."
|
|||||||
(push ol avy--overlays-lead))))
|
(push ol avy--overlays-lead))))
|
||||||
|
|
||||||
(defun avy--overlay-post (path leaf)
|
(defun avy--overlay-post (path leaf)
|
||||||
"Create an overlay with STR at LEAF.
|
"Create an overlay with PATH at LEAF.
|
||||||
PATH is a list of keys from tree root to LEAF.
|
PATH is a list of keys from tree root to LEAF.
|
||||||
LEAF is ((BEG . END) . WND)."
|
LEAF is normally ((BEG . END) . WND)."
|
||||||
(avy--overlay
|
(avy--overlay
|
||||||
(propertize (apply #'string (reverse path))
|
(propertize (apply #'string (reverse path))
|
||||||
'face 'avy-lead-face)
|
'face 'avy-lead-face)
|
||||||
@ -392,7 +393,8 @@ The case is ignored."
|
|||||||
arg (lambda () (eq (downcase (char-after)) char))))))
|
arg (lambda () (eq (downcase (char-after)) char))))))
|
||||||
|
|
||||||
(defun avy--line (&optional arg)
|
(defun avy--line (&optional arg)
|
||||||
"Select line in current window."
|
"Select a line.
|
||||||
|
The window scope is determined by `avy-all-windows' (ARG negates it)."
|
||||||
(let ((avy-background nil)
|
(let ((avy-background nil)
|
||||||
candidates)
|
candidates)
|
||||||
(avy-dowindows arg
|
(avy-dowindows arg
|
||||||
@ -410,7 +412,8 @@ The case is ignored."
|
|||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun avy-goto-line (&optional arg)
|
(defun avy-goto-line (&optional arg)
|
||||||
"Jump to a line start in current buffer."
|
"Jump to a line start in current buffer.
|
||||||
|
The window scope is determined by `avy-all-windows' (ARG negates it)."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(avy--with-avy-keys avy-goto-line
|
(avy--with-avy-keys avy-goto-line
|
||||||
(avy--goto (avy--line arg))))
|
(avy--goto (avy--line arg))))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user