Expose the 'skip' argument of org-map-entries
It is useful for filtering by deck for example.
This commit is contained in:
parent
0ed320d8da
commit
5982dcef69
1 changed files with 13 additions and 12 deletions
|
@ -491,7 +491,8 @@ A leading logical operator like `+' or `&' is required in MATCH."
|
||||||
;; disable property inheritance temporarily, or all subheadings of a
|
;; disable property inheritance temporarily, or all subheadings of a
|
||||||
;; note heading will be counted as note headings as well
|
;; note heading will be counted as note headings as well
|
||||||
(let ((org-use-property-inheritance nil))
|
(let ((org-use-property-inheritance nil))
|
||||||
(org-map-entries func
|
(apply #'org-map-entries
|
||||||
|
func
|
||||||
(concat "+" anki-editor-prop-note-type "<>\"\""
|
(concat "+" anki-editor-prop-note-type "<>\"\""
|
||||||
match
|
match
|
||||||
anki-editor-note-match)
|
anki-editor-note-match)
|
||||||
|
@ -646,7 +647,7 @@ see `anki-editor-insert-note' which wraps this function."
|
||||||
(read (or (org-entry-get-with-inheritance anki-editor-prop-format t) "t")))
|
(read (or (org-entry-get-with-inheritance anki-editor-prop-format t) "t")))
|
||||||
|
|
||||||
(defun anki-editor-toggle-format ()
|
(defun anki-editor-toggle-format ()
|
||||||
"Cycle ANKI_FROMAT through \"nil\" and \"t\"."
|
"Cycle ANKI_FORMAT through \"nil\" and \"t\"."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((val (pcase (org-entry-get nil anki-editor-prop-format nil t)
|
(let ((val (pcase (org-entry-get nil anki-editor-prop-format nil t)
|
||||||
('nil "nil")
|
('nil "nil")
|
||||||
|
@ -960,15 +961,15 @@ Return a list of cons of (FIELD-NAME . FIELD-CONTENT)."
|
||||||
(length anki-editor--note-markers) (buffer-name) (point))
|
(length anki-editor--note-markers) (buffer-name) (point))
|
||||||
(push (point-marker) anki-editor--note-markers))
|
(push (point-marker) anki-editor--note-markers))
|
||||||
|
|
||||||
(defun anki-editor-push-notes (&optional scope match)
|
(defun anki-editor-push-notes (&optional scope match &rest skip)
|
||||||
"Build notes from headings that MATCH within SCOPE and push them to Anki.
|
"Build notes from headings that MATCH within SCOPE and push them to Anki.
|
||||||
|
|
||||||
The default search condition `&ANKI_NOTE_TYPE<>\"\"' will always
|
The default search condition `&ANKI_NOTE_TYPE<>\"\"' will always
|
||||||
be appended to MATCH.
|
be appended to MATCH.
|
||||||
|
|
||||||
For notes that already exist in Anki (i.e. has `ANKI_NOTE_ID'
|
For notes that already exist in Anki (i.e. has `ANKI_NOTE_ID'
|
||||||
property), only their fields and tags will be updated, change of
|
property), only their fields, tags and deck will be updated,
|
||||||
deck or note type are currently not supported.
|
change of note type is currently not supported.
|
||||||
|
|
||||||
If SCOPE is not specified, the following rules are applied to
|
If SCOPE is not specified, the following rules are applied to
|
||||||
determine the scope:
|
determine the scope:
|
||||||
|
@ -990,8 +991,8 @@ of that heading."
|
||||||
(t nil))))
|
(t nil))))
|
||||||
(unwind-protect
|
(unwind-protect
|
||||||
(progn
|
(progn
|
||||||
(anki-editor-map-note-entries
|
(apply #'anki-editor-map-note-entries
|
||||||
#'anki-editor--collect-note-marker match scope)
|
#'anki-editor--collect-note-marker match scope skip)
|
||||||
(setq anki-editor--note-markers (reverse anki-editor--note-markers))
|
(setq anki-editor--note-markers (reverse anki-editor--note-markers))
|
||||||
(let ((count 0)
|
(let ((count 0)
|
||||||
(failed 0))
|
(failed 0))
|
||||||
|
|
Loading…
Reference in a new issue