Merge branch 'bugfix' into emacs-sync

This commit is contained in:
Kyle Meyer 2024-06-15 14:23:31 -04:00
commit e38ff040bb
34 changed files with 245 additions and 162 deletions

View File

@ -28,6 +28,15 @@ constant.
If you still want to use python-mode with ob-python, you might If you still want to use python-mode with ob-python, you might
consider [[https://gitlab.com/jackkamm/ob-python-mode-mode][ob-python-mode-mode]], where the code to support python-mode consider [[https://gitlab.com/jackkamm/ob-python-mode-mode][ob-python-mode-mode]], where the code to support python-mode
has been ported to. has been ported to.
*** It is no longer possible to reveal hidden parts of the links during isearch
Org 9.6 introduced support for searching hidden parts of the links.
Unfortunately, we had to drop this support because its implementation
turned out to be unreliable for many users. Proper implementation
would require patching =isearch.el= and possibly a number of external
libraries implementing isearch equivalents. It cannot be done on Org
side alone.
*** =ox-latex=: ~org-latex-line-break-safe~ is deprecated *** =ox-latex=: ~org-latex-line-break-safe~ is deprecated
@ -276,7 +285,7 @@ passing universal argument.
When using this feature, IDs should not include =::=, which is used in When using this feature, IDs should not include =::=, which is used in
links to indicate the start of the search string. For backwards links to indicate the start of the search string. For backwards
compability, existing IDs including =::= will still be matched (but compatibility, existing IDs including =::= will still be matched (but
cannot be used together with search option). A new org-lint checker cannot be used together with search option). A new org-lint checker
has been added to warn about this. has been added to warn about this.
@ -417,8 +426,8 @@ in the dynamic block.
A global default formatting function for =colview= dynamic blocks can A global default formatting function for =colview= dynamic blocks can
be set via the new option ~org-columns-dblock-formatter~ which be set via the new option ~org-columns-dblock-formatter~ which
defaults to the new function ~org-columns-dblock-write-default~, that defaults to the new function ~org-columns-dblock-write-default~, that
implements the previous (fixed) formatting behaviour. Hence, the implements the previous (fixed) formatting behavior. Hence, the
default behaviour is identical to previous versions. default behavior is identical to previous versions.
The global default function can be overridden for any given =colview= The global default function can be overridden for any given =colview=
dynamic block individually by specifying a custom formatter function dynamic block individually by specifying a custom formatter function
@ -884,7 +893,7 @@ order to remain backward-compatible.
Before, a ClojureScript source block used the same backend as Clojure, Before, a ClojureScript source block used the same backend as Clojure,
configured in ~org-babel-clojure-backend~ and relied on an undocumented configured in ~org-babel-clojure-backend~ and relied on an undocumented
~:target~ paramter. ~:target~ parameter.
Now, there's ~org-babel-clojurescript-backend~ to determine the Now, there's ~org-babel-clojurescript-backend~ to determine the
backend used for evaluation of ClojureScript. backend used for evaluation of ClojureScript.
@ -962,7 +971,7 @@ manner with ~run-python~.
*** New hook option ~org-indent-post-buffer-init-functions~ *** New hook option ~org-indent-post-buffer-init-functions~
This allows to run functions after ~org-indent~ intializes a buffer to This allows to run functions after ~org-indent~ initializes a buffer to
enrich its properties. enrich its properties.
*** New option ~org-agenda-start-with-archives-mode~ *** New option ~org-agenda-start-with-archives-mode~
@ -1025,7 +1034,7 @@ of the dynamic block. This new option can be used to set the global
default formatting function that will be used for =colview= dynamic default formatting function that will be used for =colview= dynamic
blocks that do not specify any ~:formatter~ parameter. Its default blocks that do not specify any ~:formatter~ parameter. Its default
value (the new function ~org-columns-dblock-write-default~) yields the value (the new function ~org-columns-dblock-write-default~) yields the
previous (fixed) formatting behaviour. previous (fixed) formatting behavior.
*** New allowed value of ~org-md-headline-style~ to mix ATX and Setext style headlines *** New allowed value of ~org-md-headline-style~ to mix ATX and Setext style headlines
@ -1569,12 +1578,12 @@ is initiated only when user explicitly executes R/Julia-mode commands
that trigger session interactions (requires ESS 24.01.0 or newer). that trigger session interactions (requires ESS 24.01.0 or newer).
The same session will remain available in the context of Org babel. The same session will remain available in the context of Org babel.
*** ~org-store-link~ behaviour storing additional =CUSTOM_ID= links has changed *** ~org-store-link~ behavior storing additional =CUSTOM_ID= links has changed
Previously, when storing =id:= link, ~org-store-link~ stored an Previously, when storing =id:= link, ~org-store-link~ stored an
additional "human readable" link using a node's =CUSTOM_ID= property. additional "human readable" link using a node's =CUSTOM_ID= property.
This behaviour has been expanded to store an additional =CUSTOM_ID= This behavior has been expanded to store an additional =CUSTOM_ID=
link when storing any type of external link type in an Org file, not link when storing any type of external link type in an Org file, not
just =id:= links. just =id:= links.
@ -1719,6 +1728,9 @@ to the Org behavior. The new features and changes are listed below.
**** Hidden parts of the links can now be searched and revealed during isearch **** Hidden parts of the links can now be searched and revealed during isearch
[2024-06-09 Sun] Since Org 9.7, this is no longer working. See
changes for Org 9.7.
In the past, hidden parts of the links could not be searched using In the past, hidden parts of the links could not be searched using
isearch (=C-s=). Now, they are searchable by default. The hidden isearch (=C-s=). Now, they are searchable by default. The hidden
match is also revealed temporarily during isearch. match is also revealed temporarily during isearch.

View File

@ -482,7 +482,7 @@ int get_column_num (int nbcols, const char** header, const char* column)
(defun org-babel-C-header-to-C (head type) (defun org-babel-C-header-to-C (head type)
"Convert an elisp list of header table into a C or D vector "Convert an elisp list of header table into a C or D vector
specifying a variable with the name of the table." specifying a variable with the name of the table."
(message "%S" type) (unless noninteractive (message "%S" type))
(let ((table (car head)) (let ((table (car head))
(headers (cdr head)) (headers (cdr head))
(typename (pcase type (typename (pcase type

View File

@ -61,7 +61,7 @@
"Execute a block of Awk code BODY with org-babel. "Execute a block of Awk code BODY with org-babel.
PARAMS is a plist of src block parameters . PARAMS is a plist of src block parameters .
This function is called by `org-babel-execute-src-block'." This function is called by `org-babel-execute-src-block'."
(message "Executing Awk source code block") (unless noninteractive (message "Executing Awk source code block"))
(let* ((result-params (cdr (assq :result-params params))) (let* ((result-params (cdr (assq :result-params params)))
(cmd-line (cdr (assq :cmd-line params))) (cmd-line (cdr (assq :cmd-line params)))
(in-file (cdr (assq :in-file params))) (in-file (cdr (assq :in-file params)))

View File

@ -130,7 +130,7 @@
(defcustom ob-clojure-cli-command (when-let (cmd (executable-find "clojure")) (defcustom ob-clojure-cli-command (when-let (cmd (executable-find "clojure"))
(concat cmd " -M")) (concat cmd " -M"))
"Clojure CLI command used by the Clojure `clojure-cli' backend." "Clojure CLI command used by the Clojure `clojure-cli' backend."
:type 'string :type '(choice string (const nil))
:group 'org-babel :group 'org-babel
:package-version '(Org . "9.7")) :package-version '(Org . "9.7"))

View File

@ -855,8 +855,9 @@ guess will be made."
(forward-line) (forward-line)
(skip-chars-forward " \t") (skip-chars-forward " \t")
(let ((result (org-babel-read-result))) (let ((result (org-babel-read-result)))
(message (format "Cached: %s" (unless noninteractive
(replace-regexp-in-string "%" "%%" (format "%S" result)))) (message (format "Cached: %s"
(replace-regexp-in-string "%" "%%" (format "%S" result)))))
result))) result)))
((org-babel-confirm-evaluate info) ((org-babel-confirm-evaluate info)
(let* ((lang (nth 0 info)) (let* ((lang (nth 0 info))
@ -879,21 +880,26 @@ guess will be made."
result exec-start-time) result exec-start-time)
(unless (fboundp cmd) (unless (fboundp cmd)
(error "No org-babel-execute function for %s!" lang)) (error "No org-babel-execute function for %s!" lang))
(message "Executing %s %s %s..." (unless noninteractive
(capitalize lang) (message "Executing %s %s %s..."
(pcase executor-type (capitalize lang)
('src-block "code block") (pcase executor-type
('inline-src-block "inline code block") ('src-block "code block")
('babel-call "call") ('inline-src-block "inline code block")
('inline-babel-call "inline call") ('babel-call "call")
(e (symbol-name e))) ('inline-babel-call "inline call")
(let ((name (nth 4 info))) (e (symbol-name e)))
(if name (let ((name (nth 4 info)))
(format "(%s)" name) (if name
(format "at position %S" (nth 5 info))))) (format "(%s)" name)
(format "at position %S" (nth 5 info))))))
(setq exec-start-time (current-time) (setq exec-start-time (current-time)
result result
(let ((r (save-current-buffer (funcall cmd body params)))) (let ((r
;; Code block may move point in the buffer.
;; Make sure that the point remains on the
;; code block.
(save-excursion (funcall cmd body params))))
(if (and (eq (cdr (assq :result-type params)) 'value) (if (and (eq (cdr (assq :result-type params)) 'value)
(or (member "vector" result-params) (or (member "vector" result-params)
(member "table" result-params)) (member "table" result-params))
@ -909,7 +915,7 @@ guess will be made."
;; insert a link to `:file'. ;; insert a link to `:file'.
(when (and result (when (and result
(not (or (member "link" result-params) (not (or (member "link" result-params)
(member "graphics" result-params)))) (member "graphics" result-params))))
(with-temp-file file (with-temp-file file
(insert (org-babel-format-result (insert (org-babel-format-result
result result
@ -2758,18 +2764,19 @@ INFO may provide the values of these header arguments (in the
(not (and (listp result) (not (and (listp result)
(member "append" result-params)))) (member "append" result-params))))
(indent-rigidly beg end indent)) (indent-rigidly beg end indent))
(let ((time-info (unless noninteractive
;; Only show the time when something other than (let ((time-info
;; 0s will be shown, i.e. check if the time is at ;; Only show the time when something other than
;; least half of the displayed precision. ;; 0s will be shown, i.e. check if the time is at
(if (and exec-time (> (float-time exec-time) 0.05)) ;; least half of the displayed precision.
(format " (took %.1fs)" (float-time exec-time)) (if (and exec-time (> (float-time exec-time) 0.05))
""))) (format " (took %.1fs)" (float-time exec-time))
(if (null result) "")))
(if (member "value" result-params) (if (null result)
(message "Code block returned no value%s." time-info) (if (member "value" result-params)
(message "Code block produced no output%s." time-info)) (message "Code block returned no value%s." time-info)
(message "Code block evaluation complete%s." time-info)))) (message "Code block produced no output%s." time-info))
(message "Code block evaluation complete%s." time-info)))))
(when end (set-marker end nil)) (when end (set-marker end nil))
(when outside-scope (narrow-to-region visible-beg visible-end)) (when outside-scope (narrow-to-region visible-beg visible-end))
(set-marker visible-beg nil) (set-marker visible-beg nil)

View File

@ -113,8 +113,9 @@ This function is called by `org-babel-execute-src-block'."
(unless (file-exists-p org-ditaa-jar-path) (unless (file-exists-p org-ditaa-jar-path)
(error "Could not find ditaa.jar at %s" org-ditaa-jar-path)) (error "Could not find ditaa.jar at %s" org-ditaa-jar-path))
(with-temp-file in-file (insert body)) (with-temp-file in-file (insert body))
(message cmd) (shell-command cmd) (unless noninteractive (message cmd))
(when pdf-cmd (message pdf-cmd) (shell-command pdf-cmd)) (shell-command cmd)
(when pdf-cmd (unless noninteractive (message pdf-cmd)) (shell-command pdf-cmd))
nil)) ;; signal that output has already been written to file nil)) ;; signal that output has already been written to file
(defun org-babel-prep-session:ditaa (_session _params) (defun org-babel-prep-session:ditaa (_session _params)

View File

@ -265,8 +265,9 @@ this template."
(if (not (eq type 'babel-call)) (if (not (eq type 'babel-call))
(progn (skip-chars-forward " \t") (progn (skip-chars-forward " \t")
(point)) (point))
(skip-chars-forward " \r\t\n") (unless (eobp)
(line-beginning-position))))) (skip-chars-forward " \r\t\n")
(line-beginning-position))))))
((not rep) ((not rep)
;; Replacement code cannot be determined. ;; Replacement code cannot be determined.
;; Leave the code block as is. ;; Leave the code block as is.
@ -291,8 +292,9 @@ this template."
(cond ((not replacement) (goto-char end)) (cond ((not replacement) (goto-char end))
((equal replacement "") ((equal replacement "")
(goto-char end) (goto-char end)
(skip-chars-forward " \r\t\n") (unless (eobp)
(forward-line 0) (skip-chars-forward " \r\t\n")
(forward-line 0))
(delete-region begin (point))) (delete-region begin (point)))
(t (t
(if (org-src-preserve-indentation-p element) (if (org-src-preserve-indentation-p element)

View File

@ -210,7 +210,7 @@ This function is called by `org-babel-execute-src-block'."
(let ((script-file (org-babel-temp-file "gnuplot-script-"))) (let ((script-file (org-babel-temp-file "gnuplot-script-")))
(with-temp-file script-file (with-temp-file script-file
(insert (concat body "\n"))) (insert (concat body "\n")))
(message "gnuplot \"%s\"" script-file) (unless noninteractive (message "gnuplot \"%s\"" script-file))
(setq output (setq output
(shell-command-to-string (shell-command-to-string
(format (format
@ -219,7 +219,7 @@ This function is called by `org-babel-execute-src-block'."
script-file script-file
(if (member system-type '(cygwin windows-nt ms-dos)) (if (member system-type '(cygwin windows-nt ms-dos))
t nil))))) t nil)))))
(message "%s" output)) (unless noninteractive (message "%s" output)))
(with-temp-buffer (with-temp-buffer
(insert (concat body "\n")) (insert (concat body "\n"))
(gnuplot-mode) (gnuplot-mode)
@ -232,7 +232,7 @@ This function is called by `org-babel-execute-src-block'."
"Prepare SESSION according to the header arguments in PARAMS." "Prepare SESSION according to the header arguments in PARAMS."
(let* ((session (org-babel-gnuplot-initiate-session session)) (let* ((session (org-babel-gnuplot-initiate-session session))
(var-lines (org-babel-variable-assignments:gnuplot params))) (var-lines (org-babel-variable-assignments:gnuplot params)))
(message "%S" session) (unless noninteractive (message "%S" session))
(org-babel-comint-in-buffer session (org-babel-comint-in-buffer session
(dolist (var-line var-lines) (dolist (var-line var-lines)
(insert var-line) (insert var-line)

View File

@ -52,7 +52,7 @@ parameters may be used, like groovy -v"
(defun org-babel-execute:groovy (body params) (defun org-babel-execute:groovy (body params)
"Execute Groovy BODY according to PARAMS. "Execute Groovy BODY according to PARAMS.
This function is called by `org-babel-execute-src-block'." This function is called by `org-babel-execute-src-block'."
(message "Executing Groovy source code block") (unless noninteractive (message "Executing Groovy source code block"))
(let* ((processed-params (org-babel-process-params params)) (let* ((processed-params (org-babel-process-params params))
(session (org-babel-groovy-initiate-session (nth 0 processed-params))) (session (org-babel-groovy-initiate-session (nth 0 processed-params)))
(result-params (nth 2 processed-params)) (result-params (nth 2 processed-params))

View File

@ -41,7 +41,7 @@
(declare-function org-fold-show-all "org-fold" (&optional types)) (declare-function org-fold-show-all "org-fold" (&optional types))
(add-to-list 'org-babel-tangle-lang-exts '("LilyPond" . "ly")) (add-to-list 'org-babel-tangle-lang-exts '("LilyPond" . "ly"))
(add-to-list 'org-src-lang-modes '("lilypond" . "LilyPond")) (add-to-list 'org-src-lang-modes '("lilypond" . LilyPond))
(defvar org-babel-default-header-args:lilypond '() (defvar org-babel-default-header-args:lilypond '()
"Default header arguments for lilypond code blocks. "Default header arguments for lilypond code blocks.

View File

@ -131,13 +131,13 @@ Return nil if LINE is zero-length or it matches a regexp in
(defun org-babel-execute:maxima (body params) (defun org-babel-execute:maxima (body params)
"Execute Maxima BODY according to PARAMS. "Execute Maxima BODY according to PARAMS.
This function is called by `org-babel-execute-src-block'." This function is called by `org-babel-execute-src-block'."
(message "Executing Maxima source code block") (unless noninteractive (message "Executing Maxima source code block"))
(let ((result-params (split-string (or (cdr (assq :results params)) ""))) (let ((result-params (split-string (or (cdr (assq :results params)) "")))
(result (result
(let* ((cmdline (or (cdr (assq :cmdline params)) "")) (let* ((cmdline (or (cdr (assq :cmdline params)) ""))
(batch/load (or (cdr (assq :batch params)) "batchload")) (batch/load (or (cdr (assq :batch params)) "batchload"))
(cmdline (if (or (equal cmdline "") (equal batch/load "batchload")) (cmdline (if (or (equal cmdline "") (equal batch/load "batchload"))
;; legacy behaviour: ;; legacy behavior:
;; ensure that --very-quiet is on command-line by default ;; ensure that --very-quiet is on command-line by default
(concat cmdline " " org-babel-maxima--command-arguments-default) (concat cmdline " " org-babel-maxima--command-arguments-default)
;; if using an alternate loader, :cmdline overwrites default ;; if using an alternate loader, :cmdline overwrites default
@ -151,7 +151,7 @@ This function is called by `org-babel-execute-src-block'."
(format "(linenum:0, %s(%S))$" batch/load in-file)) (format "(linenum:0, %s(%S))$" batch/load in-file))
cmdline))) cmdline)))
(with-temp-file in-file (insert (org-babel-maxima-expand body params))) (with-temp-file in-file (insert (org-babel-maxima-expand body params)))
(message cmd) (unless noninteractive (message cmd))
;; " | grep -v batch | grep -v 'replaced' | sed '/^$/d' " ;; " | grep -v batch | grep -v 'replaced' | sed '/^$/d' "
(let ((raw (org-babel-eval cmd ""))) (let ((raw (org-babel-eval cmd "")))
(mapconcat (mapconcat

View File

@ -230,7 +230,7 @@ convert them into an Emacs-lisp table. Otherwise return the
results as a string." results as a string."
(let ((res (if (and (> (length results) 0) (let ((res (if (and (> (length results) 0)
(string-equal "{" (substring results 0 1))) (string-equal "{" (substring results 0 1)))
results ;don't covert dicts to elisp results ;don't convert dicts to elisp
(org-babel-script-escape results)))) (org-babel-script-escape results))))
(if (listp res) (if (listp res)
(mapcar (lambda (el) (if (eq el 'None) (mapcar (lambda (el) (if (eq el 'None)

View File

@ -52,7 +52,7 @@ In case you want to use a different screen than one selected by your $PATH")
(defun org-babel-execute:screen (body params) (defun org-babel-execute:screen (body params)
"Send BODY via screen to a terminal using Babel, according to PARAMS. "Send BODY via screen to a terminal using Babel, according to PARAMS.
\"default\" session is used when none is specified in the PARAMS." \"default\" session is used when none is specified in the PARAMS."
(message "Sending source code block to interactive terminal session...") (unless noninteractive (message "Sending source code block to interactive terminal session..."))
(save-window-excursion (save-window-excursion
(let* ((session (cdr (assq :session params))) (let* ((session (cdr (assq :session params)))
(socket (org-babel-screen-session-socketname session))) (socket (org-babel-screen-session-socketname session)))

View File

@ -65,7 +65,7 @@
BODY is the source inside a sed source block and PARAMS is an BODY is the source inside a sed source block and PARAMS is an
association list over the source block configurations. This association list over the source block configurations. This
function is called by `org-babel-execute-src-block'." function is called by `org-babel-execute-src-block'."
(message "Executing sed source code block") (unless noninteractive (message "Executing sed source code block"))
(let* ((result-params (cdr (assq :result-params params))) (let* ((result-params (cdr (assq :result-params params)))
(cmd-line (cdr (assq :cmd-line params))) (cmd-line (cdr (assq :cmd-line params)))
(in-file (cdr (assq :in-file params))) (in-file (cdr (assq :in-file params)))

View File

@ -369,7 +369,7 @@ another window."
(const wl-other-frame))))) (const wl-other-frame)))))
(defcustom org-link-search-must-match-exact-headline 'query-to-create (defcustom org-link-search-must-match-exact-headline 'query-to-create
"Control fuzzy link behaviour when specific matches not found. "Control fuzzy link behavior when specific matches not found.
When nil, if a fuzzy link does not match a more specific When nil, if a fuzzy link does not match a more specific
target (such as a heading, named block, target, or code ref), target (such as a heading, named block, target, or code ref),
@ -378,7 +378,7 @@ attempt a regular text search. When set to the special value
link instead. Otherwise, signal an error rather than attempting link instead. Otherwise, signal an error rather than attempting
a regular text search. a regular text search.
This option only affects behaviour in Org buffers. Spaces and This option only affects behavior in Org buffers. Spaces and
statistics cookies are ignored during heading searches." statistics cookies are ignored during heading searches."
:group 'org-link-follow :group 'org-link-follow
:version "24.1" :version "24.1"

View File

@ -530,7 +530,7 @@ DIR-property exists (that is different from the unset one)."
"Turn the autotag on or (if OFF is set) off." "Turn the autotag on or (if OFF is set) off."
(when org-attach-auto-tag (when org-attach-auto-tag
;; FIXME: There is currently no way to set #+FILETAGS ;; FIXME: There is currently no way to set #+FILETAGS
;; programatically. Do nothing when before first heading ;; programmatically. Do nothing when before first heading
;; (attaching to file) to avoid blocking error. ;; (attaching to file) to avoid blocking error.
(unless (org-before-first-heading-p) (unless (org-before-first-heading-p)
(save-excursion (save-excursion

View File

@ -408,8 +408,7 @@ you can escape ambiguous cases with a backward slash, e.g., \\%i."
(let ((file-variants '(choice :tag "Filename " (let ((file-variants '(choice :tag "Filename "
(file :tag "Literal") (file :tag "Literal")
(function :tag "Function") (function :tag "Function")
(variable :tag "Variable") (variable :tag "Variable"))))
(sexp :tag "Form"))))
`(repeat `(repeat
(choice :value ("" "" entry (file "~/org/notes.org") "") (choice :value ("" "" entry (file "~/org/notes.org") "")
(list :tag "Multikey description" (list :tag "Multikey description"
@ -452,12 +451,12 @@ you can escape ambiguous cases with a backward slash, e.g., \\%i."
(list :tag "File & function" (list :tag "File & function"
(const :format "" file+function) (const :format "" file+function)
,file-variants ,file-variants
(sexp :tag " Function")) (function :tag " Function"))
(list :tag "Current clocking task" (list :tag "Current clocking task"
(const :format "" clock)) (const :format "" clock))
(list :tag "Function" (list :tag "Function"
(const :format "" function) (const :format "" function)
(sexp :tag " Function"))) (function :tag " Function")))
(choice :tag "Template " (choice :tag "Template "
(string) (string)
(list :tag "File" (list :tag "File"

View File

@ -2048,28 +2048,31 @@ PROPNAME lets you set a custom text property instead of :org-clock-minutes."
(cond (cond
((and (eq element-type 'clock) (match-end 2)) ((and (eq element-type 'clock) (match-end 2))
;; Two time stamps. ;; Two time stamps.
(let* ((timestamp (org-element-property :value element)) (condition-case nil
(ts (float-time (let* ((timestamp (org-element-property :value element))
(org-encode-time (ts (float-time
(list 0 (org-encode-time
(org-element-property :minute-start timestamp) (list 0
(org-element-property :hour-start timestamp) (org-element-property :minute-start timestamp)
(org-element-property :day-start timestamp) (org-element-property :hour-start timestamp)
(org-element-property :month-start timestamp) (org-element-property :day-start timestamp)
(org-element-property :year-start timestamp) (org-element-property :month-start timestamp)
nil -1 nil)))) (org-element-property :year-start timestamp)
(te (float-time nil -1 nil))))
(org-encode-time (te (float-time
(list 0 (org-encode-time
(org-element-property :minute-end timestamp) (list 0
(org-element-property :hour-end timestamp) (org-element-property :minute-end timestamp)
(org-element-property :day-end timestamp) (org-element-property :hour-end timestamp)
(org-element-property :month-end timestamp) (org-element-property :day-end timestamp)
(org-element-property :year-end timestamp) (org-element-property :month-end timestamp)
nil -1 nil)))) (org-element-property :year-end timestamp)
(dt (- (if tend (min te tend) te) nil -1 nil))))
(if tstart (max ts tstart) ts)))) (dt (- (if tend (min te tend) te)
(when (> dt 0) (cl-incf t1 (floor dt 60))))) (if tstart (max ts tstart) ts))))
(when (> dt 0) (cl-incf t1 (floor dt 60))))
(error
(org-display-warning (format "org-clock-sum: Ignoring invalid %s" (org-current-line-string))))))
((match-end 4) ((match-end 4)
;; A naked time. ;; A naked time.
(setq t1 (+ t1 (string-to-number (match-string 5)) (setq t1 (+ t1 (string-to-number (match-string 5))

View File

@ -251,6 +251,17 @@ removed."
default))) default)))
": "))) ": ")))
(if (fboundp 'list-of-strings-p)
(defalias 'org-list-of-strings-p #'list-of-strings-p)
;; From Emacs subr.el.
;;;###autoload
(defun org-list-of-strings-p (object)
"Return t if OBJECT is nil or a list of strings."
(declare (pure t) (side-effect-free error-free))
(while (and (consp object) (stringp (car object)))
(setq object (cdr object)))
(null object)))
;;; Emacs < 27.1 compatibility ;;; Emacs < 27.1 compatibility

View File

@ -633,7 +633,7 @@ With a numeric prefix, show all headlines up to that level."
(org-cycle-content 5)) (org-cycle-content 5))
;; `nofold' and `showall' are technically not allowed values, but ;; `nofold' and `showall' are technically not allowed values, but
;; they are often intuitively tried by users by analogy with ;; they are often intuitively tried by users by analogy with
;; #+STARTUP: nofold or #STARUP: showall. ;; #+STARTUP: nofold or #STARTUP: showall.
((memq org-startup-folded '(showeverything nil nofold showall)) ((memq org-startup-folded '(showeverything nil nofold showall))
(org-fold-show-all))) (org-fold-show-all)))
(unless (eq org-startup-folded 'showeverything) (unless (eq org-startup-folded 'showeverything)

View File

@ -648,7 +648,7 @@ IMPORTANT: The buffer copy may also have variable `buffer-file-name'
copied. copied.
To prevent Emacs overwriting the original buffer file, To prevent Emacs overwriting the original buffer file,
`write-contents-functions' is set to \='(always). Do not alter this `write-contents-functions' is set to \\='(always). Do not alter this
variable and do not do anything that might alter it (like calling a variable and do not do anything that might alter it (like calling a
major mode) to prevent data corruption. Also, do note that Emacs may major mode) to prevent data corruption. Also, do note that Emacs may
jump into the created buffer if the original file buffer is closed and jump into the created buffer if the original file buffer is closed and
@ -1188,7 +1188,7 @@ parse properties for property drawer at point."
(property-name-symbol (intern property-name)) (property-name-symbol (intern property-name))
(property-value (property-value
(org-element-deferred-create (org-element-deferred-create
nil #'org-element--substring t #'org-element--substring
(- (match-beginning 3) begin) (- (match-beginning 3) begin)
(- (match-end 3) begin)))) (- (match-end 3) begin))))
(cond (cond
@ -1355,7 +1355,7 @@ Throw `:org-element-deferred-retry' signal at the end."
(title-end (point)) (title-end (point))
(raw-value (raw-value
(org-element-deferred-create (org-element-deferred-create
nil #'org-element--headline-raw-value t #'org-element--headline-raw-value
(- title-start begin) (- title-end begin)))) (- title-start begin) (- title-end begin))))
(org-element-put-property headline :raw-value raw-value) (org-element-put-property headline :raw-value raw-value)
(org-element-put-property headline :level level) (org-element-put-property headline :level level)
@ -1386,12 +1386,12 @@ Throw `:org-element-deferred-retry' signal at the end."
(defconst org-element--headline-parse-title-raw (defconst org-element--headline-parse-title-raw
(org-element-deferred-create (org-element-deferred-create
nil #'org-element--headline-parse-title t) t #'org-element--headline-parse-title t)
"Constant holding deferred value for raw headline `:title' property.") "Constant holding deferred value for raw headline `:title' property.")
(defconst org-element--headline-parse-title-parse (defconst org-element--headline-parse-title-parse
(org-element-deferred-create (org-element-deferred-create
nil #'org-element--headline-parse-title nil) t #'org-element--headline-parse-title nil)
"Constant holding deferred value for parsed headline `:title' property.") "Constant holding deferred value for parsed headline `:title' property.")
(defconst org-element--headline-deferred (defconst org-element--headline-deferred
@ -2414,7 +2414,7 @@ Assume point is at comment block beginning."
(if (eobp) (point) (line-beginning-position)))) (if (eobp) (point) (line-beginning-position))))
(value (value
(org-element-deferred-create (org-element-deferred-create
nil #'org-element--substring t #'org-element--substring
(- contents-begin begin) (- contents-begin begin)
(- contents-end begin)))) (- contents-end begin))))
(org-element-create (org-element-create
@ -2532,7 +2532,7 @@ Return a new syntax node of `example-block' type containing `:begin',
(contents-begin (line-beginning-position 2)) (contents-begin (line-beginning-position 2))
(value (value
(org-element-deferred-create (org-element-deferred-create
nil #'org-element--unescape-substring t #'org-element--unescape-substring
(- contents-begin begin) (- contents-begin begin)
(- contents-end begin))) (- contents-end begin)))
(pos-before-blank (progn (goto-char contents-end) (pos-before-blank (progn (goto-char contents-end)
@ -2612,7 +2612,7 @@ Assume point is at export-block beginning."
(if (eobp) (point) (line-beginning-position)))) (if (eobp) (point) (line-beginning-position))))
(value (value
(org-element-deferred-create (org-element-deferred-create
nil #'org-element--unescape-substring t #'org-element--unescape-substring
(- contents-begin begin) (- contents-begin begin)
(- contents-end begin)))) (- contents-end begin))))
(org-element-create (org-element-create
@ -2800,7 +2800,7 @@ Assume point is at the beginning of the latex environment."
(begin (car affiliated)) (begin (car affiliated))
(value (value
(org-element-deferred-create (org-element-deferred-create
nil #'org-element--substring t #'org-element--substring
(- code-begin begin) (- code-begin begin)
(- code-end begin))) (- code-end begin)))
(end (progn (skip-chars-forward " \r\t\n" limit) (end (progn (skip-chars-forward " \r\t\n" limit)
@ -3059,7 +3059,7 @@ Assume point is at the beginning of the block."
;; Retrieve code. ;; Retrieve code.
(value (value
(org-element-deferred-create (org-element-deferred-create
nil #'org-element--unescape-substring t #'org-element--unescape-substring
(- (line-beginning-position 2) begin) (- (line-beginning-position 2) begin)
(- contents-end begin))) (- contents-end begin)))
(pos-before-blank (progn (goto-char contents-end) (pos-before-blank (progn (goto-char contents-end)
@ -3159,7 +3159,7 @@ Assume point is at the beginning of the table."
:contents-end (and (eq type 'org) table-end) :contents-end (and (eq type 'org) table-end)
:value (and (eq type 'table.el) :value (and (eq type 'table.el)
(org-element-deferred-create (org-element-deferred-create
nil #'org-element--substring t #'org-element--substring
(- table-begin begin) (- table-begin begin)
(- table-end begin))) (- table-end begin)))
:post-blank (count-lines pos-before-blank end) :post-blank (count-lines pos-before-blank end)
@ -3322,7 +3322,7 @@ Assume point is at first MARK."
(list :value (list :value
(and (memq type '(code verbatim)) (and (memq type '(code verbatim))
(org-element-deferred-create (org-element-deferred-create
nil #'org-element--substring t #'org-element--substring
(- contents-begin origin) (- contents-begin origin)
(- contents-end origin)))) (- contents-end origin))))
(list :contents-begin contents-begin (list :contents-begin contents-begin
@ -3572,7 +3572,7 @@ Assume point is at the beginning of the snippet."
(value (value
(when contents-end (when contents-end
(org-element-deferred-create (org-element-deferred-create
nil #'org-element--substring t #'org-element--substring
(- contents-begin begin) (- contents-begin begin)
(- contents-end begin)))) (- contents-end begin))))
(post-blank (skip-chars-forward " \t")) (post-blank (skip-chars-forward " \t"))
@ -3667,7 +3667,7 @@ Assume point is at the beginning of the babel call."
(replace-regexp-in-string "\n[ \t]*" " " (org-trim p))))) (replace-regexp-in-string "\n[ \t]*" " " (org-trim p)))))
(value (value
(org-element-deferred-create (org-element-deferred-create
nil #'org-element--substring t #'org-element--substring
0 (- (point) begin))) 0 (- (point) begin)))
(post-blank (skip-chars-forward " \t")) (post-blank (skip-chars-forward " \t"))
(end (point))) (end (point)))
@ -3801,7 +3801,7 @@ Assume point is at the beginning of the LaTeX fragment."
'latex-fragment 'latex-fragment
(list :value (list :value
(org-element-deferred-create (org-element-deferred-create
nil #'org-element--substring t #'org-element--substring
0 (- after-fragment begin)) 0 (- after-fragment begin))
:begin begin :begin begin
:end end :end end
@ -4489,7 +4489,7 @@ Assume point is at the beginning of the timestamp."
(and (org-string-nw-p warning-string) (concat " " warning-string)) (and (org-string-nw-p warning-string) (concat " " warning-string))
(cdr brackets)))) (cdr brackets))))
(concat (concat
;; Opening backet: [ or < ;; Opening bracket: [ or <
(car brackets) (car brackets)
;; Starting date/time: YYYY-MM-DD DAY[ HH:MM] ;; Starting date/time: YYYY-MM-DD DAY[ HH:MM]
(if (eq type 'diary) (if (eq type 'diary)

View File

@ -641,13 +641,14 @@ This function is mostly intended to be used in
`clone-indirect-buffer-hook'." `clone-indirect-buffer-hook'."
;; Add current buffer to the list of indirect buffers in the base buffer. ;; Add current buffer to the list of indirect buffers in the base buffer.
(when (buffer-base-buffer) (when (buffer-base-buffer)
(with-current-buffer (buffer-base-buffer) (let ((new-buffer (current-buffer)))
(setq-local org-fold-core--indirect-buffers (with-current-buffer (buffer-base-buffer)
(let (bufs) (setq-local org-fold-core--indirect-buffers
(org-fold-core-cycle-over-indirect-buffers (let (bufs)
(push (current-buffer) bufs)) (org-fold-core-cycle-over-indirect-buffers
(push (current-buffer) bufs) (push (current-buffer) bufs))
(delete-dups bufs))))) (push new-buffer bufs)
(delete-dups bufs))))))
(when (and (buffer-base-buffer) (when (and (buffer-base-buffer)
(eq org-fold-core-style 'text-properties) (eq org-fold-core-style 'text-properties)
(not (memql 'ignore-indirect org-fold-core--optimise-for-huge-buffers))) (not (memql 'ignore-indirect org-fold-core--optimise-for-huge-buffers)))

View File

@ -148,7 +148,7 @@ random Automatically generate a unique, random label."
(const :tag "Prompt for label" nil) (const :tag "Prompt for label" nil)
(const :tag "Create automatic [fn:N]" t) (const :tag "Create automatic [fn:N]" t)
(const :tag "Offer automatic [fn:N] for editing" confirm) (const :tag "Offer automatic [fn:N] for editing" confirm)
(const :tag "Create anoymous [fn::]" anonymous) (const :tag "Create anonymous [fn::]" anonymous)
(const :tag "Create a random label" random)) (const :tag "Create a random label" random))
:safe #'symbolp) :safe #'symbolp)

View File

@ -388,14 +388,24 @@ called with one argument, the key used for comparison."
(dolist (e originals reports) (funcall make-report (cdr e) (car e))))) (dolist (e originals reports) (funcall make-report (cdr e) (car e)))))
(defun org-lint-misplaced-heading (ast) (defun org-lint-misplaced-heading (ast)
"Check for accidentally misplaced heading lines." "Check for accidentally misplaced heading lines.
Example:
** Heading 1
** Heading 2** Oops heading 3
** Heading 4"
(org-with-point-at ast (org-with-point-at ast
(goto-char (point-min)) (goto-char (point-min))
(let (result) (let (result)
;; Heuristics for 2+ level heading not at bol. ;; Heuristics for 2+ level heading not at bol.
(while (re-search-forward (rx (not (any "*\n\r ,")) ;; Not a bol; not escaped ,** heading; not " *** words" (while (re-search-forward (rx (not (any "*\n\r ,")) ;; Not a bol; not escaped ,** heading; not " *** words"
"*" (1+ "*") " ") nil t) "*" (1+ "*") " ") nil t)
(unless (org-at-block-p) ; Inside a block, where the chances to have heading a slim. ;; Limit false-positive rate by only complaining about
;; ** Heading** Heading and
;; ** Oops heading
;; Paragraph** Oops heading
(when (org-element-type-p
(org-element-at-point)
'(paragraph headline))
(push (list (match-beginning 0) "Possibly misplaced heading line") result))) (push (list (match-beginning 0) "Possibly misplaced heading line") result)))
result))) result)))

View File

@ -815,7 +815,7 @@ Match at beginning of line when WITH-BOL is non-nil."
(and (not (bobp)) (and (not (bobp))
(save-excursion (save-excursion
(forward-line n) (forward-line n)
(skip-chars-forward "[ \t]") (skip-chars-forward " \t")
(eolp)))) (eolp))))
(defun org-previous-line-empty-p () (defun org-previous-line-empty-p ()

View File

@ -144,7 +144,7 @@ control tag inheritance."
:group 'org-appearance :group 'org-appearance
:package-version '(Org . "9.3") :package-version '(Org . "9.3")
:type '(repeat (string :tag "Tag")) :type '(repeat (string :tag "Tag"))
:safe (lambda (val) (and (listp val) (cl-every #'stringp val)))) :safe #'org-list-of-strings-p)
;;;###autoload ;;;###autoload
(defcustom org-num-skip-unnumbered nil (defcustom org-num-skip-unnumbered nil

View File

@ -24,7 +24,7 @@
;;; Commentary: ;;; Commentary:
;; This library implementes completion support in Org mode buffers. ;; This library implements completion support in Org mode buffers.
;;; Code: ;;; Code:

View File

@ -416,7 +416,7 @@ FORMAT and ARGS are passed to `message'."
(defun org-persist--read-elisp-file (&optional buffer-or-file) (defun org-persist--read-elisp-file (&optional buffer-or-file)
"Read elisp data from BUFFER-OR-FILE or current buffer." "Read elisp data from BUFFER-OR-FILE or current buffer."
(let (;; UTF-8 is explicitly used in `org-persist--write-elisp-file'. (let (;; UTF-8 is explicitly used in `org-persist--write-elisp-file'.
(coding-system-for-read 'utf-8) (coding-system-for-read 'emacs-internal)
(buffer-or-file (or buffer-or-file (current-buffer)))) (buffer-or-file (or buffer-or-file (current-buffer))))
(with-temp-buffer (with-temp-buffer
(if (bufferp buffer-or-file) (if (bufferp buffer-or-file)
@ -452,7 +452,7 @@ FORMAT and ARGS are passed to `message'."
"Write elisp DATA to FILE." "Write elisp DATA to FILE."
;; Fsync slightly reduces the chance of an incomplete filesystem ;; Fsync slightly reduces the chance of an incomplete filesystem
;; write, however on modern hardware its effectiveness is ;; write, however on modern hardware its effectiveness is
;; questionable and it is insufficient to garantee complete writes. ;; questionable and it is insufficient to guarantee complete writes.
;; Coupled with the significant performance hit if writing many ;; Coupled with the significant performance hit if writing many
;; small files, it simply does not make sense to use fsync here, ;; small files, it simply does not make sense to use fsync here,
;; particularly as cache corruption is only a minor inconvenience. ;; particularly as cache corruption is only a minor inconvenience.
@ -464,7 +464,7 @@ FORMAT and ARGS are passed to `message'."
(let ((write-region-inhibit-fsync t) (let ((write-region-inhibit-fsync t)
;; We set UTF-8 here and in `org-persist--read-elisp-file' ;; We set UTF-8 here and in `org-persist--read-elisp-file'
;; to avoid the overhead from `find-auto-coding'. ;; to avoid the overhead from `find-auto-coding'.
(coding-system-for-write 'utf-8) (coding-system-for-write 'emacs-internal)
(print-circle (not no-circular)) (print-circle (not no-circular))
print-level print-level
print-length print-length

View File

@ -241,8 +241,8 @@ but the mode to use is `tuareg-mode'."
:package-version '(Org . "9.7") :package-version '(Org . "9.7")
:type '(repeat :type '(repeat
(cons (cons
(string "Language name") (string :tag "Language name")
(symbol "Major mode")))) (symbol :tag "Major mode"))))
(defcustom org-src-block-faces nil (defcustom org-src-block-faces nil
"Alist of faces to be used for source-block. "Alist of faces to be used for source-block.

View File

@ -5477,14 +5477,16 @@ a radio table."
(goto-char (org-table-begin)) (goto-char (org-table-begin))
(let (rtn) (let (rtn)
(forward-line -1) (forward-line -1)
(while (looking-at "[ \t]*#\\+ORGTBL[: \t][ \t]*SEND[ \t]+\\([^ \t\r\n]+\\)[ \t]+\\([^ \t\r\n]+\\)\\([ \t]+.*\\)?") (catch :bob
(let ((name (org-no-properties (match-string 1))) (while (looking-at "[ \t]*#\\+ORGTBL[: \t][ \t]*SEND[ \t]+\\([^ \t\r\n]+\\)[ \t]+\\([^ \t\r\n]+\\)\\([ \t]+.*\\)?")
(transform (intern (match-string 2))) (let ((name (org-no-properties (match-string 1)))
(params (if (match-end 3) (transform (intern (match-string 2)))
(read (concat "(" (match-string 3) ")"))))) (params (if (match-end 3)
(push (list :name name :transform transform :params params) (read (concat "(" (match-string 3) ")")))))
rtn) (push (list :name name :transform transform :params params)
(forward-line -1))) rtn)
(when (bobp) (throw :bob nil))
(forward-line -1))))
rtn))) rtn)))
(defun orgtbl-send-replace-tbl (name text) (defun orgtbl-send-replace-tbl (name text)

View File

@ -9,7 +9,7 @@
;; URL: https://orgmode.org ;; URL: https://orgmode.org
;; Package-Requires: ((emacs "26.1")) ;; Package-Requires: ((emacs "26.1"))
;; Version: 9.7.3 ;; Version: 9.7.4
;; This file is part of GNU Emacs. ;; This file is part of GNU Emacs.
;; ;;
@ -8738,7 +8738,7 @@ there is one, return it."
(save-window-excursion (save-window-excursion
;; We have no direct control over how ;; We have no direct control over how
;; `with-output-to-temp-buffer' displays the buffer. Try ;; `with-output-to-temp-buffer' displays the buffer. Try
;; to gain more space, makign sure that only the Org ;; to gain more space, making sure that only the Org
;; buffer and the *Select link* buffer are displayed for ;; buffer and the *Select link* buffer are displayed for
;; the duration of selection. ;; the duration of selection.
(ignore-errors (delete-other-windows)) (ignore-errors (delete-other-windows))
@ -10041,7 +10041,7 @@ where CURRENT-TODO-KEYWORD belongs over on in another sequence."
org-todo-key-alist)))) org-todo-key-alist))))
field-number ; current todo keyword column in the completion buffer. field-number ; current todo keyword column in the completion buffer.
todo-binding-spec todo-keyword todo-char input-char) todo-binding-spec todo-keyword todo-char input-char)
;; Display todo selection dialogue, read the user input, and return. ;; Display todo selection dialog, read the user input, and return.
(save-excursion (save-excursion
(save-window-excursion (save-window-excursion
;; Select todo keyword list buffer, and display it unless EXPERT-INTERFACE. ;; Select todo keyword list buffer, and display it unless EXPERT-INTERFACE.
@ -12224,7 +12224,7 @@ Returns the new tags string, or nil to not change the current settings."
(move-overlay org-tags-overlay ov-start ov-end) (move-overlay org-tags-overlay ov-start ov-end)
;; Highlight tags overlay in Org buffer. ;; Highlight tags overlay in Org buffer.
(org-set-current-tags-overlay current-tags ov-prefix) (org-set-current-tags-overlay current-tags ov-prefix)
;; Display tag selection dialogue, read the user input, and return. ;; Display tag selection dialog, read the user input, and return.
(save-excursion (save-excursion
(save-window-excursion (save-window-excursion
;; Select tag list buffer, and display it unless EXPERT-INTERFACE. ;; Select tag list buffer, and display it unless EXPERT-INTERFACE.
@ -12239,7 +12239,7 @@ Returns the new tags string, or nil to not change the current settings."
;; Insert current tags. ;; Insert current tags.
(org-fast-tag-insert "Inherited" inherited-tags inherited-face "\n") (org-fast-tag-insert "Inherited" inherited-tags inherited-face "\n")
(org-fast-tag-insert "Current" current-tags current-face "\n\n") (org-fast-tag-insert "Current" current-tags current-face "\n\n")
;; Display whether next change exits selection dialogue. ;; Display whether next change exits selection dialog.
(org-fast-tag-show-exit exit-after-next) (org-fast-tag-show-exit exit-after-next)
;; Show tags, tag groups, and bindings in a grid. ;; Show tags, tag groups, and bindings in a grid.
;; Each tag in the grid occupies FIELD-WIDTH characters. ;; Each tag in the grid occupies FIELD-WIDTH characters.
@ -16981,10 +16981,11 @@ buffer boundaries with possible narrowing."
(t nil)))) (t nil))))
(defun org-image--align (link) (defun org-image--align (link)
"Determine the alignment of the image link. "Determine the alignment of the image LINK.
LINK is a link object.
In decreasing order of priority, this is controlled: In decreasing order of priority, this is controlled:
- Per image by the value of `:center' or ``:align' in the - Per image by the value of `:center' or `:align' in the
affiliated keyword `#+attr_org'. affiliated keyword `#+attr_org'.
- By the `#+attr_html' or `#+attr_latex` keywords with valid - By the `#+attr_html' or `#+attr_latex` keywords with valid
`:center' or `:align' values. `:center' or `:align' values.
@ -16998,15 +16999,16 @@ will cause it to be right-aligned. A value of \"left\" or nil
implies no special alignment." implies no special alignment."
(let ((par (org-element-lineage link 'paragraph))) (let ((par (org-element-lineage link 'paragraph)))
;; Only align when image is not surrounded by paragraph text: ;; Only align when image is not surrounded by paragraph text:
(when (and (= (org-element-begin link) (when (and par ; when image is not in paragraph, but in table/headline/etc, do not align
(= (org-element-begin link)
(save-excursion (save-excursion
(goto-char (org-element-contents-begin par)) (goto-char (org-element-contents-begin par))
(skip-chars-forward "\t ") (skip-chars-forward "\t ")
(point))) ;account for leading space (point))) ;account for leading space
;before link ;before link
(<= (- (org-element-contents-end par) (<= (- (org-element-contents-end par)
(org-element-end link)) (org-element-end link))
1)) ;account for trailing newline 1)) ;account for trailing newline
;at end of paragraph ;at end of paragraph
(save-match-data (save-match-data
;; Look for a valid ":center t" or ":align left|center|right" ;; Look for a valid ":center t" or ":align left|center|right"
@ -20749,7 +20751,7 @@ it has a `diary' type."
(yank-media-handler "image/.*" #'org--image-yank-media-handler) (yank-media-handler "image/.*" #'org--image-yank-media-handler)
;; Looks like different DEs go for different handler names, ;; Looks like different DEs go for different handler names,
;; https://larsee.com/blog/2019/05/clipboard-files/. ;; https://larsee.com/blog/2019/05/clipboard-files/.
(yank-media-handler "x/special-\\(?:gnome\|KDE\|mate\\)-files" (yank-media-handler "x/special-\\(?:gnome\\|KDE\\|mate\\)-files"
#'org--copied-files-yank-media-handler)) #'org--copied-files-yank-media-handler))
(when (boundp 'x-dnd-direct-save-function) (when (boundp 'x-dnd-direct-save-function)
(setq-local x-dnd-direct-save-function #'org--dnd-xds-function))) (setq-local x-dnd-direct-save-function #'org--dnd-xds-function)))
@ -20871,11 +20873,25 @@ When nil, use `org-attach-method'."
(defvar org-attach-method) (defvar org-attach-method)
(defun org--dnd-rmc (prompt choices) (defun org--dnd-rmc (prompt choices)
"Display a menu or dialog and select with PROMPT among CHOICES.
PROMPT is the prompt string. CHOICES is a list of choices. Each
choice is a list of (key description value). VALUE from the selected
choice is returned."
(if (null (and (if (null (and
;; Emacs <=28 does not have `use-dialog-box-p'. ;; Emacs <=28 does not have `use-dialog-box-p'.
(fboundp 'use-dialog-box-p) (fboundp 'use-dialog-box-p)
(use-dialog-box-p))) (use-dialog-box-p)))
(caddr (read-multiple-choice prompt choices)) (progn
(setq choices
(mapcar
(pcase-lambda (`(,key ,message ,val))
;; `read-multiple-choice' expects VAL to be a long
;; description of the choice - string or nil. Move VAL
;; further, so that it is not seen by the extended
;; help in `read-multiple-choice'.
(list key message nil val))
choices))
(nth 3 (read-multiple-choice prompt choices)))
(setq choices (setq choices
(mapcar (mapcar
(pcase-lambda (`(_key ,message ,val)) (pcase-lambda (`(_key ,message ,val))
@ -20939,15 +20955,18 @@ SEPARATOR is the string to insert after each link."
('private (or org-yank-dnd-default-attach-method ('private (or org-yank-dnd-default-attach-method
org-attach-method))))) org-attach-method)))))
(if separatep (if separatep
(funcall (progn
(pcase method (unless (file-directory-p org-yank-image-save-method)
('cp #'copy-file) (make-directory org-yank-image-save-method t))
('mv #'rename-file) (funcall
('ln #'add-name-to-file) (pcase method
('lns #'make-symbolic-link)) ('cp #'copy-file)
filename ('mv #'rename-file)
(expand-file-name (file-name-nondirectory filename) ('ln #'add-name-to-file)
org-yank-image-save-method)) ('lns #'make-symbolic-link))
filename
(expand-file-name (file-name-nondirectory filename)
org-yank-image-save-method)))
(org-attach-attach filename nil method)) (org-attach-attach filename nil method))
(insert (insert
(org-link-make-string (org-link-make-string
@ -20965,7 +20984,7 @@ SEPARATOR is the string to insert after each link."
"The method to use for dropped file.") "The method to use for dropped file.")
(defun org--dnd-xds-function (need-name filename) (defun org--dnd-xds-function (need-name filename)
"Handle file with FILENAME dropped via XDS protocol. "Handle file with FILENAME dropped via XDS protocol.
When NEED-NAME is t, FILNAME is the base name of the file to be When NEED-NAME is t, FILENAME is the base name of the file to be
saved. saved.
When NEED-NAME is nil, the drop is complete." When NEED-NAME is nil, the drop is complete."
(if need-name (if need-name

View File

@ -185,7 +185,7 @@ All these properties should be backend agnostic. Backend
specific properties are set through `org-export-define-backend'. specific properties are set through `org-export-define-backend'.
Properties redefined there have precedence over these.") Properties redefined there have precedence over these.")
(defconst org-export-filters-alist (defvar org-export-filters-alist
'((:filter-body . org-export-filter-body-functions) '((:filter-body . org-export-filter-body-functions)
(:filter-bold . org-export-filter-bold-functions) (:filter-bold . org-export-filter-bold-functions)
(:filter-babel-call . org-export-filter-babel-call-functions) (:filter-babel-call . org-export-filter-babel-call-functions)
@ -1398,8 +1398,7 @@ external parameters overriding Org default settings, but still
inferior to file-local settings." inferior to file-local settings."
;; First install #+BIND variables since these must be set before ;; First install #+BIND variables since these must be set before
;; global options are read. ;; global options are read.
(dolist (pair (org-export--list-bound-variables)) (org-export--set-variables (org-export--list-bound-variables))
(set (make-local-variable (car pair)) (nth 1 pair)))
;; Get and prioritize export options... ;; Get and prioritize export options...
(org-combine-plists (org-combine-plists
;; ... from global variables... ;; ... from global variables...
@ -2585,7 +2584,7 @@ Return the updated communication channel."
(defun org-export--set-variables (variable-alist) (defun org-export--set-variables (variable-alist)
"Set buffer-local variables according to VARIABLE-ALIST in current buffer." "Set buffer-local variables according to VARIABLE-ALIST in current buffer."
(pcase-dolist (`(,var . ,val) variable-alist) (pcase-dolist (`(,var . ,val) variable-alist)
(set (make-local-variable var) val))) (set (make-local-variable var) (car val))))
(cl-defun org-export-copy-buffer (&key to-buffer drop-visibility (cl-defun org-export-copy-buffer (&key to-buffer drop-visibility
drop-narrowing drop-contents drop-narrowing drop-contents
@ -6254,7 +6253,7 @@ them."
("no" :default "Illustrasjon") ("no" :default "Illustrasjon")
("nb" :default "Illustrasjon") ("nb" :default "Illustrasjon")
("nn" :default "Illustrasjon") ("nn" :default "Illustrasjon")
("pl" :default "Obrazek") ; alternativly "Rysunek" ("pl" :default "Obrazek") ; alternatively "Rysunek"
("pt_BR" :default "Figura") ("pt_BR" :default "Figura")
("ro" :default "Imaginea") ("ro" :default "Imaginea")
("ru" :html "&#1056;&#1080;&#1089;&#1091;&#1085;&#1086;&#1082;" :utf-8 "Рисунок") ("ru" :html "&#1056;&#1080;&#1089;&#1091;&#1085;&#1086;&#1082;" :utf-8 "Рисунок")
@ -6277,7 +6276,7 @@ them."
("no" :default "Illustrasjon %d") ("no" :default "Illustrasjon %d")
("nb" :default "Illustrasjon %d") ("nb" :default "Illustrasjon %d")
("nn" :default "Illustrasjon %d") ("nn" :default "Illustrasjon %d")
("pl" :default "Obrazek %d") ; alternativly "Rysunek %d" ("pl" :default "Obrazek %d") ; alternatively "Rysunek %d"
("pt_BR" :default "Figura %d:") ("pt_BR" :default "Figura %d:")
("ro" :default "Imaginea %d:") ("ro" :default "Imaginea %d:")
("ru" :html "&#1056;&#1080;&#1089;. %d.:" :utf-8 "Рис. %d.:") ("ru" :html "&#1056;&#1080;&#1089;. %d.:" :utf-8 "Рис. %d.:")
@ -6438,7 +6437,7 @@ them."
("nl" :default "Zie figuur %s" ("nl" :default "Zie figuur %s"
:html "Zie figuur&nbsp;%s" :latex "Zie figuur~%s") :html "Zie figuur&nbsp;%s" :latex "Zie figuur~%s")
("nn" :default "Sjå figur %s") ("nn" :default "Sjå figur %s")
("pl" :default "Patrz obrazek %s") ; alternativly "Patrz rysunek %s" ("pl" :default "Patrz obrazek %s") ; alternatively "Patrz rysunek %s"
("pt_BR" :default "Veja a figura %s") ("pt_BR" :default "Veja a figura %s")
("ro" :default "Vezi figura %s") ("ro" :default "Vezi figura %s")
("sl" :default "Glej sliko %s") ("sl" :default "Glej sliko %s")
@ -6672,7 +6671,7 @@ and `org-export-to-file' for more specialized functions."
(with-temp-message "Initializing asynchronous export process" (with-temp-message "Initializing asynchronous export process"
(let ((copy-fun (org-element--generate-copy-script (current-buffer))) (let ((copy-fun (org-element--generate-copy-script (current-buffer)))
(temp-file (make-temp-file "org-export-process"))) (temp-file (make-temp-file "org-export-process")))
(let ((coding-system-for-write 'utf-8-emacs-unix)) (let ((coding-system-for-write 'emacs-internal))
(write-region (write-region
;; Null characters (from variable values) are inserted ;; Null characters (from variable values) are inserted
;; within the file. As a consequence, coding system for ;; within the file. As a consequence, coding system for

View File

@ -30,14 +30,18 @@
"Generate the Texinfo file out of the Org manual." "Generate the Texinfo file out of the Org manual."
(require 'ox-texinfo) (require 'ox-texinfo)
(find-file "../doc/org-manual.org") (find-file "../doc/org-manual.org")
(let ((org-confirm-babel-evaluate nil)) (let ((org-confirm-babel-evaluate nil)
;; We do not want to search local user files when building manuals.
(org-id-track-globally nil))
(org-texinfo-export-to-texinfo))) (org-texinfo-export-to-texinfo)))
(defun org-make-guide () (defun org-make-guide ()
"Generate the Texinfo file out of the Org guide." "Generate the Texinfo file out of the Org guide."
(require 'ox-texinfo) (require 'ox-texinfo)
(find-file "../doc/org-guide.org") (find-file "../doc/org-guide.org")
(let ((org-confirm-babel-evaluate nil)) (let ((org-confirm-babel-evaluate nil)
;; We do not want to search local user files when building manuals.
(org-id-track-globally nil))
(org-texinfo-export-to-texinfo))) (org-texinfo-export-to-texinfo)))
(make-obsolete 'org-make-manuals (make-obsolete 'org-make-manuals
@ -48,7 +52,9 @@
(require 'ox-texinfo) (require 'ox-texinfo)
(dolist (manual '("../doc/org-manual.org" "../doc/org-guide.org")) (dolist (manual '("../doc/org-manual.org" "../doc/org-guide.org"))
(find-file manual) (find-file manual)
(let ((org-confirm-babel-evaluate nil)) (let ((org-confirm-babel-evaluate nil)
;; We do not want to search local user files when building manuals.
(org-id-track-globally nil))
(org-texinfo-export-to-texinfo)))) (org-texinfo-export-to-texinfo))))
(defun org-make-org-version (org-release org-git-version) (defun org-make-org-version (org-release org-git-version)

View File

@ -133,7 +133,18 @@ variable, and communication channel under `info'."
(org-export-create-backend (org-export-create-backend
:transcoders :transcoders
'((section . (lambda (s c i) '((section . (lambda (s c i)
(if (eq test-ox-var 'value) "Yes" "No"))))))))))) (if (eq test-ox-var 'value) "Yes" "No"))))))))))
;; Seen from elisp code blocks as well.
(should
(string-match-p "::: \"test value\""
(org-test-with-temp-text "#+BIND: test-ox-var \"test value\"
#+begin_src emacs-lisp :results value :exports results :eval yes
(format \"::: %S\" test-ox-var)
#+end_src"
(let ((org-export-allow-bind-keywords t))
(org-export-as
(org-test-default-backend)))))))
(ert-deftest test-org-export/parse-option-keyword () (ert-deftest test-org-export/parse-option-keyword ()
"Test reading all standard #+OPTIONS: items." "Test reading all standard #+OPTIONS: items."