Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/emacs into emacs-29

This commit is contained in:
Eli Zaretskii 2023-07-31 14:42:27 +03:00
commit 525d05c1b8
12 changed files with 63 additions and 48 deletions

View file

@ -4562,7 +4562,7 @@ all children are done, you can use the following setup:
#+begin_src emacs-lisp #+begin_src emacs-lisp
(defun org-summary-todo (n-done n-not-done) (defun org-summary-todo (n-done n-not-done)
"Switch entry to DONE when all subentries are done, to TODO otherwise." "Switch entry to DONE when all subentries are done, to TODO otherwise."
(let (org-log-done org-log-states) ; turn off logging (let (org-log-done org-todo-log-states) ; turn off logging
(org-todo (if (= n-not-done 0) "DONE" "TODO")))) (org-todo (if (= n-not-done 0) "DONE" "TODO"))))
(add-hook 'org-after-todo-statistics-hook #'org-summary-todo) (add-hook 'org-after-todo-statistics-hook #'org-summary-todo)
@ -16034,7 +16034,12 @@ can remove every headline in the buffer during export like this:
"Remove all headlines in the current buffer. "Remove all headlines in the current buffer.
BACKEND is the export back-end being used, as a symbol." BACKEND is the export back-end being used, as a symbol."
(org-map-entries (org-map-entries
(lambda () (delete-region (point) (line-beginning-position 2))))) (lambda ()
(delete-region (point) (line-beginning-position 2))
;; We need to tell `org-map-entries' to not skip over heading at
;; point. Otherwise, it would continue from _next_ heading. See
;; the docstring of `org-map-entries' for details.
(setq org-map-continue-from (point)))))
(add-hook 'org-export-before-parsing-hook #'my-headline-removal) (add-hook 'org-export-before-parsing-hook #'my-headline-removal)
#+end_src #+end_src

View file

@ -1,5 +1,5 @@
% Reference Card for Org Mode % Reference Card for Org Mode
\def\orgversionnumber{9.6.6} \def\orgversionnumber{9.6.7}
\def\versionyear{2023} % latest update \def\versionyear{2023} % latest update
\input emacsver.tex \input emacsver.tex

View file

