Skip to content

Commit

Permalink
feat(indicators): add cited
Browse files Browse the repository at this point in the history
Co-authored-by: Anders Johansson <[email protected]>
Signed-off-by: Bruce D'Arcus <[email protected]>
  • Loading branch information
bdarcus and andersjohansson committed Mar 24, 2023
1 parent 0c6a803 commit 2d0d136
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion citar.el
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,19 @@ in some cases when using icons.")
:function #'citar-has-notes
:tag "has:notes"))

(defvar citar-indicator-cited
(citar-indicator-create
:symbol "C"
:function #'citar-is-cited
:tag "is:cited"))

;; Indicator config

(defvar citar-indicators
(list citar-indicator-links
citar-indicator-files
citar-indicator-notes))
citar-indicator-notes
citar-indicator-cited))

(defcustom citar-symbols
`((file . ("F" . " "))
Expand Down Expand Up @@ -1114,6 +1121,13 @@ nil, return nil."
(push (format urlformat fieldvalue) keylinks))))
(nreverse keylinks)))))))

(defun citar-is-cited ()
"Return function to check if reference is cited in buffer."
(let ((iscited
(citar--major-mode-function 'list-keys #'ignore)))
(lambda (citekey)
(member citekey iscited))))

(defun citar-has-files ()
"Return predicate testing whether entry has associated files.
Expand Down

0 comments on commit 2d0d136

Please sign in to comment.