diff options
| author | Kyle Meyer | 2021-10-09 16:34:12 -0400 |
|---|---|---|
| committer | Kyle Meyer | 2021-10-09 16:34:12 -0400 |
| commit | bcce93f04c2df6a5bb5dd1a8e611de734d24aee7 (patch) | |
| tree | 865257be3566fbd714bb6e8ee4778c9dc70657e8 | |
| parent | 5d408f1a24fd6e0fe0ea4acd6c02887332de1494 (diff) | |
| download | emacs-bcce93f04c2df6a5bb5dd1a8e611de734d24aee7.tar.gz emacs-bcce93f04c2df6a5bb5dd1a8e611de734d24aee7.zip | |
Update to Org 9.5-46-gb71474
| -rw-r--r-- | doc/misc/org.org | 71 | ||||
| -rw-r--r-- | lisp/org/oc-biblatex.el | 13 | ||||
| -rw-r--r-- | lisp/org/oc.el | 52 | ||||
| -rw-r--r-- | lisp/org/ol-man.el | 86 | ||||
| -rw-r--r-- | lisp/org/org-footnote.el | 5 | ||||
| -rw-r--r-- | lisp/org/org-lint.el | 2 | ||||
| -rw-r--r-- | lisp/org/org-version.el | 2 | ||||
| -rw-r--r-- | lisp/org/org.el | 2 |
8 files changed, 168 insertions, 65 deletions
diff --git a/doc/misc/org.org b/doc/misc/org.org index 7b1277c7a2e..5977f091610 100644 --- a/doc/misc/org.org +++ b/doc/misc/org.org | |||
| @@ -1355,9 +1355,8 @@ you, configure the option ~org-table-auto-blank-field~. | |||
| 1355 | Re-align the table, move to the next field. Creates a new row if | 1355 | Re-align the table, move to the next field. Creates a new row if |
| 1356 | necessary. | 1356 | necessary. |
| 1357 | 1357 | ||
| 1358 | - {{{kbd(C-c SPC)}}} (~org-table-blank-field~) :: | 1358 | - {{{kbd(M-x org-table-blank-field)}}} :: |
| 1359 | 1359 | ||
| 1360 | #+kindex: C-c SPC | ||
| 1361 | #+findex: org-table-blank-field | 1360 | #+findex: org-table-blank-field |
| 1362 | Blank the field at point. | 1361 | Blank the field at point. |
| 1363 | 1362 | ||
| @@ -16517,16 +16516,16 @@ keywords. | |||
| 16517 | :END: | 16516 | :END: |
| 16518 | #+cindex: citation | 16517 | #+cindex: citation |
| 16519 | 16518 | ||
| 16520 | As of Org 9.5, a new library =oc.el= provides tooling to handle | 16519 | The =oc.el= library provides tooling to handle citations in Org via |
| 16521 | citations in Org via "citation processors" that offer some or all of | 16520 | "citation processors" that offer some or all of the following |
| 16522 | the following capabilities: | 16521 | capabilities: |
| 16523 | 16522 | ||
| 16524 | - "activate" :: Fontification, tooltip preview, etc. | 16523 | - activate :: Fontification, tooltip preview, etc. |
| 16525 | - "follow" :: At-point actions on citations via ~org-open-at-point~. | 16524 | - follow :: At-point actions on citations via ~org-open-at-point~. |
| 16526 | - "insert" :: Add and edit citations via ~org-cite-insert~. | 16525 | - insert :: Add and edit citations via ~org-cite-insert~. |
| 16527 | - "export" :: Via different libraries for different target formats. | 16526 | - export :: Via different libraries for different target formats. |
| 16528 | 16527 | ||
| 16529 | The user can configure these with ~org-cite-active-processor~, | 16528 | The user can configure these with ~org-cite-activate-processor~, |
| 16530 | ~org-cite-follow-processor~, ~org-cite-insert-processor~, and | 16529 | ~org-cite-follow-processor~, ~org-cite-insert-processor~, and |
| 16531 | ~org-cite-export-processors~ respectively. | 16530 | ~org-cite-export-processors~ respectively. |
| 16532 | 16531 | ||
| @@ -16544,8 +16543,10 @@ more "bibliography" keywords. | |||
| 16544 | #+bibliography: "/some/file/with spaces/in its name.bib" | 16543 | #+bibliography: "/some/file/with spaces/in its name.bib" |
| 16545 | #+end_example | 16544 | #+end_example |
| 16546 | 16545 | ||
| 16546 | #+kindex: C-c C-x @ | ||
| 16547 | #+findex: org-cite-insert | ||
| 16547 | One can then insert and edit citations using ~org-cite-insert~, called | 16548 | One can then insert and edit citations using ~org-cite-insert~, called |
| 16548 | with {{{kbd(M-x org-cite-insert)}}}. | 16549 | with {{{kbd(C-c C-x @)}}}. |
| 16549 | 16550 | ||
| 16550 | A /citation/ requires one or more citation /key(s)/, elements | 16551 | A /citation/ requires one or more citation /key(s)/, elements |
| 16551 | identifying a reference in the bibliography. | 16552 | identifying a reference in the bibliography. |
| @@ -16554,9 +16555,10 @@ identifying a reference in the bibliography. | |||
| 16554 | 16555 | ||
| 16555 | - Each key starts with the character =@=. | 16556 | - Each key starts with the character =@=. |
| 16556 | 16557 | ||
| 16557 | - Each key can be qualified by a /prefix/ (e.g. "see ") and/or a | 16558 | - Each key can be qualified by a /prefix/ (e.g.\nbsp{}"see ") and/or |
| 16558 | /suffix/ (e.g. "p. 123"), giving informations useful or necessary fo | 16559 | a /suffix/ (e.g.\nbsp{}"p.\nbsp{}123"), giving informations useful or necessary |
| 16559 | the comprehension of the citation but not included in the reference. | 16560 | fo the comprehension of the citation but not included in the |
| 16561 | reference. | ||
| 16560 | 16562 | ||
| 16561 | - A single citation can cite more than one reference ; the keys are | 16563 | - A single citation can cite more than one reference ; the keys are |
| 16562 | separated by semicolons ; the formatting of such citation groups is | 16564 | separated by semicolons ; the formatting of such citation groups is |
| @@ -16564,11 +16566,9 @@ identifying a reference in the bibliography. | |||
| 16564 | 16566 | ||
| 16565 | - One can also specify a stylistic variation for the citations by | 16567 | - One can also specify a stylistic variation for the citations by |
| 16566 | inserting a =/= and a style name between the =cite= keyword and the | 16568 | inserting a =/= and a style name between the =cite= keyword and the |
| 16567 | colon ; this usially makes sense only for the author-year styles. | 16569 | colon; this usually makes sense only for the author-year styles. |
| 16568 | 16570 | ||
| 16569 | #+begin_example | 16571 | : [cite/style:common prefix ;prefix @key suffix; ... ; common suffix] |
| 16570 | [cite/style:common prefix ;prefix @key suffix; ... ; common suffix] | ||
| 16571 | #+end_example | ||
| 16572 | 16572 | ||
| 16573 | The only mandatory elements are: | 16573 | The only mandatory elements are: |
| 16574 | 16574 | ||
| @@ -16583,7 +16583,7 @@ Org currently includes the following export processors: | |||
| 16583 | - Two processors can export to a variety of formats, including =latex= | 16583 | - Two processors can export to a variety of formats, including =latex= |
| 16584 | (and therefore =pdf=), =html=, =odt= and plain (UTF8) text: | 16584 | (and therefore =pdf=), =html=, =odt= and plain (UTF8) text: |
| 16585 | 16585 | ||
| 16586 | - basic :: a basic export processors, well adapted to situations | 16586 | - basic :: a basic export processor, well adapted to situations |
| 16587 | where backward compatibility is not a requirement and formatting | 16587 | where backward compatibility is not a requirement and formatting |
| 16588 | needs are minimal; | 16588 | needs are minimal; |
| 16589 | 16589 | ||
| @@ -16593,45 +16593,42 @@ Org currently includes the following export processors: | |||
| 16593 | - In contrast, two other processors target LaTeX and LaTeX-derived | 16593 | - In contrast, two other processors target LaTeX and LaTeX-derived |
| 16594 | formats exclusively: | 16594 | formats exclusively: |
| 16595 | 16595 | ||
| 16596 | - natbib :: this export processor uses =bibtex=, the historical | 16596 | - natbib :: this export processor uses BibTeX, the historical |
| 16597 | bibliographic processor used with LaTeX, thus allowing the use of | 16597 | bibliographic processor used with LaTeX, thus allowing the use of |
| 16598 | data and style files compatible with this processor (including a | 16598 | data and style files compatible with this processor (including |
| 16599 | large number of publishers' styles). It uses citation commands | 16599 | a large number of publishers' styles). It uses citation commands |
| 16600 | implemented in the LaTeX package =natbib=, allowing more stylistic | 16600 | implemented in the LaTeX package =natbib=, allowing more stylistic |
| 16601 | variants that LaTeX's =\cite= command. | 16601 | variants that LaTeX's =\cite= command. |
| 16602 | 16602 | ||
| 16603 | - biblatex :: this backend allows the use of data and formats | 16603 | - biblatex :: this backend allows the use of data and formats |
| 16604 | prepared for =biblatex=, an alternate bibliographic processor used | 16604 | prepared for BibLaTeX, an alternate bibliographic processor used |
| 16605 | with LaTeX, which overcomes some serious =bibtex= limitations, but | 16605 | with LaTeX, which overcomes some serious BibTeX limitations, but |
| 16606 | has not (yet?) been widely adopted by publishers. | 16606 | has not (yet?)\nbsp{}been widely adopted by publishers. |
| 16607 | 16607 | ||
| 16608 | The =#+cite_export:= keyword specifies the export processor and the | 16608 | The =CITE_EXPORT= keyword specifies the export processor and the |
| 16609 | citation (and possibly reference) style(s); for example (all arguments | 16609 | citation (and possibly reference) style(s); for example (all arguments |
| 16610 | are optional) | 16610 | are optional) |
| 16611 | 16611 | ||
| 16612 | #+begin_example | 16612 | : #+cite_export: basic author author-year |
| 16613 | #+cite_export: basic author author-year | ||
| 16614 | #+end_example | ||
| 16615 | 16613 | ||
| 16614 | #+texinfo: @noindent | ||
| 16616 | specifies the "basic" export processor with citations inserted as | 16615 | specifies the "basic" export processor with citations inserted as |
| 16617 | author's name and references indexed by author's names and year; | 16616 | author's name and references indexed by author's names and year; |
| 16618 | 16617 | ||
| 16619 | #+begin_example | 16618 | : #+cite_export: csl /some/path/to/vancouver-brackets.csl |
| 16620 | #+cite_export: csl /some/path/to/vancouver-brackets.csl | ||
| 16621 | #+end_example | ||
| 16622 | 16619 | ||
| 16620 | #+texinfo: @noindent | ||
| 16623 | specifies the "csl" processor and CSL style, which in this case | 16621 | specifies the "csl" processor and CSL style, which in this case |
| 16624 | defines numeric citations and numeric references according to the | 16622 | defines numeric citations and numeric references according to the |
| 16625 | =Vancouver= specification (as style used in many medical journals), | 16623 | =Vancouver= specification (as style used in many medical journals), |
| 16626 | following a typesetting variation putting citations between brackets; | 16624 | following a typesetting variation putting citations between brackets; |
| 16627 | 16625 | ||
| 16628 | #+begin_example | 16626 | : #+cite_export: natbib kluwer |
| 16629 | #+cite_export: natbib kluwer | ||
| 16630 | #+end_example | ||
| 16631 | 16627 | ||
| 16632 | specifies the "natbib" export processor with a label citation style | 16628 | #+texinfo: @noindent |
| 16629 | specifies the =natbib= export processor with a label citation style | ||
| 16633 | conformant to the Harvard style and the specification of the | 16630 | conformant to the Harvard style and the specification of the |
| 16634 | Wolkers-Kluwer publisher; since it relies on the =bibtex= processor of | 16631 | Wolkers-Kluwer publisher; since it relies on the ~bibtex~ processor of |
| 16635 | your LaTeX installation, it won't export to anything but PDF. | 16632 | your LaTeX installation, it won't export to anything but PDF. |
| 16636 | 16633 | ||
| 16637 | * Working with Source Code | 16634 | * Working with Source Code |
diff --git a/lisp/org/oc-biblatex.el b/lisp/org/oc-biblatex.el index f517e391398..daf56e792a6 100644 --- a/lisp/org/oc-biblatex.el +++ b/lisp/org/oc-biblatex.el | |||
| @@ -165,15 +165,11 @@ INFO is the export state, as a property list." | |||
| 165 | (org-cite-biblatex--atomic-arguments (list r) info)) | 165 | (org-cite-biblatex--atomic-arguments (list r) info)) |
| 166 | (org-cite-get-references citation) | 166 | (org-cite-get-references citation) |
| 167 | "") | 167 | "") |
| 168 | ;; According to biblatex manual, left braces or brackets | 168 | ;; According to BibLaTeX manual, left braces or brackets |
| 169 | ;; following a multicite command could be parsed as other | 169 | ;; following a multicite command could be parsed as other |
| 170 | ;; arguments. So we look ahead and insert a \relax if | 170 | ;; arguments. So we stop any further parsing by inserting |
| 171 | ;; needed. | 171 | ;; a \relax unconditionally. |
| 172 | (and (let ((next (org-export-get-next-element citation info))) | 172 | "\\relax"))) |
| 173 | (and next | ||
| 174 | (string-match (rx string-start (or "{" "[")) | ||
| 175 | (org-export-data next info)))) | ||
| 176 | "\\relax")))) | ||
| 177 | 173 | ||
| 178 | (defun org-cite-biblatex--command (citation info base &optional multi no-opt) | 174 | (defun org-cite-biblatex--command (citation info base &optional multi no-opt) |
| 179 | "Return biblatex command using BASE name for CITATION object. | 175 | "Return biblatex command using BASE name for CITATION object. |
| @@ -314,6 +310,7 @@ to the document, and set styles." | |||
| 314 | '((("author" "a") ("caps" "c") ("full" "f") ("caps-full" "cf")) | 310 | '((("author" "a") ("caps" "c") ("full" "f") ("caps-full" "cf")) |
| 315 | (("locators" "l") ("bare" "b") ("caps" "c") ("bare-caps" "bc")) | 311 | (("locators" "l") ("bare" "b") ("caps" "c") ("bare-caps" "bc")) |
| 316 | (("noauthor" "na")) | 312 | (("noauthor" "na")) |
| 313 | (("nocite" "n")) | ||
| 317 | (("text" "t") ("caps" "c")) | 314 | (("text" "t") ("caps" "c")) |
| 318 | (("nil") ("bare" "b") ("caps" "c") ("bare-caps" "bc")))) | 315 | (("nil") ("bare" "b") ("caps" "c") ("bare-caps" "bc")))) |
| 319 | 316 | ||
diff --git a/lisp/org/oc.el b/lisp/org/oc.el index bbf2195fbd8..2f741768f88 100644 --- a/lisp/org/oc.el +++ b/lisp/org/oc.el | |||
| @@ -89,7 +89,6 @@ | |||
| 89 | (declare-function org-element-type "org-element" (element)) | 89 | (declare-function org-element-type "org-element" (element)) |
| 90 | 90 | ||
| 91 | (declare-function org-export-derived-backend-p "org-export" (backend &rest backends)) | 91 | (declare-function org-export-derived-backend-p "org-export" (backend &rest backends)) |
| 92 | (declare-function org-export-get-footnote-definition "org-export" (footnote-reference info)) | ||
| 93 | (declare-function org-export-get-next-element "org-export" (blob info &optional n)) | 92 | (declare-function org-export-get-next-element "org-export" (blob info &optional n)) |
| 94 | (declare-function org-export-get-previous-element "org-export" (blob info &optional n)) | 93 | (declare-function org-export-get-previous-element "org-export" (blob info &optional n)) |
| 95 | (declare-function org-export-raw-string "org-export" (s)) | 94 | (declare-function org-export-raw-string "org-export" (s)) |
| @@ -152,10 +151,10 @@ triplet following the pattern | |||
| 152 | (NAME BIBLIOGRAPHY-STYLE CITATION-STYLE) | 151 | (NAME BIBLIOGRAPHY-STYLE CITATION-STYLE) |
| 153 | 152 | ||
| 154 | There, NAME is the name of a registered citation processor providing export | 153 | There, NAME is the name of a registered citation processor providing export |
| 155 | functionality, as a symbol. BIBLIOGRAPHY-STYLE (resp. CITATION-STYLE) is the | 154 | functionality, as a symbol. BIBLIOGRAPHY-STYLE (respectively CITATION-STYLE) |
| 156 | desired default style to use when printing a bibliography (resp. exporting a | 155 | is the desired default style to use when printing a bibliography (respectively |
| 157 | citation), as a string or nil. Both BIBLIOGRAPHY-STYLE and CITATION-STYLE are | 156 | exporting a citation), as a string or nil. Both BIBLIOGRAPHY-STYLE and |
| 158 | optional. NAME is mandatory. | 157 | CITATION-STYLE are optional. NAME is mandatory. |
| 159 | 158 | ||
| 160 | The export process selects the citation processor associated to the current | 159 | The export process selects the citation processor associated to the current |
| 161 | export back-end, or the most specific back-end the current one is derived from, | 160 | export back-end, or the most specific back-end the current one is derived from, |
| @@ -502,8 +501,8 @@ This function assumes S precedes CITATION." | |||
| 502 | 501 | ||
| 503 | (defun org-cite--move-punct-before (punct citation s info) | 502 | (defun org-cite--move-punct-before (punct citation s info) |
| 504 | "Move punctuation PUNCT before CITATION object. | 503 | "Move punctuation PUNCT before CITATION object. |
| 505 | String S contains PUNCT. The function assumes S follows CITATION. | 504 | String S contains PUNCT. INFO is the export state, as a property list. |
| 506 | Parse tree is modified by side-effect." | 505 | The function assumes S follows CITATION. Parse tree is modified by side-effect." |
| 507 | (if (equal s punct) | 506 | (if (equal s punct) |
| 508 | (org-element-extract-element s) ;it would be empty anyway | 507 | (org-element-extract-element s) ;it would be empty anyway |
| 509 | (org-element-set-element s (substring s (length punct)))) | 508 | (org-element-set-element s (substring s (length punct)))) |
| @@ -799,9 +798,20 @@ INFO is the export communication channel, as a property list." | |||
| 799 | ;; Do not force entering inline definitions, since | 798 | ;; Do not force entering inline definitions, since |
| 800 | ;; `org-element-map' is going to enter it anyway. | 799 | ;; `org-element-map' is going to enter it anyway. |
| 801 | ((guard (eq 'inline (org-element-property :type datum)))) | 800 | ((guard (eq 'inline (org-element-property :type datum)))) |
| 801 | ;; Find definition for current standard | ||
| 802 | ;; footnote reference. Unlike to | ||
| 803 | ;; `org-export-get-footnote-definition', do | ||
| 804 | ;; not cache results as they would contain | ||
| 805 | ;; un-processed citation objects. | ||
| 802 | (_ | 806 | (_ |
| 803 | (funcall search-cites | 807 | (let ((label (org-element-property :label datum))) |
| 804 | (org-export-get-footnote-definition datum info))))) | 808 | (funcall |
| 809 | search-cites | ||
| 810 | (org-element-map data 'footnote-definition | ||
| 811 | (lambda (d) | ||
| 812 | (and | ||
| 813 | (equal label (org-element-property :label d)) | ||
| 814 | (or (org-element-contents d) ""))))))))) | ||
| 805 | info nil 'footnote-definition t)))) | 815 | info nil 'footnote-definition t)))) |
| 806 | (funcall search-cites (plist-get info :parse-tree)) | 816 | (funcall search-cites (plist-get info :parse-tree)) |
| 807 | (let ((result (nreverse cites))) | 817 | (let ((result (nreverse cites))) |
| @@ -877,13 +887,16 @@ modified by side-effect." | |||
| 877 | 887 | ||
| 878 | INFO is the export state, as a property list. | 888 | INFO is the export state, as a property list. |
| 879 | 889 | ||
| 890 | Optional argument RULE is the punctuation rule used, as a triplet. When nil, | ||
| 891 | rule is determined according to `org-cite-note-rules', which see. | ||
| 892 | |||
| 880 | Optional argument PUNCT is a list of punctuation marks to be considered. | 893 | Optional argument PUNCT is a list of punctuation marks to be considered. |
| 881 | When nil, it defaults to `org-cite-punctuation-marks'. | 894 | When nil, it defaults to `org-cite-punctuation-marks'. |
| 882 | 895 | ||
| 883 | Parse tree is modified by side-effect. | 896 | Parse tree is modified by side-effect. |
| 884 | 897 | ||
| 885 | Note: when calling both `org-cite-adjust-note' and `org-cite-wrap-citation' on | 898 | Note: when calling both `org-cite-adjust-note' and `org-cite-wrap-citation' on |
| 886 | the same object, call `org-cite-adjust-punctuation' first." | 899 | the same object, call `org-cite-adjust-note' first." |
| 887 | (when org-cite-adjust-note-numbers | 900 | (when org-cite-adjust-note-numbers |
| 888 | (pcase-let* ((rule (or rule (org-cite--get-note-rule info))) | 901 | (pcase-let* ((rule (or rule (org-cite--get-note-rule info))) |
| 889 | (punct-re (regexp-opt (or punct org-cite-punctuation-marks))) | 902 | (punct-re (regexp-opt (or punct org-cite-punctuation-marks))) |
| @@ -1274,11 +1287,13 @@ by side-effect." | |||
| 1274 | ;; Before removing the citation, transfer its `:post-blank' | 1287 | ;; Before removing the citation, transfer its `:post-blank' |
| 1275 | ;; property to the object before, if any. | 1288 | ;; property to the object before, if any. |
| 1276 | (org-cite--set-previous-post-blank cite blanks info) | 1289 | (org-cite--set-previous-post-blank cite blanks info) |
| 1277 | ;; We want to be sure any non-note citation is preceded by | 1290 | ;; Make sure there is a space between a quotation mark and |
| 1278 | ;; a space. This is particularly important when using | 1291 | ;; a citation. This is particularly important when using |
| 1279 | ;; `adaptive' note rule. See `org-cite-note-rules'. | 1292 | ;; `adaptive' note rule. See `org-cite-note-rules'. |
| 1280 | (unless (org-cite-inside-footnote-p cite t) | 1293 | (let ((previous (org-export-get-previous-element cite info))) |
| 1281 | (org-cite--set-previous-post-blank cite 1 info)) | 1294 | (when (and (org-string-nw-p previous) |
| 1295 | (string-suffix-p "\"" previous)) | ||
| 1296 | (org-cite--set-previous-post-blank cite 1 info))) | ||
| 1282 | (pcase replacement | 1297 | (pcase replacement |
| 1283 | ;; String. | 1298 | ;; String. |
| 1284 | ((pred stringp) | 1299 | ((pred stringp) |
| @@ -1384,7 +1399,8 @@ ARG is the prefix argument received when calling `org-open-at-point', or nil." | |||
| 1384 | 1399 | ||
| 1385 | ;;; Meta-command for citation insertion (insert capability) | 1400 | ;;; Meta-command for citation insertion (insert capability) |
| 1386 | (defun org-cite--allowed-p (context) | 1401 | (defun org-cite--allowed-p (context) |
| 1387 | "Non-nil when a citation can be inserted at point." | 1402 | "Non-nil when a citation can be inserted at point. |
| 1403 | CONTEXT is the element or object at point, as returned by `org-element-context'." | ||
| 1388 | (let ((type (org-element-type context))) | 1404 | (let ((type (org-element-type context))) |
| 1389 | (cond | 1405 | (cond |
| 1390 | ;; No citation in attributes, except in parsed ones. | 1406 | ;; No citation in attributes, except in parsed ones. |
| @@ -1430,7 +1446,11 @@ ARG is the prefix argument received when calling `org-open-at-point', or nil." | |||
| 1430 | (skip-chars-backward " \r\t\n") | 1446 | (skip-chars-backward " \r\t\n") |
| 1431 | (if (eq (org-element-class context) 'object) (point) | 1447 | (if (eq (org-element-class context) 'object) (point) |
| 1432 | (line-beginning-position 2))))) | 1448 | (line-beginning-position 2))))) |
| 1433 | ;; At the start of a list item is fine, as long as the bullet is unaffected. | 1449 | ;; At the beginning of a footnote definition, right after the |
| 1450 | ;; label, is OK. | ||
| 1451 | ((eq type 'footnote-definition) (looking-at (rx space))) | ||
| 1452 | ;; At the start of a list item is fine, as long as the bullet is | ||
| 1453 | ;; unaffected. | ||
| 1434 | ((eq type 'item) | 1454 | ((eq type 'item) |
| 1435 | (> (point) (+ (org-element-property :begin context) | 1455 | (> (point) (+ (org-element-property :begin context) |
| 1436 | (current-indentation) | 1456 | (current-indentation) |
diff --git a/lisp/org/ol-man.el b/lisp/org/ol-man.el new file mode 100644 index 00000000000..0d9ac7c8c71 --- /dev/null +++ b/lisp/org/ol-man.el | |||
| @@ -0,0 +1,86 @@ | |||
| 1 | ;;; ol-man.el --- Links to man pages -*- lexical-binding: t; -*- | ||
| 2 | ;; | ||
| 3 | ;; Copyright (C) 2020-2021 Free Software Foundation, Inc. | ||
| 4 | ;; Author: Carsten Dominik <carsten.dominik@gmail.com> | ||
| 5 | ;; Maintainer: Bastien Guerry <bzg@gnu.org> | ||
| 6 | ;; Keywords: outlines, hypermedia, calendar, wp | ||
| 7 | ;; Homepage: https://orgmode.org | ||
| 8 | ;; | ||
| 9 | ;; This file is part of GNU Emacs. | ||
| 10 | ;; | ||
| 11 | ;; This program is free software; you can redistribute it and/or modify | ||
| 12 | ;; it under the terms of the GNU General Public License as published by | ||
| 13 | ;; the Free Software Foundation; either version 3, or (at your option) | ||
| 14 | ;; any later version. | ||
| 15 | |||
| 16 | ;; This program is distributed in the hope that it will be useful, | ||
| 17 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 18 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 19 | ;; GNU General Public License for more details. | ||
| 20 | |||
| 21 | ;; You should have received a copy of the GNU General Public License | ||
| 22 | ;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. | ||
| 23 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
| 24 | ;; | ||
| 25 | ;;; Commentary: | ||
| 26 | |||
| 27 | (require 'ol) | ||
| 28 | |||
| 29 | (org-link-set-parameters "man" | ||
| 30 | :follow #'org-man-open | ||
| 31 | :export #'org-man-export | ||
| 32 | :store #'org-man-store-link) | ||
| 33 | |||
| 34 | (defcustom org-man-command 'man | ||
| 35 | "The Emacs command to be used to display a man page." | ||
| 36 | :group 'org-link | ||
| 37 | :type '(choice (const man) (const woman))) | ||
| 38 | |||
| 39 | (defun org-man-open (path _) | ||
| 40 | "Visit the manpage on PATH. | ||
| 41 | PATH should be a topic that can be thrown at the man command. | ||
| 42 | If PATH contains extra ::STRING which will use `occur' to search | ||
| 43 | matched strings in man buffer." | ||
| 44 | (string-match "\\(.*?\\)\\(?:::\\(.*\\)\\)?$" path) | ||
| 45 | (let* ((command (match-string 1 path)) | ||
| 46 | (search (match-string 2 path))) | ||
| 47 | (funcall org-man-command command) | ||
| 48 | (when search | ||
| 49 | (with-current-buffer (concat "*Man " command "*") | ||
| 50 | (goto-char (point-min)) | ||
| 51 | (search-forward search))))) | ||
| 52 | |||
| 53 | (defun org-man-store-link () | ||
| 54 | "Store a link to a README file." | ||
| 55 | (when (memq major-mode '(Man-mode woman-mode)) | ||
| 56 | ;; This is a man page, we do make this link | ||
| 57 | (let* ((page (org-man-get-page-name)) | ||
| 58 | (link (concat "man:" page)) | ||
| 59 | (description (format "Manpage for %s" page))) | ||
| 60 | (org-link-store-props | ||
| 61 | :type "man" | ||
| 62 | :link link | ||
| 63 | :description description)))) | ||
| 64 | |||
| 65 | (defun org-man-get-page-name () | ||
| 66 | "Extract the page name from the buffer name." | ||
| 67 | ;; This works for both `Man-mode' and `woman-mode'. | ||
| 68 | (if (string-match " \\(\\S-+\\)\\*" (buffer-name)) | ||
| 69 | (match-string 1 (buffer-name)) | ||
| 70 | (error "Cannot create link to this man page"))) | ||
| 71 | |||
| 72 | (defun org-man-export (link description format) | ||
| 73 | "Export a man page link from Org files." | ||
| 74 | (let ((path (format "http://man.he.net/?topic=%s§ion=all" link)) | ||
| 75 | (desc (or description link))) | ||
| 76 | (cond | ||
| 77 | ((eq format 'html) (format "<a target=\"_blank\" href=\"%s\">%s</a>" path desc)) | ||
| 78 | ((eq format 'latex) (format "\\href{%s}{%s}" path desc)) | ||
| 79 | ((eq format 'texinfo) (format "@uref{%s,%s}" path desc)) | ||
| 80 | ((eq format 'ascii) (format "%s (%s)" desc path)) | ||
| 81 | ((eq format 'md) (format "[%s](%s)" desc path)) | ||
| 82 | (t path)))) | ||
| 83 | |||
| 84 | (provide 'ol-man) | ||
| 85 | |||
| 86 | ;;; ol-man.el ends here | ||
diff --git a/lisp/org/org-footnote.el b/lisp/org/org-footnote.el index c8c4dae8003..fcc7579bad5 100644 --- a/lisp/org/org-footnote.el +++ b/lisp/org/org-footnote.el | |||
| @@ -281,7 +281,10 @@ otherwise." | |||
| 281 | (save-excursion (goto-char (org-element-property :end context)) | 281 | (save-excursion (goto-char (org-element-property :end context)) |
| 282 | (skip-chars-backward " \r\t\n") | 282 | (skip-chars-backward " \r\t\n") |
| 283 | (if (eq (org-element-class context) 'object) (point) | 283 | (if (eq (org-element-class context) 'object) (point) |
| 284 | (1+ (line-beginning-position 2)))))) | 284 | (line-beginning-position 2))))) |
| 285 | ;; At the beginning of a footnote definition, right after the | ||
| 286 | ;; label, is OK. | ||
| 287 | ((eq type 'footnote-definition) (looking-at (rx space))) | ||
| 285 | ;; Other elements are invalid. | 288 | ;; Other elements are invalid. |
| 286 | ((eq (org-element-class context) 'element) nil) | 289 | ((eq (org-element-class context) 'element) nil) |
| 287 | ;; Just before object is fine. | 290 | ;; Just before object is fine. |
diff --git a/lisp/org/org-lint.el b/lisp/org/org-lint.el index 5c64c5a5c94..da5e6ae7995 100644 --- a/lisp/org/org-lint.el +++ b/lisp/org/org-lint.el | |||
| @@ -350,7 +350,7 @@ called with one argument, the key used for comparison." | |||
| 350 | (lambda (datum name) | 350 | (lambda (datum name) |
| 351 | (goto-char (org-element-property :begin datum)) | 351 | (goto-char (org-element-property :begin datum)) |
| 352 | (re-search-forward | 352 | (re-search-forward |
| 353 | (format "^[ \t]*#\\+[A-Za-z]+: +%s *$" (regexp-quote name))) | 353 | (format "^[ \t]*#\\+[A-Za-z]+:[ \t]*%s[ \t]*$" (regexp-quote name))) |
| 354 | (match-beginning 0)) | 354 | (match-beginning 0)) |
| 355 | (lambda (key) (format "Duplicate NAME \"%s\"" key)))) | 355 | (lambda (key) (format "Duplicate NAME \"%s\"" key)))) |
| 356 | 356 | ||
diff --git a/lisp/org/org-version.el b/lisp/org/org-version.el index 5bccbe497cc..9948008774d 100644 --- a/lisp/org/org-version.el +++ b/lisp/org/org-version.el | |||
| @@ -11,7 +11,7 @@ Inserted by installing Org mode or when a release is made." | |||
| 11 | (defun org-git-version () | 11 | (defun org-git-version () |
| 12 | "The Git version of Org mode. | 12 | "The Git version of Org mode. |
| 13 | Inserted by installing Org or when a release is made." | 13 | Inserted by installing Org or when a release is made." |
| 14 | (let ((org-git-version "release_9.5-30-g10dc9d")) | 14 | (let ((org-git-version "release_9.5-46-gb71474")) |
| 15 | org-git-version)) | 15 | org-git-version)) |
| 16 | 16 | ||
| 17 | (provide 'org-version) | 17 | (provide 'org-version) |
diff --git a/lisp/org/org.el b/lisp/org/org.el index bc0ea24bee7..c2a37e6cdd1 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el | |||
| @@ -15362,7 +15362,7 @@ The value is a list, with zero or more of the symbols `effort', `appt', | |||
| 15362 | "Save all Org buffers without user confirmation." | 15362 | "Save all Org buffers without user confirmation." |
| 15363 | (interactive) | 15363 | (interactive) |
| 15364 | (message "Saving all Org buffers...") | 15364 | (message "Saving all Org buffers...") |
| 15365 | (save-some-buffers t (lambda () (derived-mode-p 'org-mode))) | 15365 | (save-some-buffers t (lambda () (and (derived-mode-p 'org-mode) t))) |
| 15366 | (when (featurep 'org-id) (org-id-locations-save)) | 15366 | (when (featurep 'org-id) (org-id-locations-save)) |
| 15367 | (message "Saving all Org buffers... done")) | 15367 | (message "Saving all Org buffers... done")) |
| 15368 | 15368 | ||