@ -339,7 +339,7 @@ FORMAT can be either a format string or a function which is called with VAL."
(type (type
(pcase basetype (pcase basetype
(`integerp '("int" "%d")) (`integerp '("int" "%d"))
(`floatp '("double" "%f")) (`floatp '("double" "%s")) ;; %f rounds, use %s to print the float literally
(`stringp (`stringp
(list (list
(if (eq org-babel-c-variant 'd) "string" "const char*") (if (eq org-babel-c-variant 'd) "string" "const char*")

View file

@ -513,6 +513,7 @@ The PARAMS are the 3rd element of the info for the same src block."
(cdr (assq :tangle params))))) (cdr (assq :tangle params)))))
bare)))))) bare))))))
(defvar org-outline-regexp) ; defined in lisp/org.el
(defun org-babel-tangle-single-block (block-counter &optional only-this-block) (defun org-babel-tangle-single-block (block-counter &optional only-this-block)
"Collect the tangled source for current block. "Collect the tangled source for current block.
Return the list of block attributes needed by Return the list of block attributes needed by
@ -570,8 +571,8 @@ non-nil, return the full association list to be used by
(buffer-substring (buffer-substring
(max (condition-case nil (max (condition-case nil
(save-excursion (save-excursion
(org-back-to-heading t) ; Sets match data (org-back-to-heading t)
(match-end 0)) (re-search-forward org-outline-regexp))
(error (point-min))) (error (point-min)))
(save-excursion (save-excursion
(if (re-search-backward (if (re-search-backward

View file

@ -7734,7 +7734,8 @@ the cache."
;; it to real beginning then despite ;; it to real beginning then despite
;; START being larger. ;; START being larger.
(setq start nil) (setq start nil)
(move-start-to-next-match nil) (let ((data nil)) ; data may not be valid. ignore it.
(move-start-to-next-match nil))
;; The new element may now start before ;; The new element may now start before
;; or at already processed position. ;; or at already processed position.
;; Make sure that we continue from an ;; Make sure that we continue from an

View file

@ -108,7 +108,7 @@ color of the frame."
"Face used for drawers." "Face used for drawers."
:group 'org-faces) :group 'org-faces)
(defface org-property-value nil (defface org-property-value '((t :inherit default))
"Face used for the value of a property." "Face used for the value of a property."
:group 'org-faces) :group 'org-faces)

View file

@ -502,26 +502,34 @@ hanging around."
;; different buffer. This can happen, for example, when ;; different buffer. This can happen, for example, when
;; org-capture copies local variables into *Capture* buffer. ;; org-capture copies local variables into *Capture* buffer.
(setq buffers (list (current-buffer))) (setq buffers (list (current-buffer)))
(dolist (buf (cons (or (buffer-base-buffer) (current-buffer)) (let ((all-buffers (buffer-local-value
(buffer-local-value 'org-fold-core--indirect-buffers (or (buffer-base-buffer) (current-buffer))))) 'org-fold-core--indirect-buffers
(if (buffer-live-p buf) (or (buffer-base-buffer) (current-buffer)))))
(push buf buffers) (dolist (buf (cons (or (buffer-base-buffer) (current-buffer))
(dolist (spec (org-fold-core-folding-spec-list)) (buffer-local-value 'org-fold-core--indirect-buffers (or (buffer-base-buffer) (current-buffer)))))
(when (and (not (org-fold-core-get-folding-spec-property spec :global)) (if (buffer-live-p buf)
(gethash (cons buf spec) org-fold-core--property-symbol-cache)) (push buf buffers)
;; Make sure that dead-properties variable can be passed (dolist (spec (org-fold-core-folding-spec-list))
;; as argument to `remove-text-properties'. (when (and (not (org-fold-core-get-folding-spec-property spec :global))
(push t dead-properties) (gethash (cons buf spec) org-fold-core--property-symbol-cache))
(push (gethash (cons buf spec) org-fold-core--property-symbol-cache) ;; Make sure that dead-properties variable can be passed
dead-properties)))))) ;; as argument to `remove-text-properties'.
(push t dead-properties)
(push (gethash (cons buf spec) org-fold-core--property-symbol-cache)
dead-properties)))))
(when dead-properties
(with-current-buffer (or (buffer-base-buffer) (current-buffer))
(setq-local org-fold-core--indirect-buffers
(seq-filter #'buffer-live-p all-buffers))))))
(dolist (buf buffers) (dolist (buf buffers)
(with-current-buffer buf (with-current-buffer buf
(with-silent-modifications (when dead-properties
(save-restriction (with-silent-modifications
(widen) (save-restriction
(remove-text-properties (widen)
(point-min) (point-max) (remove-text-properties
dead-properties))) (point-min) (point-max)
dead-properties))))
,@body)))) ,@body))))
;; This is the core function used to fold text in buffers. We use ;; This is the core function used to fold text in buffers. We use
@ -1277,19 +1285,19 @@ to :front-sticky/:rear-sticky folding spec property.
If the folded region is folded with a spec with non-nil :fragile If the folded region is folded with a spec with non-nil :fragile
property, unfold the region if the :fragile function returns non-nil." property, unfold the region if the :fragile function returns non-nil."
;; If no insertions or deletions in buffer, skip all the checks. ;; If no insertions or deletions in buffer, skip all the checks.
(unless (or (eq org-fold-core--last-buffer-chars-modified-tick (buffer-chars-modified-tick)) (unless (or org-fold-core--ignore-modifications
org-fold-core--ignore-modifications (eq org-fold-core--last-buffer-chars-modified-tick (buffer-chars-modified-tick))
(memql 'ignore-modification-checks org-fold-core--optimise-for-huge-buffers)) (memql 'ignore-modification-checks org-fold-core--optimise-for-huge-buffers))
;; Store the new buffer modification state. ;; Store the new buffer modification state.
(setq org-fold-core--last-buffer-chars-modified-tick (buffer-chars-modified-tick)) (setq org-fold-core--last-buffer-chars-modified-tick (buffer-chars-modified-tick))
(save-match-data (save-match-data
;; Handle changes in all the indirect buffers and in the base ;; Handle changes in all the indirect buffers and in the base
;; buffer. Work around Emacs bug#46982. ;; buffer. Work around Emacs bug#46982.
(when (eq org-fold-core-style 'text-properties) ;; Re-hide text inserted in the middle/front/back of a folded
(org-fold-core-cycle-over-indirect-buffers ;; region.
;; Re-hide text inserted in the middle/front/back of a folded (unless (equal from to) ; Ignore deletions.
;; region. (when (eq org-fold-core-style 'text-properties)
(unless (equal from to) ; Ignore deletions. (org-fold-core-cycle-over-indirect-buffers
(dolist (spec (org-fold-core-folding-spec-list)) (dolist (spec (org-fold-core-folding-spec-list))
;; Reveal fully invisible text inserted in the middle ;; Reveal fully invisible text inserted in the middle
;; of visible portion of the buffer. This is needed, ;; of visible portion of the buffer. This is needed,

View file

@ -1288,7 +1288,7 @@ so values can contain further %-escapes if they are define later in TABLE."
(setq re (concat "%-?[0-9.]*" (substring (car e) 1))) (setq re (concat "%-?[0-9.]*" (substring (car e) 1)))
(when (and (cdr e) (string-match re (cdr e))) (when (and (cdr e) (string-match re (cdr e)))
(let ((sref (substring (cdr e) (match-beginning 0) (match-end 0))) (let ((sref (substring (cdr e) (match-beginning 0) (match-end 0)))
(safe "SREF")) (safe (copy-sequence "SREF")))
(add-text-properties 0 3 (list 'sref sref) safe) (add-text-properties 0 3 (list 'sref sref) safe)
(setcdr e (replace-match safe t t (cdr e))))) (setcdr e (replace-match safe t t (cdr e)))))
(while (string-match re string) (while (string-match re string)

View file

@ -975,7 +975,7 @@ This means, between the beginning of line and the point."
(interactive) (interactive)
(org-back-to-heading) (org-back-to-heading)
(let ((minlevel 1000) (let ((minlevel 1000)
(replace-text (concat (match-string 0) "* "))) (replace-text (concat (make-string (org-current-level) ?*) "* ")))
(beginning-of-line 2) (beginning-of-line 2)
(save-excursion (save-excursion
(while (not (or (eobp) (looking-at org-outline-regexp))) (while (not (or (eobp) (looking-at org-outline-regexp)))

View file

@ -5,13 +5,13 @@
(defun org-release () (defun org-release ()
"The release version of Org. "The release version of Org.
Inserted by installing Org mode or when a release is made." Inserted by installing Org mode or when a release is made."
(let ((org-release "9.6.6")) (let ((org-release "9.6.7"))
org-release)) org-release))
;;;###autoload ;;;###autoload
(defun org-git-version () (defun org-git-version ()
"The Git version of Org mode. "The Git version of Org mode.
Inserted by installing Org or when a release is made." Inserted by installing Org or when a release is made."
(let ((org-git-version "release_9.6.6")) (let ((org-git-version "release_9.6.7-5-gd1d0c3"))
org-git-version)) org-git-version))
(provide 'org-version) (provide 'org-version)

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.6.6 ;; Version: 9.6.7
;; This file is part of GNU Emacs. ;; This file is part of GNU Emacs.
;; ;;
@ -5691,7 +5691,7 @@ highlighting was done, nil otherwise."
If this is called at a normal headline, the level is the number If this is called at a normal headline, the level is the number
of stars. Use `org-reduced-level' to remove the effect of of stars. Use `org-reduced-level' to remove the effect of
`org-odd-levels'. Unlike to `org-current-level', this function `org-odd-levels-only'. Unlike `org-current-level', this function
takes into consideration inlinetasks." takes into consideration inlinetasks."
(org-with-wide-buffer (org-with-wide-buffer
(end-of-line) (end-of-line)
@ -6621,7 +6621,7 @@ headings in the region."
"Return the level of the current entry, or nil if before the first headline. "Return the level of the current entry, or nil if before the first headline.
The level is the number of stars at the beginning of the The level is the number of stars at the beginning of the
headline. Use `org-reduced-level' to remove the effect of headline. Use `org-reduced-level' to remove the effect of
`org-odd-levels'. Unlike to `org-outline-level', this function `org-odd-levels-only'. Unlike `org-outline-level', this function
ignores inlinetasks." ignores inlinetasks."
(let ((level (org-with-limited-levels (org-outline-level)))) (let ((level (org-with-limited-levels (org-outline-level))))
(and (> level 0) level))) (and (> level 0) level)))
@ -9709,7 +9709,7 @@ when there is a statistics cookie in the headline!
(defun org-summary-todo (n-done n-not-done) (defun org-summary-todo (n-done n-not-done)
\"Switch entry to DONE when all subentries are done, to TODO otherwise.\" \"Switch entry to DONE when all subentries are done, to TODO otherwise.\"
(let (org-log-done org-log-states) ; turn off logging (let (org-log-done org-todo-log-states) ; turn off logging
(org-todo (if (= n-not-done 0) \"DONE\" \"TODO\"))))") (org-todo (if (= n-not-done 0) \"DONE\" \"TODO\"))))")
(defvar org-todo-statistics-hook nil (defvar org-todo-statistics-hook nil
@ -16253,7 +16253,8 @@ conventions:
2. Its description consists in a single link of the previous 2. Its description consists in a single link of the previous
type. In this case, that link must be a well-formed plain type. In this case, that link must be a well-formed plain
or angle link, i.e., it must have an explicit \"file\" type. or angle link, i.e., it must have an explicit \"file\" or
\"attachment\" type.
Equip each image with the key-map `image-map'. Equip each image with the key-map `image-map'.
@ -16284,7 +16285,7 @@ buffer boundaries with possible narrowing."
;; "file:" links. Also check link abbreviations since ;; "file:" links. Also check link abbreviations since
;; some might expand to "file" links. ;; some might expand to "file" links.
(file-types-re (file-types-re
(format "\\[\\[\\(?:file%s:\\|attachment:\\|[./~]\\)\\|\\]\\[\\(<?file:\\)" (format "\\[\\[\\(?:file%s:\\|attachment:\\|[./~]\\)\\|\\]\\[\\(<?\\(?:file\\|attachment\\):\\)"
(if (not link-abbrevs) "" (if (not link-abbrevs) ""
(concat "\\|" (regexp-opt link-abbrevs)))))) (concat "\\|" (regexp-opt link-abbrevs))))))
(while (re-search-forward file-types-re end t) (while (re-search-forward file-types-re end t)
@ -16323,7 +16324,9 @@ buffer boundaries with possible narrowing."
;; description. ;; description.
(= (org-element-property :contents-end link) (= (org-element-property :contents-end link)
(match-end 0)) (match-end 0))
(match-string 2))))))) (progn
(setq linktype (match-string 1))
(match-string 2))))))))
(when (and path (string-match-p file-extension-re path)) (when (and path (string-match-p file-extension-re path))
(let ((file (if (equal "attachment" linktype) (let ((file (if (equal "attachment" linktype)
(progn (progn
@ -20656,7 +20659,7 @@ non-nil it will also look at invisible ones."
(if backward? (goto-char (point-min)) (outline-next-heading)) (if backward? (goto-char (point-min)) (outline-next-heading))
(org-back-to-heading invisible-ok) (org-back-to-heading invisible-ok)
(unless backward? (end-of-line)) ;do not match current headline (unless backward? (end-of-line)) ;do not match current headline
(let ((level (- (match-end 0) (match-beginning 0) 1)) (let ((level (org-current-level))
(f (if backward? #'re-search-backward #'re-search-forward)) (f (if backward? #'re-search-backward #'re-search-forward))
(count (if arg (abs arg) 1)) (count (if arg (abs arg) 1))
(result (point))) (result (point)))

View file

@ -1965,9 +1965,6 @@ EXT-PLIST, when provided, is a property list with external
parameters overriding Org default settings, but still inferior to parameters overriding Org default settings, but still inferior to
file-local settings. file-local settings.
When optional argument PUB-DIR is set, use it as the publishing
directory.
Return INFO file's name." Return INFO file's name."
(interactive) (interactive)
(let ((outfile (org-export-output-file-name ".texi" subtreep)) (let ((outfile (org-export-output-file-name ".texi" subtreep))