Merge branch 'bugfix' into emacs-sync

This commit is contained in:
Kyle Meyer 2022-07-24 16:23:55 -04:00
commit 80a23fdd1f
21 changed files with 73 additions and 50 deletions

View File

@ -2866,12 +2866,12 @@ For more information and examples see the [[https://orgmode.org/worg/org-tutoria
- transpose ::
When =y=, =yes=, or =t= attempt to transpose the table data before
plotting. Also recognises the shorthand option =trans=.
plotting. Also recognizes the shorthand option =trans=.
- =type= ::
Specify the type of the plot, by default one of =2d=, =3d=, =radar=, or =grid=.
Available types can be customised with ~org-plot/preset-plot-types~.
Available types can be customized with ~org-plot/preset-plot-types~.
- =with= ::

View File

@ -293,7 +293,7 @@ with width equal to the pixel-width of the buffer text multiplied by 0.7.
This functionality is implemented in a new function,
~org-display-inline-image--width~ which contains the width
determination logic previously in ~org-display-inline-images~ and the
new behaviour.
new behavior.
** New options
*** Option ~org-hidden-keywords~ now also applies to #+SUBTITLE:
@ -311,7 +311,7 @@ descriptions.
*** New option ~org-id-ts-format~
Earlier, IDs generated using =ts= method had a hard-coded format (i.e. =20200923T160237.891616=).
The new option allows user to customise the format.
The new option allows user to customize the format.
Defaults are unchanged.
*** New argument for ~file-desc~ babel header
@ -503,16 +503,16 @@ heading, except return nil.
*** Faces of all the heading text elements now conform to the headline face
In the past, faces of todo keywords, emphasised text, tags, and
In the past, faces of todo keywords, emphasized text, tags, and
priority cookies inherited =default= face. The resulting headline
fontification was not always consistent, as discussed in [[msg::87h7sawubl.fsf@protesilaos.com][this bug
report]]. Now, the relevant faces adapt to face used to fontify the
current headline level.
Users who prefer to keep the old behaviour should change their face
customisation explicitly stating that =default= face is inherited.
Users who prefer to keep the old behavior should change their face
customization explicitly stating that =default= face is inherited.
Example of old face customisation:
Example of old face customization:
#+begin_src emacs-lisp
(setq org-todo-keyword-faces '(("TODO"
@ -520,7 +520,7 @@ Example of old face customisation:
:height 0.75)))
#+end_src
To preserve the old behaviour the above customisation should be
To preserve the old behavior the above customization should be
changed to
#+begin_src emacs-lisp
@ -543,7 +543,7 @@ The function does not allow for a third optional parameter anymore.
*** LaTeX environment =#+results= are now removed
If a babel src block produces a raw LaTeX environment, it will now be
recognised as a result, and so replaced when re-evaluated.
recognized as a result, and so replaced when re-evaluated.
*** Tag completion now uses =completing-read-multiple=
@ -681,7 +681,7 @@ enabled, and point is neither in a table nor on a timestamp or a link:
- =C-j= (bound to the new command ~org-return-and-maybe-indent~)
merely inserts a newline.
To get the previous behaviour back, disable ~electric-indent-mode~
To get the previous behavior back, disable ~electric-indent-mode~
explicitly:
#+begin_src emacs-lisp
@ -1029,7 +1029,7 @@ Previously all session names had ~org-babel-session-~ prepended.
*** Forward/backward paragraph functions in line with the rest of Emacs
~org-forward-paragraph~ and ~org-backward-paragraph~, bound to
~<C-UP>~ and ~<C-DOWN>~ functions mimic more closely behaviour of
~<C-UP>~ and ~<C-DOWN>~ functions mimic more closely behavior of
~forward-paragraph~ and ~backward-paragraph~ functions when
available.

View File

