Skip to content

Instantly share code, notes, and snippets.

@justinabrahms
Created June 14, 2022 06:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinabrahms/4bc97379cb8d8e317ca98a1f09524a5c to your computer and use it in GitHub Desktop.
Save justinabrahms/4bc97379cb8d8e317ca98a1f09524a5c to your computer and use it in GitHub Desktop.
Warning (org-element-cache): org-element--cache: (ivy-alt-done) Cached element is incorrect in emacs.org. (Cache tic up to date: "yes") Resetting.
If this warning appears regularly, please report the warning text to Org mode mailing list (M-x org-submit-bug-report).
The element is: "(src-block (:language \"elisp\" :switches nil :parameters nil :begin 36507 :end 40247 :number-lines nil :preserve-indent nil :retain-labels t :use-labels t :label-fmt nil :value \"(use-package citar
:no-require
:custom
(org-cite-global-bibliography '(\\\"~/docs/references.bib\\\"))
(org-cite-insert-processor 'citar)
(org-cite-follow-processor 'citar)
(org-cite-activate-processor 'citar)
(citar-bibliography org-cite-global-bibliography)
;; optional: org-cite-insert is also bound to C-c C-x C-@
:bind
(:map org-mode-map :package org (\\\"C-c b\\\" . #'org-cite-insert)))
(use-package org-ref
:config
(setq
org-ref-completion-library 'org-ref-ivy-cite
;; org-ref-get-pdf-filename-function 'org-ref-get-pdf-filename-helm-bibtex
org-ref-default-bibliography '(\\\"~/docs/references.bib\\\")
org-ref-note-title-format \\\"* TODO %y - %t\\\\n :PROPERTIES:\\\\n :Custom_ID: %k\\\\n :NOTER_DOCUMENT: %F\\\\n :ROAM_KEY: cite:%k\\\\n :AUTHOR: %9a\\\\n :JOURNAL: %j\\\\n :YEAR: %y\\\\n :VOLUME: %v\\\\n :PAGES: %p\\\\n :DOI: %D\\\\n :URL: %U\\\\n :END:\\\\n\\\\n\\\"
org-ref-notes-directory \\\"~/docs/roam/\\\"
org-ref-notes-function 'orb-edit-notes
bibtex-align-at-equal-sign t ; prettier formatting
bibtex-dialect 'biblatex ; bibtex is apparently very old (1988), so use the new variant
;; tell org to output using bibtex
org-latex-pdf-process (list \\\"latexmk -shell-escape -bibtex -f -pdf %f\\\")
bibtex-user-optional-fields '((\\\"keywords\\\" \\\"Keywords to describe the entry\\\" \\\"\\\")
(\\\"file\\\" \\\"link to the document file\\\" \\\":\\\")
(\\\"url\\\" \\\"url of the thing\\\" \\\"\\\"))
bibtex-completion-bibliography '(\\\"~/docs/references.bib\\\")
bibtex-completion-library-path '(\\\"~/docs/pdfs_for_notes/\\\")
bibtex-completion-pdf-field \\\"file\\\"
;; Not sure about this yet..
bibtex-completion-notes-template-multiple-files
(concat
\\\"#+TITLE: ${title}\\\\n\\\"
\\\"#+ROAM_KEY: cite:${=key=}\\\\n\\\"
\\\"* TODO Notes\\\\n\\\"
\\\":PROPERTIES:\\\\n\\\"
\\\":Custom_ID: ${=key=}\\\\n\\\"
\\\":NOTER_DOCUMENT: %(orb-process-file-field \\\\\\\"${=key=}\\\\\\\")\\\\n\\\"
\\\":AUTHOR: ${author-abbrev}\\\\n\\\"
\\\":JOURNAL: ${journaltitle}\\\\n\\\"
\\\":DATE: ${date}\\\\n\\\"
\\\":YEAR: ${year}\\\\n\\\"
\\\":DOI: ${doi}\\\\n\\\"
\\\":URL: ${url}\\\\n\\\"
\\\":END:\\\\n\\\\n\\\"
)
)
)
(use-package citeproc)
(use-package bibtex
:config
(setq bibtex-autokey-year-length 4
bibtex-autokey-name-year-separator \\\"-\\\"
bibtex-autokey-year-title-separator \\\"-\\\"
bibtex-autokey-titleword-separator \\\"-\\\"
bibtex-autokey-titlewords 2
bibtex-autokey-titlewords-stretch 1
bibtex-autokey-titleword-length 5))
(use-package ivy-bibtex
:config
(autoload 'ivy-bibtex \\\"ivy-bibtex\\\" \\\"\\\" t)
;; ivy-bibtex requires ivy's `ivy--regex-ignore-order` regex builder, which
;; ignores the order of regexp tokens when searching for matching candidates.
;; Add something like this to your init file:
(setq ivy-re-builders-alist
'((ivy-bibtex . ivy--regex-ignore-order)
(t . ivy--regex-plus))))
;; most of this config taken from http://www.wouterspekkink.org/academia/writing/tool/doom-emacs/2021/02/27/writing-academic-papers-with-org-mode.html
(use-package org-roam-bibtex
:after org-roam
:hook org-roam-mode
:bind (:map org-mode-map (\\\"C-c n b\\\" . orb-note-actions)) ;; yes, really `orb`.
:config
(require 'org-ref)
(org-roam-bibtex-mode)
(setq orb-preformat-keywords '(\\\"citekey\\\" \\\"title\\\" \\\"url\\\" \\\"author-or-editor\\\" \\\"keywords\\\" \\\"file\\\")
orb-process-file-keyword t
orb-file-field-extensions '(pdf))
(setq orb-templates
'((\\\"r\\\" \\\"ref\\\" 'org-roam-capture--get-point \\\"\\\"
:file-name \\\"${citekey}\\\"
:head \\\"#+TITLE: ${citekey}: ${title}\\\\n#+ROAM_KEY: ${ref}
- tags ::
- keywords :: ${keywords}
* Notes
:PROPERTIES:
:Custom_ID: ${citekey}
:URL: ${url}
:AUTHOR: ${author-or-editor}
:NOTER_DOCUMENT: ${file}
:NOTER_PAGE:
:END:\\\")))
)
\" :post-blank 1 :post-affiliated 36507 :mode nil :granularity element :cached t :parent (section (:begin 35930 :end 42956 :contents-begin 35930 :contents-end 42955 :robust-begin 35930 :robust-end 42953 :post-blank 1 :post-affiliated 35930 :mode section :granularity element :cached t :parent (headline ...) :org-element--cache-sync-key nil)) :org-element--cache-sync-key nil))"
The real element is: "(src-block (:language \"elisp\" :switches nil :parameters nil :begin 36477 :end 40217 :number-lines nil :preserve-indent nil :retain-labels t :use-labels t :label-fmt nil :value \"(use-package citar
:no-require
:custom
(org-cite-global-bibliography '(\\\"~/docs/references.bib\\\"))
(org-cite-insert-processor 'citar)
(org-cite-follow-processor 'citar)
(org-cite-activate-processor 'citar)
(citar-bibliography org-cite-global-bibliography)
;; optional: org-cite-insert is also bound to C-c C-x C-@
:bind
(:map org-mode-map :package org (\\\"C-c b\\\" . #'org-cite-insert)))
(use-package org-ref
:config
(setq
org-ref-completion-library 'org-ref-ivy-cite
;; org-ref-get-pdf-filename-function 'org-ref-get-pdf-filename-helm-bibtex
org-ref-default-bibliography '(\\\"~/docs/references.bib\\\")
org-ref-note-title-format \\\"* TODO %y - %t\\\\n :PROPERTIES:\\\\n :Custom_ID: %k\\\\n :NOTER_DOCUMENT: %F\\\\n :ROAM_KEY: cite:%k\\\\n :AUTHOR: %9a\\\\n :JOURNAL: %j\\\\n :YEAR: %y\\\\n :VOLUME: %v\\\\n :PAGES: %p\\\\n :DOI: %D\\\\n :URL: %U\\\\n :END:\\\\n\\\\n\\\"
org-ref-notes-directory \\\"~/docs/roam/\\\"
org-ref-notes-function 'orb-edit-notes
bibtex-align-at-equal-sign t ; prettier formatting
bibtex-dialect 'biblatex ; bibtex is apparently very old (1988), so use the new variant
;; tell org to output using bibtex
org-latex-pdf-process (list \\\"latexmk -shell-escape -bibtex -f -pdf %f\\\")
bibtex-user-optional-fields '((\\\"keywords\\\" \\\"Keywords to describe the entry\\\" \\\"\\\")
(\\\"file\\\" \\\"link to the document file\\\" \\\":\\\")
(\\\"url\\\" \\\"url of the thing\\\" \\\"\\\"))
bibtex-completion-bibliography '(\\\"~/docs/references.bib\\\")
bibtex-completion-library-path '(\\\"~/docs/pdfs_for_notes/\\\")
bibtex-completion-pdf-field \\\"file\\\"
;; Not sure about this yet..
bibtex-completion-notes-template-multiple-files
(concat
\\\"#+TITLE: ${title}\\\\n\\\"
\\\"#+ROAM_KEY: cite:${=key=}\\\\n\\\"
\\\"* TODO Notes\\\\n\\\"
\\\":PROPERTIES:\\\\n\\\"
\\\":Custom_ID: ${=key=}\\\\n\\\"
\\\":NOTER_DOCUMENT: %(orb-process-file-field \\\\\\\"${=key=}\\\\\\\")\\\\n\\\"
\\\":AUTHOR: ${author-abbrev}\\\\n\\\"
\\\":JOURNAL: ${journaltitle}\\\\n\\\"
\\\":DATE: ${date}\\\\n\\\"
\\\":YEAR: ${year}\\\\n\\\"
\\\":DOI: ${doi}\\\\n\\\"
\\\":URL: ${url}\\\\n\\\"
\\\":END:\\\\n\\\\n\\\"
)
)
)
(use-package citeproc)
(use-package bibtex
:config
(setq bibtex-autokey-year-length 4
bibtex-autokey-name-year-separator \\\"-\\\"
bibtex-autokey-year-title-separator \\\"-\\\"
bibtex-autokey-titleword-separator \\\"-\\\"
bibtex-autokey-titlewords 2
bibtex-autokey-titlewords-stretch 1
bibtex-autokey-titleword-length 5))
(use-package ivy-bibtex
:config
(autoload 'ivy-bibtex \\\"ivy-bibtex\\\" \\\"\\\" t)
;; ivy-bibtex requires ivy's `ivy--regex-ignore-order` regex builder, which
;; ignores the order of regexp tokens when searching for matching candidates.
;; Add something like this to your init file:
(setq ivy-re-builders-alist
'((ivy-bibtex . ivy--regex-ignore-order)
(t . ivy--regex-plus))))
;; most of this config taken from http://www.wouterspekkink.org/academia/writing/tool/doom-emacs/2021/02/27/writing-academic-papers-with-org-mode.html
(use-package org-roam-bibtex
:after org-roam
:hook org-roam-mode
:bind (:map org-mode-map (\\\"C-c n b\\\" . orb-note-actions)) ;; yes, really `orb`.
:config
(require 'org-ref)
(org-roam-bibtex-mode)
(setq orb-preformat-keywords '(\\\"citekey\\\" \\\"title\\\" \\\"url\\\" \\\"author-or-editor\\\" \\\"keywords\\\" \\\"file\\\")
orb-process-file-keyword t
orb-file-field-extensions '(pdf))
(setq orb-templates
'((\\\"r\\\" \\\"ref\\\" 'org-roam-capture--get-point \\\"\\\"
:file-name \\\"${citekey}\\\"
:head \\\"#+TITLE: ${citekey}: ${title}\\\\n#+ROAM_KEY: ${ref}
- tags ::
- keywords :: ${keywords}
* Notes
:PROPERTIES:
:Custom_ID: ${citekey}
:URL: ${url}
:AUTHOR: ${author-or-editor}
:NOTER_DOCUMENT: ${file}
:NOTER_PAGE:
:END:\\\")))
)
\" :post-blank 1 :post-affiliated 36477 :mode nil :granularity element :parent (section (:begin 35900 :end 42926 :contents-begin 35900 :contents-end 42925 :robust-begin 35900 :robust-end 42923 :post-blank 1 :post-affiliated 35900 :mode section :granularity element :parent (headline ...)))))"
Cache around :begin:
(paragraph (:begin 36316 :end 36507 :contents-begin 36316 :contents-end 36507 :post-blank 0 :post-affiliated 36316 :mode nil :granularity element :cached t :parent (section (:begin 35930 :end 42956 :contents-begin 35930 :contents-end 42955 :robust-begin 35930 :robust-end 42953 :post-blank 1 :post-affiliated 35930 :mode section :granularity element :cached t :parent (headline (:raw-value "Org & PDFs" :begin 35915 :end 42956 :pre-blank 0 :contents-begin 35930 :contents-end 42955 :robust-begin 35932 :robust-end 42953 :level 3 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 35915 :title "Org & PDFs" :mode nil :granularity element :cached t :parent (headline (:raw-value "Org-Mode" :begin 5655 :end 44062 :pre-blank 0 :contents-begin 5667 :contents-end 44060 :robust-begin 5669 :robust-end 44058 :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 2 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 5655 :title "Org-Mode" :mode section :granularity element :cached t :parent (headline (:raw-value "Writing" :begin 5645 :end 48198 :pre-blank 0 :contents-begin 5655 :contents-end 48197 :robust-begin 5657 :robust-end 48195 :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 5645 :title "Writing" :mode nil :granularity element :cached t :parent (org-data (:begin 1 :contents-begin 1 :contents-end 161525 :end 161525 :robust-begin 3 :robust-end 161523 :post-blank 0 :post-affiliated 1 :path "/Users/jabrahms/src/justin.abrah.ms/blog/_posts/dotfiles/emacs.org" :mode org-data :CATEGORY "emacs" :cached t :org-element--cache-sync-key nil)) :org-element--cache-sync-key nil)) :org-element--cache-sync-key nil)) :org-element--cache-sync-key nil)) :org-element--cache-sync-key nil)) :org-element--cache-sync-key nil))
(paragraph (:begin 36316 :end 36507 :contents-begin 36316 :contents-end 36507 :post-blank 0 :post-affiliated 36316 :mode nil :granularity element :cached t :parent (section (:begin 35930 :end 42956 :contents-begin 35930 :contents-end 42955 :robust-begin 35930 :robust-end 42953 :post-blank 1 :post-affiliated 35930 :mode section :granularity element :cached t :parent (headline (:raw-value "Org & PDFs" :begin 35915 :end 42956 :pre-blank 0 :contents-begin 35930 :contents-end 42955 :robust-begin 35932 :robust-end 42953 :level 3 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 35915 :title "Org & PDFs" :mode nil :granularity element :cached t :parent (headline (:raw-value "Org-Mode" :begin 5655 :end 44062 :pre-blank 0 :contents-begin 5667 :contents-end 44060 :robust-begin 5669 :robust-end 44058 :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 2 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 5655 :title "Org-Mode" :mode section :granularity element :cached t :parent (headline (:raw-value "Writing" :begin 5645 :end 48198 :pre-blank 0 :contents-begin 5655 :contents-end 48197 :robust-begin 5657 :robust-end 48195 :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 5645 :title "Writing" :mode nil :granularity element :cached t :parent (org-data (:begin 1 :contents-begin 1 :contents-end 161525 :end 161525 :robust-begin 3 :robust-end 161523 :post-blank 0 :post-affiliated 1 :path "/Users/jabrahms/src/justin.abrah.ms/blog/_posts/dotfiles/emacs.org" :mode org-data :CATEGORY "emacs" :cached t :org-element--cache-sync-key nil)) :org-element--cache-sync-key nil)) :org-element--cache-sync-key nil)) :org-element--cache-sync-key nil)) :org-element--cache-sync-key nil)) :org-element--cache-sync-key nil))
(src-block (:language "elisp" :switches nil :parameters nil :begin 36507 :end 40247 :number-lines nil :preserve-indent nil :retain-labels t :use-labels t :label-fmt nil :value "(use-package citar
:no-require
:custom
(org-cite-global-bibliography '(\"~/docs/references.bib\"))
(org-cite-insert-processor 'citar)
(org-cite-follow-processor 'citar)
(org-cite-activate-processor 'citar)
(citar-bibliography org-cite-global-bibliography)
;; optional: org-cite-insert is also bound to C-c C-x C-@
:bind
(:map org-mode-map :package org (\"C-c b\" . #'org-cite-insert)))
(use-package org-ref
:config
(setq
org-ref-completion-library 'org-ref-ivy-cite
;; org-ref-get-pdf-filename-function 'org-ref-get-pdf-filename-helm-bibtex
org-ref-default-bibliography '(\"~/docs/references.bib\")
org-ref-note-title-format \"* TODO %y - %t\\n :PROPERTIES:\\n :Custom_ID: %k\\n :NOTER_DOCUMENT: %F\\n :ROAM_KEY: cite:%k\\n :AUTHOR: %9a\\n :JOURNAL: %j\\n :YEAR: %y\\n :VOLUME: %v\\n :PAGES: %p\\n :DOI: %D\\n :URL: %U\\n :END:\\n\\n\"
org-ref-notes-directory \"~/docs/roam/\"
org-ref-notes-function 'orb-edit-notes
bibtex-align-at-equal-sign t ; prettier formatting
bibtex-dialect 'biblatex ; bibtex is apparently very old (1988), so use the new variant
;; tell org to output using bibtex
org-latex-pdf-process (list \"latexmk -shell-escape -bibtex -f -pdf %f\")
bibtex-user-optional-fields '((\"keywords\" \"Keywords to describe the entry\" \"\")
(\"file\" \"link to the document file\" \":\")
(\"url\" \"url of the thing\" \"\"))
bibtex-completion-bibliography '(\"~/docs/references.bib\")
bibtex-completion-library-path '(\"~/docs/pdfs_for_notes/\")
bibtex-completion-pdf-field \"file\"
;; Not sure about this yet..
bibtex-completion-notes-template-multiple-files
(concat
\"#+TITLE: ${title}\\n\"
\"#+ROAM_KEY: cite:${=key=}\\n\"
\"* TODO Notes\\n\"
\":PROPERTIES:\\n\"
\":Custom_ID: ${=key=}\\n\"
\":NOTER_DOCUMENT: %(orb-process-file-field \\\"${=key=}\\\")\\n\"
\":AUTHOR: ${author-abbrev}\\n\"
\":JOURNAL: ${journaltitle}\\n\"
\":DATE: ${date}\\n\"
\":YEAR: ${year}\\n\"
\":DOI: ${doi}\\n\"
\":URL: ${url}\\n\"
\":END:\\n\\n\"
)
)
)
(use-package citeproc)
(use-package bibtex
:config
(setq bibtex-autokey-year-length 4
bibtex-autokey-name-year-separator \"-\"
bibtex-autokey-year-title-separator \"-\"
bibtex-autokey-titleword-separator \"-\"
bibtex-autokey-titlewords 2
bibtex-autokey-titlewords-stretch 1
bibtex-autokey-titleword-length 5))
(use-package ivy-bibtex
:config
(autoload 'ivy-bibtex \"ivy-bibtex\" \"\" t)
;; ivy-bibtex requires ivy's `ivy--regex-ignore-order` regex builder, which
;; ignores the order of regexp tokens when searching for matching candidates.
;; Add something like this to your init file:
(setq ivy-re-builders-alist
'((ivy-bibtex . ivy--regex-ignore-order)
(t . ivy--regex-plus))))
;; most of this config taken from http://www.wouterspekkink.org/academia/writing/tool/doom-emacs/2021/02/27/writing-academic-papers-with-org-mode.html
(use-package org-roam-bibtex
:after org-roam
:hook org-roam-mode
:bind (:map org-mode-map (\"C-c n b\" . orb-note-actions)) ;; yes, really `orb`.
:config
(require 'org-ref)
(org-roam-bibtex-mode)
(setq orb-preformat-keywords '(\"citekey\" \"title\" \"url\" \"author-or-editor\" \"keywords\" \"file\")
orb-process-file-keyword t
orb-file-field-extensions '(pdf))
(setq orb-templates
'((\"r\" \"ref\" 'org-roam-capture--get-point \"\"
:file-name \"${citekey}\"
:head \"#+TITLE: ${citekey}: ${title}\\n#+ROAM_KEY: ${ref}
- tags ::
- keywords :: ${keywords}
* Notes
:PROPERTIES:
:Custom_ID: ${citekey}
:URL: ${url}
:AUTHOR: ${author-or-editor}
:NOTER_DOCUMENT: ${file}
:NOTER_PAGE:
:END:\")))
)
" :post-blank 1 :post-affiliated 36507 :mode nil :granularity element :cached t :parent (section (:begin 35930 :end 42956 :contents-begin 35930 :contents-end 42955 :robust-begin 35930 :robust-end 42953 :post-blank 1 :post-affiliated 35930 :mode section :granularity element :cached t :parent (headline (:raw-value "Org & PDFs" :begin 35915 :end 42956 :pre-blank 0 :contents-begin 35930 :contents-end 42955 :robust-begin 35932 :robust-end 42953 :level 3 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 35915 :title "Org & PDFs" :mode nil :granularity element :cached t :parent (headline (:raw-value "Org-Mode" :begin 5655 :end 44062 :pre-blank 0 :contents-begin 5667 :contents-end 44060 :robust-begin 5669 :robust-end 44058 :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 2 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 5655 :title "Org-Mode" :mode section :granularity element :cached t :parent (headline (:raw-value "Writing" :begin 5645 :end 48198 :pre-blank 0 :contents-begin 5655 :contents-end 48197 :robust-begin 5657 :robust-end 48195 :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 5645 :title "Writing" :mode nil :granularity element :cached t :parent (org-data (:begin 1 :contents-begin 1 :contents-end 161525 :end 161525 :robust-begin 3 :robust-end 161523 :post-blank 0 :post-affiliated 1 :path "/Users/jabrahms/src/justin.abrah.ms/blog/_posts/dotfiles/emacs.org" :mode org-data :CATEGORY "emacs" :cached t :org-element--cache-sync-key nil)) :org-element--cache-sync-key nil)) :org-element--cache-sync-key nil)) :org-element--cache-sync-key nil)) :org-element--cache-sync-key nil)) :org-element--cache-sync-key nil)) Disable showing Disable logging
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment