* lisp/org-macs.el (org-sort-function): New customization defining how
Org mode should sort headlines, table lines, agenda lines, etc.
(org-string<):
(org-string<=):
(org-string>=):
(org-string>): Use the new customization.
(org-string<>): Add docstring.
(org-sort-function-fallback): New helper function to help users on
MacOS where `string-collate-lessp' is not reliable.
* lisp/oc-basic.el (org-cite-basic--field-less-p):
* lisp/org-agenda.el (org-cmp-category):
(org-cmp-alpha):
* lisp/org-list.el (org-sort-list):
* lisp/org-mouse.el (org-mouse-list-options-menu):
* lisp/org-table.el (org-table-sort-lines):
* lisp/org.el (org-tags-sort-function):
(org-sort-entries):
* lisp/ox-publish.el (org-publish-sitemap): Honor the new
customization.
* lisp/org-mouse.el (org-mouse-tag-menu):
(org-mouse-popup-global-menu):
* lisp/org-agenda.el (org-cmp-tag): Honor `org-tags-sort-function' and
falling back to `org-string<' if note set.
* etc/ORG-NEWS (New option controlling how Org mode sorts things
~org-sort-function~): Announce the change.
This change aims to standardize the way Org mode performs sorting of
user data. In particular, it addresses issues with oddities of string
collation rules on MacOS and tricky language environments like
Turkish.
Link: https://orgmode.org/list/87jzleptcs.fsf@localhost
* lisp/oc-basic.el (org-cite-basic--print-bibtex-string): New function
approximately parsing Bibtex strings and dropping {...}.
(org-cite-basic--print-entry): Use the new function.
* testing/examples/Basic.bib:
*
testing/lisp/test-oc-basic.el (test-org-cite-basic/export-bibliography):
Add test.
Reported-by: Dominik Schrempf <dominik.schrempf@gmail.com>
Link: https://orgmode.org/list/CAF+0kSg8O3RQBG1wXoHjMEHwnGFz0gaDkTTSGv+ZaOt4d4myCA@mail.gmail.com
* lisp/oc-basic.el (org-cite-basic--shorten-names): Provide third
argument for `mapconcat'. It is mandatory in Emacs <29.
* lisp/org.el (org--image-yank-media-handler): Suppress warning and
throw and error in Emacs <29.
(org--dnd-rmc): Do not try to call `use-dialog-box-p' in Emacs <29.
* lisp/oc-basic.el (org-cite-basic-export-citation): Fix formatting
citation reference with brackets. When year is placed inside
brackets, put the reference suffix outside.
* lisp/oc-basic.el (org-cite-basic--get-field): Clarify that raw
string object may be returned.
(org-cite-basic--shorten-names): Clarify NAMES type. Allow NAMES to
be a raw string object.
(org-cite-basic--get-year):
(org-cite-basic--key-completion-table): Use a more clear RAW argument
value in the call to make it explicit that we request raw return value.
(org-cite-basic-export-citation): Allow AUTHOR to be raw string object.
* lisp/oc.el (org-cite-capitalize): New function to capitalize string
or raw string object.
Reported-by: William Denton <wtd@pobox.com>
Link: https://orgmode.org/list/alpine.DEB.2.22.394.2311230124110.19367@shell3.miskatonic.org
* lisp/oc-basic.el (org-cite-basic--parse-bibliography): Use
`file-truename' to follow symlinks first before checking bibliography
file change times.
Reported-by: Leo Butler <Leo.Butler@umanitoba.ca>
Link: https://orgmode.org/list/877cpmkds1.fsf@t14.reltub.ca
* doc/org-manual.org (Exporting): Add cindex entry for both "backend"
and "back-end" for better searchability.
All other changes are trivial.
Note that `org-element-export-snippet-parser' will still use :back-end
property. So will ox.el in INFO channel.
* lisp/oc-basic.el (org-cite-basic--format-author-year):
(org-cite-basic-export-citation): Display "????" for missing year and
"??" for missing other fields.
Reported-by: Ihor Radchenko <yantar92@posteo.net>
Link: https://orgmode.org/list/871qr6kiuv.fsf@localhost
* lisp/oc-basic.el (org-cite-basic--parse-json): Make sure
`org-cite-basic--parse-json' produces a string for the editors field.
The function `org-cite-basic--get-author' expects a string for both the
"authors" field and the "editors" field.
The conversion to string was only done for the "authors" field in
`org-cite-basic--parse-json'. This patch fixes the issue by applying the
transformation to both "authors" and "editors".
This points to a more general issue where `org-cite-basic--get-field' is
expected to return nil or a string, but calls
`org-cite-basic--get-entry' that may return an association list.
TINYCHANGE
* 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.
* 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'.
* 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.
* 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
* 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.
* 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
* 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
* 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.
* 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.
* 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