@ -480,7 +480,7 @@ value. The value can either be a string or a closure that
evaluates to a string. The closure is evaluated when the source
block is being evaluated (e.g. during execution or export), with
point at the source block. It is not possible to use an
arbitrary function symbol (e.g. 'some-func), since org uses
arbitrary function symbol (e.g. `some-func'), since org uses
lexical binding. To achieve the same functionality, call the
function within a closure (e.g. (lambda () (some-func))).

View File

@ -250,8 +250,8 @@ end")
(defun org-babel-julia-evaluate-external-process
(body result-type result-params column-names-p)
"Evaluate BODY in external julia process.
If RESULT-TYPE equals 'output then return standard output as a
string. If RESULT-TYPE equals 'value then return the value of the
If RESULT-TYPE equals `output' then return standard output as a
string. If RESULT-TYPE equals `value' then return the value of the
last statement in BODY, as elisp."
(cl-case result-type
(value
@ -274,8 +274,8 @@ last statement in BODY, as elisp."
(defun org-babel-julia-evaluate-session
(session body result-type result-params column-names-p)
"Evaluate BODY in SESSION.
If RESULT-TYPE equals 'output then return standard output as a
string. If RESULT-TYPE equals 'value then return the value of the
If RESULT-TYPE equals `output' then return standard output as a
string. If RESULT-TYPE equals `value' then return the value of the
last statement in BODY, as elisp."
(cl-case result-type
(value

View File

@ -395,7 +395,7 @@ fd:close()"
(org-babel-lua-table-or-string results)))))
(defun org-babel-lua-read-string (string)
"Strip 's from around Lua string."
"Strip \\=' characters from around Lua string."
(org-unbracket-string "'" "'" string))
(provide 'ob-lua)

View File

@ -84,7 +84,7 @@ is the equivalent of the following source code block:
#+end_src
NOTE: The quotation marks around the function name,
'source-block', are optional.
`source-block', are optional.
NOTE: By default, string variable names are interpreted as
references to source-code blocks, to force interpretation of a

View File

@ -581,7 +581,10 @@ which enable the original code blocks to be found."
(error "Not in tangled code"))
(setq body (buffer-substring body-start end)))
;; Go to the beginning of the relative block in Org file.
(org-link-open-from-string link)
;; Explicitly allow fuzzy search even if user customized
;; otherwise.
(let (org-link-search-must-match-exact-headline)
(org-link-open-from-string link))
(setq target-buffer (current-buffer))
(if (string-match "[^ \t\n\r]:\\([[:digit:]]+\\)" block-name)
(let ((n (string-to-number (match-string 1 block-name))))

View File

@ -73,6 +73,7 @@
(require 'seq)
(declare-function org-open-at-point "org" (&optional arg))
(declare-function org-open-file "org" (path &optional in-emacs line search))
(declare-function org-element-interpret-data "org-element" (data))
(declare-function org-element-property "org-element" (property element))

View File

@ -937,7 +937,7 @@ characters that should be escaped."
(defun org-link-decode (s)
"Decode percent-encoded parts in string S.
E.g. \"%C3%B6\" becomes the german o-Umlaut."
E.g. \"%C3%B6\" becomes the German o-Umlaut."
(replace-regexp-in-string "\\(%[0-9A-Za-z]\\{2\\}\\)+"
#'org-link--decode-compound s t t))

View File

@ -1615,7 +1615,7 @@ alpha-down Sort headlines alphabetically, reversed.
The different possibilities will be tried in sequence, and testing stops
if one comparison returns a \"not-equal\". For example, the default
'(time-up category-keep priority-down)
`(time-up category-keep priority-down)'
means: Pull out all entries having a specified time of day and sort them,
in order to make a time schedule for the current day the first thing in the
agenda listing for the day. Of the entries without a time indication, keep
@ -4124,7 +4124,7 @@ dimming them." ;FIXME: The arg isn't used, actually!
If the header at `org-hd-marker' is blocked according to
`org-entry-blocked-p', then if `org-agenda-dim-blocked-tasks' is
'invisible and the header is not blocked by checkboxes, set the
`invisible' and the header is not blocked by checkboxes, set the
text property `org-todo-blocked' to `invisible', otherwise set it
to t."
(when (get-text-property 0 'todo-state entry)
@ -7399,7 +7399,7 @@ Argument ARG is the prefix argument."
When in a restricted subtree, remove it.
The restriction will span over the entire file if TYPE is `file',
or if type is '(4), or if the cursor is before the first headline
or if type is \\='(4), or if the cursor is before the first headline
in the file. Otherwise, only apply the restriction to the current
subtree."
(interactive "P")

View File

@ -113,6 +113,11 @@ the symbol of the calling function, for example."
;;; Emacs < 27.1 compatibility
(if (version< emacs-version "27.1")
(defsubst org-replace-buffer-contents (source &optional _max-secs _max-costs)
(replace-buffer-contents source))
(defalias 'org-replace-buffer-contents #'replace-buffer-contents))
(unless (fboundp 'proper-list-p)
;; `proper-list-p' was added in Emacs 27.1. The function below is
;; taken from Emacs subr.el 200195e824b^.

View File

@ -280,7 +280,7 @@ When NORMALISE is non-nil, the count is divided by the number of values."
collect (cons n (/ (length m) normaliser)))))
(defun org--plot/prime-factors (value)
"Return the prime decomposition of VALUE, e.g. for 12, '(3 2 2)."
"Return the prime decomposition of VALUE, e.g. for 12, \\='(3 2 2)."
(let ((factors '(1)) (i 1))
(while (/= 1 value)
(setq i (1+ i))
@ -682,9 +682,10 @@ line directly before or after the table."
(looking-at "[[:space:]]*#\\+"))
(setf params (org-plot/collect-options params))))
;; Dump table to datafile
(if-let ((dump-func (plist-get type :data-dump)))
(funcall dump-func table data-file num-cols params)
(org-plot/gnuplot-to-data table data-file params))
(let ((dump-func (plist-get type :data-dump)))
(if dump-func
(funcall dump-func table data-file num-cols params)
(org-plot/gnuplot-to-data table data-file params)))
;; Check type of ind column (timestamp? text?)
(when (plist-get params :check-ind-type)
(let* ((ind (1- (plist-get params :ind)))

View File

@ -1235,7 +1235,7 @@ Throw an error if there is no such buffer."
(insert (with-current-buffer write-back-buf (buffer-string))))
(save-restriction
(narrow-to-region beg end)
(replace-buffer-contents write-back-buf 0.1 nil)
(org-replace-buffer-contents write-back-buf 0.1 nil)
(goto-char (point-max))))
(when (and expecting-bol (not (bolp))) (insert "\n")))
(kill-buffer write-back-buf)
@ -1283,7 +1283,7 @@ Throw an error if there is no such buffer."
(buffer-string))))
(save-restriction
(narrow-to-region beg end)
(replace-buffer-contents write-back-buf 0.1 nil)
(org-replace-buffer-contents write-back-buf 0.1 nil)
(goto-char (point-max))))
(when (and expecting-bol (not (bolp))) (insert "\n")))))
(when write-back-buf (kill-buffer write-back-buf))

