Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add edebug specificatons to almost all defmacros #458

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion elfeed-db.el
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ Use `elfeed-db-return' to exit early and optionally return data.
(do-something entry)
(when (some-date-criteria-p entry)
(elfeed-db-return)))"
(declare (indent defun))
(declare (indent defun) (debug ((symbolp symbolp) body)))
`(catch 'elfeed-db-done
(prog1 nil
(elfeed-db-ensure)
Expand Down Expand Up @@ -254,6 +254,7 @@ The FEED-OR-ID may be a feed struct or a feed ID (url)."

(defmacro elfeed-db-return (&optional value)
"Use this to exit early and return VALUE from `with-elfeed-db-visit'."
(declare (debug (&optional sexp)))
`(throw 'elfeed-db-done ,value))

(defun elfeed-db-get-all-tags ()
Expand Down
2 changes: 1 addition & 1 deletion elfeed-search.el
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ expression, matching against entry link, title, and feed title."

(defmacro elfeed-save-excursion (&rest body)
"Like `save-excursion', but by entry/line/column instead of point."
(declare (indent defun))
(declare (indent defun) (debug t))
`(let ((entry (elfeed-search-selected :single))
(line (line-number-at-pos))
(column (current-column)))
Expand Down
2 changes: 1 addition & 1 deletion elfeed.el
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ list. The second argument is the tag list.")
This macro is anaphoric, with STATUS referring to the status from
`url-retrieve'/cURL and USE-CURL being the original invoked-value
of `elfeed-use-curl'."
(declare (indent defun))
(declare (indent defun) (debug (&define sexp def-body)))
`(let* ((use-curl elfeed-use-curl) ; capture current value in closure
(cb (lambda (status) ,@body)))
(if elfeed-use-curl
Expand Down
2 changes: 1 addition & 1 deletion tests/elfeed-db-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@

(defmacro with-elfeed-test (&rest body)
"Run BODY with a fresh, empty database that will be destroyed on exit."
(declare (indent defun))
(declare (indent defun) (debug t))
`(let* ((elfeed-db nil)
(elfeed-db-feeds nil)
(elfeed-db-entries nil)
Expand Down
1 change: 1 addition & 0 deletions tests/elfeed-search-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
(require 'elfeed-search)

(defmacro test-search-parse-filter-duration (filter after-days &optional before-days)
(declare (debug (stringp numberp &optional numberp)))
(let ((day (* 24 60 60)))
`(should (equal ',(cl-concatenate 'list
(when before-days
Expand Down
2 changes: 1 addition & 1 deletion web/elfeed-web.el
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@

(defmacro with-elfeed-web (&rest body)
"Only execute BODY if `elfeed-web-enabled' is true."
(declare (indent 0))
(declare (indent 0) (debug t))
`(if (not elfeed-web-enabled)
(progn
(princ (json-encode '(:error 403)))
Expand Down