Merge branch 'bugfix' into emacs-sync

This commit is contained in:
Kyle Meyer 2021-11-27 16:19:56 -05:00
commit 85c2d3f021
13 changed files with 55 additions and 54 deletions

View File

@ -10811,6 +10811,18 @@ To turn off fontification for marked up text, you can set
~org-fontify-emphasized-text~ to ~nil~. To narrow down the list of
available markup syntax, you can customize ~org-emphasis-alist~.
Sometimes, when marked text also contains the marker character itself,
the result may be unsettling. For example,
#+begin_example
/One may expect this whole sentence to be italicized, but the
following ~user/?variable~ contains =/= character, which effectively
stops emphasis there./
#+end_example
You can use zero width space to help Org sorting out the ambiguity.
See [[*Escape Character]] for more details.
** Subscripts and Superscripts
:PROPERTIES:
:DESCRIPTION: Simple syntax for raising/lowering text.

View File

@ -283,7 +283,8 @@ Label is in match group 1.")
;;; Internal functions
(defun org-cite-csl--barf-without-citeproc ()
"Raise an error if Citeproc library is not loaded."
(unless (featurep 'citeproc) "Citeproc library is not loaded"))
(unless (featurep 'citeproc)
(error "Citeproc library is not loaded")))
(defun org-cite-csl--note-style-p (info)
"Non-nil when bibliography style implies wrapping citations in footnotes.

View File

@ -1141,17 +1141,14 @@ and must return either a string, an object, or a secondary string."
;;; Internal interface with fontification (activate capability)
(defun org-cite-fontify-default (datum)
"Fontify DATUM with `org-cite' and `org-cite-key' face.
DATUM is a citation object, or a citation reference. In any case, apply
`org-cite' face on the whole citation, and `org-cite-key' face on each key."
(let* ((cite (if (eq 'citation-reference (org-element-type datum))
(org-element-property :parent datum)
datum))
(beg (org-element-property :begin cite))
(end (org-with-point-at (org-element-property :end cite)
(skip-chars-backward " \t")
(point))))
(defun org-cite-fontify-default (cite)
"Fontify CITE with `org-cite' and `org-cite-key' faces.
CITE is a citation object. The function applies `org-cite' face
on the whole citation, and `org-cite-key' face on each key."
(let ((beg (org-element-property :begin cite))
(end (org-with-point-at (org-element-property :end cite)
(skip-chars-backward " \t")
(point))))
(add-text-properties beg end '(font-lock-multiline t))
(add-face-text-property beg end 'org-cite)
(dolist (reference (org-cite-get-references cite))
@ -1163,16 +1160,20 @@ DATUM is a citation object, or a citation reference. In any case, apply
"Activate citations from up to LIMIT buffer position.
Each citation encountered is activated using the appropriate function
from the processor set in `org-cite-activate-processor'."
(let ((name org-cite-activate-processor))
(let ((activate
(or (and name
(org-cite-processor-has-capability-p name 'activate)
(org-cite-processor-activate (org-cite--get-processor name)))
#'org-cite-fontify-default)))
(while (re-search-forward org-element-citation-prefix-re limit t)
(let ((cite (org-with-point-at (match-beginning 0)
(org-element-citation-parser))))
(when cite (save-excursion (funcall activate cite))))))))
(let* ((name org-cite-activate-processor)
(activate
(or (and name
(org-cite-processor-has-capability-p name 'activate)
(org-cite-processor-activate (org-cite--get-processor name)))
#'org-cite-fontify-default)))
(when (re-search-forward org-element-citation-prefix-re limit t)
(let ((cite (org-with-point-at (match-beginning 0)
(org-element-citation-parser))))
(when cite
(funcall activate cite)
;; Move after cite object and make sure to return
;; a non-nil value.
(goto-char (org-element-property :end cite)))))))
;;; Internal interface with Org Export library (export capability)

View File

@ -4436,7 +4436,7 @@ Optional argument NEW may specify text to replace the current field content."
(col (org-table-current-column)))
(when (> col 0)
(skip-chars-backward "^|")
(if (not (looking-at " *\\([^|\n]*?\\) *\\(|\\|$\\)"))
(if (not (looking-at " *\\(?:\\([^|\n]*?\\) *\\(|\\)\\|\\([^|\n]+?\\) *\\($\\)\\)"))
(setq org-table-may-need-update t)
(let* ((align (nth (1- col) org-table-last-alignment))
(width (nth (1- col) org-table-last-column-widths))

View File

@ -1048,6 +1048,7 @@ BACKEND is a structure with `org-export-backend' type."
(unless (org-export-backend-p backend)
(error "Unknown \"%s\" back-end: Aborting export" backend)))
;;;###autoload
(defun org-export-derived-backend-p (backend &rest backends)
"Non-nil if BACKEND is derived from one of BACKENDS.
BACKEND is an export back-end, as returned by, e.g.,
@ -1858,6 +1859,7 @@ INFO is a plist containing export directives."
(let ((transcoder (cdr (assq type (plist-get info :translate-alist)))))
(and (functionp transcoder) transcoder)))))
;;;###autoload
(defun org-export-data (data info)
"Convert DATA into current back-end format.
@ -4586,6 +4588,7 @@ objects of the same type."
;; `org-export-raw-string' builds a pseudo-object out of a string
;; that any export back-end returns as-is.
;;;###autoload
(defun org-export-raw-string (s)
"Return a raw object containing string S.
A raw string is exported as-is, with no additional processing

View File

@ -183,4 +183,5 @@
("Friday" "friday"))
(org-babel-execute-src-block))))))
(provide 'test-ob-C)
;;; test-ob-C.el ends here

View File

@ -46,3 +46,6 @@
(org-test-at-id "9e998b2a-3581-43fe-b26d-07d3c507b86a"
(org-babel-next-src-block 4)
(should (equal '(("a" "b" "c")) (org-babel-execute-src-block)))))
(provide 'test-ob-awk)
;;; test-ob-awk.el ends here

View File

@ -58,5 +58,5 @@
(buffer-string)))))))
(provide 'test-ob-sed)
;;; test-ob-sed ends here

View File

@ -1178,30 +1178,6 @@ echo \"test\"
(should (re-search-forward "=\"x\"=" nil t))
(forward-line))))
(ert-deftest test-ob/commented-last-block-line-with-var ()
(org-test-with-temp-text-in-file "
#+begin_src emacs-lisp :var a=1
;;
#+end_src"
(org-babel-next-src-block)
(org-babel-execute-maybe)
(re-search-forward "\\#\\+results:" nil t)
(forward-line)
(should (string=
""
(buffer-substring-no-properties (point-at-bol) (point-at-eol)))))
(org-test-with-temp-text-in-file "
#+begin_src emacs-lisp :var a=2
2;;
#+end_src"
(org-babel-next-src-block)
(org-babel-execute-maybe)
(re-search-forward "\\#\\+results:" nil t)
(forward-line)
(should (string=
": 2"
(buffer-substring-no-properties (point-at-bol) (point-at-eol))))))
(defun test-ob-verify-result-and-removed-result (result buffer-text)
"Test helper function to test `org-babel-remove-result'.
A temp buffer is populated with BUFFER-TEXT, the first block is executed,

View File

@ -1,4 +1,4 @@
;;; test-org-annex-attach.el --- Tests for Org Attach with git-annex
;;; test-org-attach-git.el --- Tests for Org Attach with git-annex
;;
;; Copyright (c) 2016, 2019 Erik Hetzner
;; Authors: Erik Hetzner
@ -92,4 +92,5 @@
(should (string-equal "hello world\n" (buffer-string))))
(should (eq called 'was-called)))))))
;;; test-org-attach-annex.el ends here
(provide 'test-org-attach-git)
;;; test-org-attach-git.el ends here

View File

@ -7417,7 +7417,7 @@ CLOCK: [2012-03-29 Thu 10:00]--[2012-03-29 Thu 16:40] => 6:40"
(should
(string-match-p
(rx "* TODO Read book
SCHEDULED: <2021-06-16 Wed +1d>
SCHEDULED: <2021-06-16 " (1+ (not space)) " +1d>
:PROPERTIES:
:LAST_REPEAT:" (1+ nonl) "
:END:

View File

@ -45,6 +45,5 @@
(org-babel-next-src-block 3)
(should (= 6 (org-babel-execute-src-block)))))
(provide 'test-ob-R)
(provide 'test-property-inheritance)
;;; test-property-inheritance.el ends here

View File

@ -373,7 +373,11 @@ setting `pp-escape-newlines' to nil manually."
(condition-case err
(when (string-match "^[A-Za-z].*\\.el$"
(file-name-nondirectory path))
(load-file path))
(let ((feature-name
(intern
(file-name-base
(file-name-nondirectory path)))))
(require feature-name path)))
(missing-test-dependency
(let ((name (intern
(concat "org-missing-dependency/"