View File

@ -5465,7 +5465,7 @@ The table is taken from the parameter TXT, or from the buffer at point."
(nreverse table)))))
(defun org-table-collapse-header (table &optional separator max-header-lines)
"Collapse the lines before 'hline into a single header.
"Collapse the lines before `hline' into a single header.
The given TABLE is a list of lists as returned by `org-table-to-lisp'.
The leading lines before the first `hline' symbol are considered

View File

@ -1694,7 +1694,7 @@ OK to kill that hidden subtree. When nil, kill without remorse."
(const :tag "Never kill a hidden subtree with C-k" error)))
(defcustom org-special-ctrl-o t
"Non-nil means, make `C-o' insert a row in tables."
"Non-nil means, make `open-line' (\\[open-line]) insert a row in tables."
:group 'org-edit-structure
:type 'boolean)
@ -3301,7 +3301,7 @@ Replace format-specifiers in the command as noted below and use
%i: The LaTeX fragment to be converted.
For example, this could be used with LaTeXML as
\"latexmlc 'literal:%i' --profile=math --preload=siunitx.sty 2>/dev/null\"."
\"latexmlc \\='literal:%i\\=' --profile=math --preload=siunitx.sty 2>/dev/null\"."
:group 'org-latex
:package-version '(Org . "9.4")
:type '(choice

View File

@ -948,12 +948,18 @@ channel."
(when description
(let ((dest (if (equal type "fuzzy")
(org-export-resolve-fuzzy-link link info)
(org-export-resolve-id-link link info))))
(concat
(org-ascii--fill-string
(format "[%s] %s" anchor (org-ascii--describe-datum dest info))
width info)
"\n\n"))))
;; Ignore broken links. On broken link,
;; `org-export-resolve-id-link' will throw an
;; error and we will return nil.
(condition-case nil
(org-export-resolve-id-link link info)
(org-link-broken nil)))))
(when dest
(concat
(org-ascii--fill-string
(format "[%s] %s" anchor (org-ascii--describe-datum dest info))
width info)
"\n\n")))))
;; Do not add a link that cannot be resolved and doesn't have
;; any description: destination is already visible in the
;; paragraph.

View File

@ -2909,7 +2909,7 @@ Starred and \"displaymath\" environments are not numbered."
(defun org-html--unlabel-latex-environment (latex-frag)
"Change environment in LATEX-FRAG string to an unnumbered one.
For instance, change an 'equation' environment to 'equation*'."
For instance, change an `equation' environment to `equation*'."
(replace-regexp-in-string
"\\`[ \t]*\\\\begin{\\([^*]+?\\)}"
"\\1*"

View File

@ -193,11 +193,11 @@ of contents can refer to headlines."
;; A link refers internally to HEADLINE.
(org-element-map (plist-get info :parse-tree) 'link
(lambda (link)
(eq headline
(pcase (org-element-property :type link)
((or "custom-id" "id") (org-export-resolve-id-link link info))
("fuzzy" (org-export-resolve-fuzzy-link link info))
(_ nil))))
(equal headline
;; Ignore broken links.
(condition-case nil
(org-export-resolve-id-link link info)
(org-link-broken nil))))
info t))))
(defun org-md--headline-title (style level title &optional anchor tags)

View File

@ -839,7 +839,7 @@ in `org-export-options-alist' or in export back-ends. In the
latter case, optional argument BACKEND has to be set to the
back-end where the option is defined, e.g.,
(org-publish-find-property file :subtitle 'latex)
(org-publish-find-property file :subtitle \\='latex)
Return value may be a string or a list, depending on the type of
PROPERTY, i.e. \"behavior\" parameter from `org-export-options-alist'."

View File

@ -1908,8 +1908,10 @@ Return a string."
(org-element-property :archivedp data)))
(let ((transcoder (org-export-transcoder data info)))
(or (and (functionp transcoder)
(broken-link-handler
(funcall transcoder data nil info)))
(if (eq type 'link)
(broken-link-handler
(funcall transcoder data nil info))
(funcall transcoder data nil info)))
;; Export snippets never return a nil value so
;; that white spaces following them are never
;; ignored.

View File

@ -470,8 +470,13 @@ TIME can be a non-nil Lisp time value, or a string specifying a date and time."
(apply ,(symbol-function 'current-time-zone)
(or time ,at) args)))
((symbol-function 'decode-time)
(lambda (&optional time zone form) (funcall ,(symbol-function 'decode-time)
(or time ,at) zone form)))
(lambda (&optional time zone form)
(condition-case nil
(funcall ,(symbol-function 'decode-time)
(or time ,at) zone form)
(wrong-number-of-arguments
(funcall ,(symbol-function 'decode-time)
(or time ,at))))))
((symbol-function 'encode-time)
(lambda (time &rest args)
(apply ,(symbol-function 'encode-time) (or time ,at) args)))