fixing gitignore
This commit is contained in:
26
lisp/sidenotes.el
Normal file
26
lisp/sidenotes.el
Normal file
@@ -0,0 +1,26 @@
|
||||
(defun z/no-sidenotes-file-p (file)
|
||||
"Return non-nil if FILE should be rendered without sidenotes.
|
||||
|
||||
A file is no-sidenotes if:
|
||||
- It has a #+NO_SIDENOTES: keyword, or
|
||||
- Its FILETAGS contain :NO_SIDENOTES: or :KANBAN:, or
|
||||
- Any top-level heading contains \"KANBAN\"."
|
||||
(when (file-exists-p file)
|
||||
(with-temp-buffer
|
||||
(insert-file-contents file)
|
||||
(org-mode)
|
||||
(let* ((case-fold-search t)
|
||||
(keywords (org-collect-keywords
|
||||
'("NO_SIDENOTES" "FILETAGS")))
|
||||
(flag (cadr (assoc "NO_SIDENOTES" keywords)))
|
||||
(filetags (cadr (assoc "FILETAGS" keywords))))
|
||||
(or
|
||||
(and flag (string-match-p "\\S-" flag))
|
||||
(and filetags
|
||||
(string-match-p
|
||||
":\\(NO_SIDENOTES\\|KANBAN\\):"
|
||||
(concat ":" filetags ":")))
|
||||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
(re-search-forward "^\\*+ .*KANBAN.*" nil t)))))))
|
||||
(provide 'sidenotes)
|
||||
Reference in New Issue
Block a user