aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/oc-basic.el (follow)
Commit message (Collapse)AuthorAgeFilesLines
* org-cite-basic-export-bibliography: Skip missing bibliography keysIhor Radchenko2022-11-061-9/+11
| | | | | | * lisp/oc-basic.el (org-cite-basic-export-bibliography): Ignore citation keys that are not present in bibliography. Previously, an error was thrown.
* Fix compiler warningsIhor Radchenko2022-09-201-6/+9
| | | | | | | | | * lisp/oc-basic.el (org-cite-basic--set-keymap): Do not use `buffer-substring' generalized variable. It is obsolete in Emacs 29. Explicitly call `delete-region' + `insert'. * lisp/org-agenda.el (org-element-lineage): Declare function. * lisp/org.el (org--align-node-property): Use `delete-region' instead of `buffer-substring' generalized variable.
* Fix Emacs 29 compiler warningsIhor Radchenko2022-09-061-2/+2
| | | | | | | | | | | | | | | | | | | | * lisp/oc-basic.el (org-cite-basic--parse-bibliography): Do not use obsolete `buffer-file-name' generalized variable. Prefer `set-visited-file-name'. * lisp/ol-bibtex.el (org-indent-region): Declare function. (org-bibtex-import-from-file): Remove unused variable. * lisp/ol.el (org-link--decode-compound): Use `ash' instead of obsolete `lsh'. * lisp/org-macs.el: Do no use obsolete generalized variable `buffer-string'. * lisp/org-plot.el (org-plot/redisplay-img-in-buffer): * lisp/org.el (image-flush): (org-display-inline-images): Use `image-flush' instead of obsolete `image-refresh'. * lisp/ox.el (org-export-to-file): Quote ' in the docstring. All other changes are changing obsolete `point-at-bol' and `point-at-eol' to `line-beginning-position' and `line-end-position'.
* Assert all the Org files to load the same Org versionIhor Radchenko2022-09-041-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/org-compat.el (org-assert-version): New macro comparing Org version at compile time and laod time. Add `org-assert-version' call to all files: * lisp/org-macs.el: * lisp/org-crypt.el: * lisp/org-ctags.el: * lisp/org-cycle.el: * lisp/org-datetree.el: * lisp/org-duration.el: * lisp/org-element.el (avl-tree): * lisp/org-entities.el: * lisp/org-faces.el: * lisp/org-feed.el: * lisp/org-fold-core.el: * lisp/org-fold.el: * lisp/org-footnote.el: * lisp/org-goto.el: * lisp/org-habit.el: * lisp/org-id.el: * lisp/org-indent.el: * lisp/org-inlinetask.el: * lisp/org-keys.el: * lisp/org-lint.el: * lisp/org-list.el: * lisp/org-macro.el: * lisp/org-mobile.el: * lisp/org-mouse.el: * lisp/org-num.el: * lisp/org-pcomplete.el: * lisp/org-persist.el: * lisp/org-plot.el: * lisp/org-protocol.el: * lisp/org-refile.el: * lisp/org-src.el: * lisp/org-table.el: * lisp/org-tempo.el: * lisp/org-timer.el: * lisp/org.el: * lisp/ox-ascii.el: * lisp/ox-beamer.el: * lisp/ox-html.el: * lisp/ox-icalendar.el: * lisp/ox-koma-letter.el: * lisp/ox-latex.el: * lisp/ox-man.el: * lisp/ox-md.el: * lisp/ox-odt.el: * lisp/ox-org.el: * lisp/ox-publish.el: * lisp/ox-texinfo.el: * lisp/ox.el:
* Merge branch 'bugfix'Ihor Radchenko2022-07-241-0/+1
|\
| * Fix compiler warningsIhor Radchenko2022-07-241-0/+1
| | | | | | | | * lisp/oc-basic.el (org-open-file): Declare function.
* | oc-basic: Parse @string entries in BiBTeX bibliographiesIhor Radchenko2022-07-171-1/+5
| | | | | | | | | | | | | | * lisp/oc-basic.el (org-cite-basic--parse-bibtex): Expand string abbreviations in the .bib bibliography files. Fixes https://list.orgmode.org/orgmode/25288.4658.491916.790389@gargle.gargle.HOWL/
* | oc-basic: Detect malformed bibtex bibliographiesIhor Radchenko2022-07-091-14/+23
| | | | | | | | | | | | | | | | * lisp/oc-basic.el (org-cite-basic--parse-bibtex): Validate the bibliography before parsing. Display list of issues if any (via `bibtex-validate`). (org-cite-basic--parse-bibliography): Set buffer file name needed by `bibtex-validate`. Empty the cache in case of error.
* | Merge branch 'bugfix'Ihor Radchenko2022-06-231-1/+8
|\ \ | |/
| * oc-basic.el: Stringify year from CSL-JSON date-partsDavid Lukes2022-06-231-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/oc-basic.el (org-cite-basic--parse-json): Make sure year extracted from date-parts is returned as string. Raise error if original type other than number or string. The stringifiation is motivated by errors like the following on Emacs 28 with nativecomp: Error during redisplay: (jit-lock-function 544) signaled (wrong-type-argument "Argument is not a string or a secondary string: 2007") Additionally, the type check will warn users about problems in their CSL-JSON bibliographies. Fixes https://list.orgmode.org/875ykv4k2q.fsf@localhost/T/#t TINYCHANGE
* | Escape single left quotes in docstringsRobert Pluim2022-06-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/ob-core.el (org-babel-default-header-args): * lisp/ob-julia.el (org-babel-julia-evaluate-external-process): (org-babel-julia-evaluate-session): * lisp/ob-lua.el (org-babel-lua-read-string): * lisp/ob-table.el (org-sbe): * lisp/oc-basic.el (org-cite-basic--shorten-names): * lisp/org-agenda.el (org-agenda-sorting-strategy): (org-agenda--mark-blocked-entry): (org-agenda-set-restriction-lock): * lisp/org-fold-core.el (org-fold-core--specs): (org-fold-core-remove-folding-spec): (org-fold-core-get-folding-spec): (org-fold-core--isearch-overlays): * lisp/org-plot.el (org--plot/prime-factors): * lisp/org-table.el (org-table-collapse-header): * lisp/org.el (org-special-ctrl-o): (org-latex-to-html-convert-command): * lisp/ox-html.el (org-html--unlabel-latex-environment): * lisp/ox-publish.el (org-publish-find-property): Use \\=' when there's a need for a single left quote in a docstring. The emacs-29 byte compiler complains about such usage.
* | Merge branch 'bugfix'Ihor Radchenko2022-04-161-15/+27
|\ \ | |/
| * org-cite-basic--key-completion-table: Reuse bibliography for speedIhor Radchenko2022-04-161-13/+18
| | | | | | | | | | | | | | * lisp/oc-basic.el (org-cite-basic--key-completion-table): Supply the pre-calculated bibliography entries when getting entry fields. This avoids excessive file change checks inside `org-cite-basic--parse-bibliography'.
| * oc-basic: Speed up cached bibliography retrivalIhor Radchenko2022-04-161-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/oc-basic.el (org-cite-basic--file-id-cache): New variable storing hash of bibliography file contents. (org-cite-basic--parse-bibliography): Skip buffer hash calculation when bibliography file is unchanged on disk. Calculating buffer hash on every call is slow when bibliography file is large. * lisp/org-compat.el: (org-file-has-changed-p--hash-table, org-file-has-changed-p): Define `file-has-changed-p' from Emacs 29 if necessary. See https://list.orgmode.org/LO2P265MB1758E12E04832DC712F5A8E9DC149@LO2P265MB1758.GBRP265.PROD.OUTLOOK.COM/T/#t
* | Merge branch 'bugfix'Nicolas Goaziou2022-02-261-6/+14
|\ \ | |/
| * oc-basic: Better handling of CSL-JSON datesDavid Lukes2022-02-261-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/oc-basic.el (org-cite-basic--parse-json): Make date-parsing and year extraction more resilient. Provide more informative errors when it fails. A string-based date is not only indicated by the key 'raw, but also possibly by the key 'literal. String-based dates come in various formats, not necessarily yyyy-mm-dd. So extracting the first sequence of 4 digits is arguably a better heuristic for getting the publication year than splitting the string on - and getting the car of that. On error, include `value' in the message, which contains the original value with actionable information, whereas the previously included `date' is always nil in that case. TINYCHANGE
* | oc-basic: Fix `org-cite-basic--get-author'.Nicolas Goaziou2022-02-161-8/+7
| | | | | | | | | | | | * lisp/oc-basic.el (org-cite-basic--get-author): Allow optional RAW argument. (org-cite-basic--get-year): (org-cite-basic--key-completion-table): Make use of new argument.
* | oc-basic: Fallback to editor when author is not availableNicolas Goaziou2022-02-131-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | * lisp/oc-basic.el (org-cite-basic--get-author): New function. (org-cite-basic--get-year): (org-cite-basic--print-entry): (org-cite-basic--format-author-year): (org-cite-basic-export-citation): (org-cite-basic--key-completion-table): Use new function. Suggested-by: psychosis <psychosis@disroot.org> <http://lists.gnu.org/r/emacs-orgmode/2022-02/msg00006.html>
* | Merge branch 'bugfix'Kyle Meyer2022-01-011-1/+1
|\ \ | |/
| * Update copyright year to 2022Kyle Meyer2022-01-011-1/+1
| |
* | Merge branch 'bugfix'Nicolas Goaziou2021-12-071-11/+21
|\ \ | |/
| * oc-basic: Fix completion cacheNicolas Goaziou2021-12-071-7/+16
| | | | | | | | | | | | * lisp/oc-basic.el (org-cite-basic--key-completion-table): Cache completions per document. Return nil when no completion is available so insertion mechanism can properly report the problem.
| * oc-basic: Clarify prompt during key completionNicolas Goaziou2021-12-071-4/+5
| | | | | | | | | | * lisp/oc-basic.el (org-cite-basic--complete-key): Clarify prompt during completion. Format docstring.
* | oc-basic: Add function to shorten namesBruce D'Arcus2021-11-201-1/+16
| | | | | | | | | | | | | | | | * lisp/oc-basic.el (org-cite-basic--shorten-names): new function to shorten author names * lisp/oc-basic.el (org-cite-basic--print-entry): shorten author name list for the "plain" output style
* | Merge branch 'bugfix'Nicolas Goaziou2021-11-031-9/+1
|\ \ | |/
| * oc-basic: Use `org-cite-main-affixes' when appropriateNicolas Goaziou2021-11-031-9/+1
| | | | | | | | | | * lisp/oc-basic.el (org-cite-basic-export-citation): Use `org-cite-main-affixes' when appropriate.
* | Merge branch 'bugfix'Nicolas Goaziou2021-11-031-16/+32
|\ \ | |/
| * oc-basic: Also extract year from "date" fieldNicolas Goaziou2021-11-031-16/+32
| | | | | | | | | | | | | | | | | | * lisp/oc-basic.el (org-cite-basic--get-year): Try extracting year from "date" field when "year" field is empty. Add optional argument to prevent disambiguation mechanism. (org-cite-basic--print-entry): (org-cite-basic--key-completion-table): Use `org-cite-basic--get-year' instead of `org-cite-basic--get-field'.
* | Merge branch 'bugfix'Nicolas Goaziou2021-10-151-1/+0
|\ \ | |/
| * oc-basic: Load unconditionallyNicolas Goaziou2021-10-151-1/+0
| | | | | | | | | | oc-basic is used for opening links and for fontifying them out of the box.
* | Prune Emacs 25.1 compatibility kludgesKyle Meyer2021-10-041-1/+1
|/ | | | | | | | | | | | | | | | | | * lisp/oc-basic.el (org-cite-basic--field-less-p): * lisp/ol-eww.el (org-eww-store-link): * lisp/org-agenda.el (org-agenda-check-clock-gap): * lisp/org-clock.el (org-clock-get-clocked-time) (org-clock-resolve-clock, org-clock-resolve) (org-resolve-clocks, (org-resolve-clocks-if-idle) (org-clock-in, org-clock-sum): Drop now unnecessary use of compatibility functions. * lisp/org-compat.el (org-string-collate-lessp, org-decode-time) (org-format-time-string, org-link-escape-browser, org-time-add) (org-time-subtract, org-time-since, org-time-less-p): Mark as obsolete. The 9.5 release declared Emacs 25.1 as the minimum version.
* Backport commit f9111d878 from EmacsGlenn Morris2021-10-021-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/oc-basic.el (org-cite-basic-sorting-field) (org-cite-basic-author-year-separator) (org-cite-basic-max-key-distance) (org-cite-basic-author-column-end) (org-cite-basic-column-separator) (org-cite-basic-mouse-over-key-face): * lisp/oc-biblatex.el (org-cite-biblatex-options): * lisp/oc-csl.el (org-cite-csl-link-cites) (org-cite-csl-html-hanging-indent) (org-cite-csl-html-label-width-per-char) (org-cite-csl-latex-hanging-indent): * lisp/oc.el (org-cite-adjust-note-numbers): * lisp/org-keys.el (org-return-follows-link): * lisp/org.el (org-fontify-todo-headline): * lisp/ox-html.el (org-html-equation-reference-format) (org-html-wrap-src-lines): * lisp/ox-latex.el (org-latex-reference-command) (org-latex-default-quote-environment): Fix :safe property. The safe-local-variable property is a function (bug#50944) f9111d8784bf12263abbe127cdfcbe5f409c9b3b Glenn Morris Sat Oct 2 10:37:42 2021 -0700
* Backport commit d50597189 from EmacsGlenn Morris2021-10-011-3/+5
| | | | | | | ; Standardize some license headers d505971894d83e04e8d206be1dcee1cee5e8bb93 Glenn Morris Fri Oct 1 18:07:45 2021 -0700
* Various minor docfixes found by checkdocStefan Kangas2021-09-161-2/+2
|
* oc: Call select-style function with a citation argumentNicolas Goaziou2021-08-111-1/+1
| | | | | | | | | * lisp/oc.el (org-cite--keys-to-citation): New function. (org-cite-make-insert-processor): Use new function. Change signature of SELECT-STYLE. Reported-by: "Bruce D'Arcus" <bdarcus@gmail.com> <http://lists.gnu.org/r/emacs-orgmode/2021-07/msg00638.html>
* Remove spurious `provide'Nicolas Goaziou2021-08-111-1/+0
| | | | Provide only features matching file names.
* oc-basic: Pacify byte-compilatorNicolas Goaziou2021-08-111-1/+1
| | | | | * lisp/oc-basic.el (org-cite-basic--parse-bibliography): Use `org-buffer-hash' instead of `buffer-hash' since Org supports Emacs 25.1.
* oc: Add missing `require'Max Nikulin2021-08-111-0/+3
| | | | | * lisp/oc.el: * lisp/oc-basic.el: Add some `require' to avoid compile warnings.
* oc: rx compatibility with Emacs < 27.1Max Nikulin2021-08-111-1/+3
| | | | | | | | | | | * lisp/oc.el (org-cite-adjust-note): * lisp/oc-basic.el (org-cite-basic-goto): * lisp/oc-biblatex.el (org-cite-biblatex-prepare-preamble): * lisp/oc-csl.el (org-cite-csl--label-regexp): Avoid `rx' forms introduced in Emacs-27.1 to keep compatibility with older versions. Use `rx-to-string' instead of `rx' due to lack of support of `regexp' and `literal' forms with a variable as an argument.
* Revert "oc: Remove spurious `provide'"Nicolas Goaziou2021-08-011-0/+1
| | | | This reverts commit ad006e29305b4dd7af340631806c83d4d9ca2ab7.
* oc: Remove spurious `provide'Nicolas Goaziou2021-08-011-1/+0
| | | | | | | | * lisp/oc-basic.el: * lisp/oc-biblatex.el (biblatex): * lisp/oc-csl.el: * lisp/oc-natbib.el: * lisp/oc.el: Provide only the full library name.
* oc-basic: Improve <mouse-1> handling on citation keysNicolas Goaziou2021-07-301-22/+33
| | | | | | * lisp/oc-basic.el (org-cite-basic--set-keymap): New function. (org-cite-basic--make-repair-keymap): Remove function. (org-cite-basic-activate): Use new function.
* oc-basic: Fix `org-cite-basic-goto'Nicolas Goaziou2021-07-301-6/+9
| | | | | * lisp/oc-basic.el (org-cite-basic-goto): Set BibTeX dialect before calling `bibtex-search-entry'.
* oc-basic: Implement `basic' citation processorNicolas Goaziou2021-07-091-0/+752
* lisp/oc-basic.el: New file.