From 23fc4793001e4de920bb8dae280133f4467a7797 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 30 Jul 2023 11:05:00 -0400 Subject: [PATCH 1/5] ; Fix admin/upload-manuals script * admin/upload-manuals (html_mono): Chdir to the right directory before committing. (html_node): Avoid computing $stale in newly-created or empty directories. --- admin/upload-manuals | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/admin/upload-manuals b/admin/upload-manuals index 6f44456efb8..a206177a5c1 100755 --- a/admin/upload-manuals +++ b/admin/upload-manuals @@ -305,13 +305,14 @@ done ## TODO: check for removed manuals. [ "$clist" ] && ( - cd $webdir/manual/html_mono + cd $webdir/manual [ "$new" ] && { echo "Adding new files: $new" $cvs add $new || die "add error" new_manual $new || die echo "Remember to add new entries to manual/index.html" } + cd html_mono $cvs commit -m "$message" $clist || die "commit error" ) @@ -339,9 +340,13 @@ for d in html_node/*; do done stale= - for f in $webdir/manual/$d/*.html; do - [ -e ${f#$webdir/manual/} ] || stale="$stale ${f##*/}" - done + # Newly created directory will have no HTML files, so none can be + # "stale". But 'for' returns the original wildcard, so avoid that. + ls $webdir/manual/$d/*.html > /dev/null 2>&1 && { + for f in $webdir/manual/$d/*.html; do + [ -e ${f#$webdir/manual/} ] || stale="$stale ${f##*/}" + done + } mv $d/*.html $webdir/manual/$d/ From bf83fdba9e3c3f5cba4a5b6f9580007c8a27135b Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 30 Jul 2023 20:10:54 +0300 Subject: [PATCH 2/5] ; * src/character.c (Fstring_width, Fchar_width): Doc fixes. --- src/character.c | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/src/character.c b/src/character.c index 13d516987d3..5b8e99ab64d 100644 --- a/src/character.c +++ b/src/character.c @@ -260,8 +260,12 @@ char_width (int c, struct Lisp_Char_Table *dp) DEFUN ("char-width", Fchar_width, Schar_width, 1, 1, 0, - doc: /* Return width of CHAR when displayed in the current buffer. -The width is measured by how many columns it occupies on the screen. + doc: /* Return width of CHAR in columns when displayed in the current buffer. +The width of CHAR is measured by how many columns it will occupy on the screen. +This is based on data in `char-width-table', and ignores the actual +metrics of the character's glyph as determined by its font. +If the display table in effect replaces CHAR on display with +something else, the function returns the width of the replacement. Tab is taken to occupy `tab-width' columns. usage: (char-width CHAR) */) (Lisp_Object ch) @@ -457,20 +461,25 @@ lisp_string_width (Lisp_Object string, ptrdiff_t from, ptrdiff_t to, } DEFUN ("string-width", Fstring_width, Sstring_width, 1, 3, 0, - doc: /* Return width of STRING when displayed in the current buffer. -Width is measured by how many columns it occupies on the screen. + doc: /* Return width of STRING in columns when displayed in the current buffer. +Width of STRING is measured by how many columns it will occupy on the screen. + Optional arguments FROM and TO specify the substring of STRING to consider, and are interpreted as in `substring'. -When calculating width of a multibyte character in STRING, -only the base leading-code is considered; the validity of -the following bytes is not checked. Tabs in STRING are always -taken to occupy `tab-width' columns. The effect of faces and fonts -used for non-Latin and other unusual characters (such as emoji) is -ignored as well, as are display properties and invisible text. -For these reasons, the results are not generally reliable; -for accurate dimensions of text as it will be displayed, -use `string-pixel-width' or `window-text-pixel-size' instead. +Width of each character in STRING is generally taken according to +`char-width', but character compositions and the display table in +effect are taken into consideration. +Tabs in are always taken to occupy `tab-width' columns, although they +might take fewer columns depending on the column where they begin. +The effect of faces and fonts, including fonts used for non-Latin and +other unusual characters, such as emoji, is ignored as well, as are +display properties and invisible text. + +For these reasons, the results are just an approximation, especially +on GUI frames; for accurate dimensions of text as it will be +displayed, use `string-pixel-width' or `window-text-pixel-size' +instead. usage: (string-width STRING &optional FROM TO) */) (Lisp_Object str, Lisp_Object from, Lisp_Object to) { From 735f3700f6510608415fd647dc28c0332c11d011 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 30 Jul 2023 22:09:05 +0300 Subject: [PATCH 3/5] ; * src/character.c (Fstring_width): Fix last change. --- src/character.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/character.c b/src/character.c index 5b8e99ab64d..4881b221a39 100644 --- a/src/character.c +++ b/src/character.c @@ -470,11 +470,12 @@ consider, and are interpreted as in `substring'. Width of each character in STRING is generally taken according to `char-width', but character compositions and the display table in effect are taken into consideration. -Tabs in are always taken to occupy `tab-width' columns, although they -might take fewer columns depending on the column where they begin. +Tabs in STRING are always assumed to occupy `tab-width' columns, +although they might take fewer columns depending on the column where +they begin on display. The effect of faces and fonts, including fonts used for non-Latin and -other unusual characters, such as emoji, is ignored as well, as are -display properties and invisible text. +other unusual characters, such as emoji, is ignored, as are display +properties and invisible text. For these reasons, the results are just an approximation, especially on GUI frames; for accurate dimensions of text as it will be From 80c9f491fc8dc068421f32cd15e0b387a6d1ee11 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sun, 30 Jul 2023 16:52:11 -0400 Subject: [PATCH 4/5] Update to Org 9.6.7-5-gd1d0c3 --- doc/misc/org.org | 9 ++++-- etc/refcards/orgcard.tex | 2 +- lisp/org/ob-C.el | 2 +- lisp/org/ob-tangle.el | 5 ++-- lisp/org/org-element.el | 3 +- lisp/org/org-faces.el | 2 +- lisp/org/org-fold-core.el | 58 ++++++++++++++++++++++----------------- lisp/org/org-macs.el | 2 +- lisp/org/org-mouse.el | 2 +- lisp/org/org-version.el | 4 +-- lisp/org/org.el | 19 +++++++------ lisp/org/ox-texinfo.el | 3 -- 12 files changed, 63 insertions(+), 48 deletions(-) diff --git a/doc/misc/org.org b/doc/misc/org.org index ae3fae0623e..d8bbcb4d0c5 100644 --- a/doc/misc/org.org +++ b/doc/misc/org.org @@ -4562,7 +4562,7 @@ all children are done, you can use the following setup: #+begin_src emacs-lisp (defun org-summary-todo (n-done n-not-done) "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")))) (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. BACKEND is the export back-end being used, as a symbol." (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) #+end_src diff --git a/etc/refcards/orgcard.tex b/etc/refcards/orgcard.tex index 07463ee6a33..dd8cae5ce5e 100644 --- a/etc/refcards/orgcard.tex +++ b/etc/refcards/orgcard.tex @@ -1,5 +1,5 @@ % Reference Card for Org Mode -\def\orgversionnumber{9.6.6} +\def\orgversionnumber{9.6.7} \def\versionyear{2023} % latest update \input emacsver.tex diff --git a/lisp/org/ob-C.el b/lisp/org/ob-C.el index 3a6e99623f5..7763c4c07c1 100644 --- a/lisp/org/ob-C.el +++ b/lisp/org/ob-C.el @@ -339,7 +339,7 @@ FORMAT can be either a format string or a function which is called with VAL." (type (pcase basetype (`integerp '("int" "%d")) - (`floatp '("double" "%f")) + (`floatp '("double" "%s")) ;; %f rounds, use %s to print the float literally (`stringp (list (if (eq org-babel-c-variant 'd) "string" "const char*") diff --git a/lisp/org/ob-tangle.el b/lisp/org/ob-tangle.el index 980d4a12054..0b816a7c13c 100644 --- a/lisp/org/ob-tangle.el +++ b/lisp/org/ob-tangle.el @@ -513,6 +513,7 @@ The PARAMS are the 3rd element of the info for the same src block." (cdr (assq :tangle params))))) bare)))))) +(defvar org-outline-regexp) ; defined in lisp/org.el (defun org-babel-tangle-single-block (block-counter &optional only-this-block) "Collect the tangled source for current block. 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 (max (condition-case nil (save-excursion - (org-back-to-heading t) ; Sets match data - (match-end 0)) + (org-back-to-heading t) + (re-search-forward org-outline-regexp)) (error (point-min))) (save-excursion (if (re-search-backward diff --git a/lisp/org/org-element.el b/lisp/org/org-element.el index 517d45b0224..df43ebcf0c5 100644 --- a/lisp/org/org-element.el +++ b/lisp/org/org-element.el @@ -7734,7 +7734,8 @@ the cache." ;; it to real beginning then despite ;; START being larger. (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 ;; or at already processed position. ;; Make sure that we continue from an diff --git a/lisp/org/org-faces.el b/lisp/org/org-faces.el index 594c9a6e738..bb0958033fe 100644 --- a/lisp/org/org-faces.el +++ b/lisp/org/org-faces.el @@ -108,7 +108,7 @@ color of the frame." "Face used for drawers." :group 'org-faces) -(defface org-property-value nil +(defface org-property-value '((t :inherit default)) "Face used for the value of a property." :group 'org-faces) diff --git a/lisp/org/org-fold-core.el b/lisp/org/org-fold-core.el index 027ff921581..6c17b00faf8 100644 --- a/lisp/org/org-fold-core.el +++ b/lisp/org/org-fold-core.el @@ -502,26 +502,34 @@ hanging around." ;; different buffer. This can happen, for example, when ;; org-capture copies local variables into *Capture* buffer. (setq buffers (list (current-buffer))) - (dolist (buf (cons (or (buffer-base-buffer) (current-buffer)) - (buffer-local-value 'org-fold-core--indirect-buffers (or (buffer-base-buffer) (current-buffer))))) - (if (buffer-live-p buf) - (push buf buffers) - (dolist (spec (org-fold-core-folding-spec-list)) - (when (and (not (org-fold-core-get-folding-spec-property spec :global)) - (gethash (cons buf spec) org-fold-core--property-symbol-cache)) - ;; Make sure that dead-properties variable can be passed - ;; as argument to `remove-text-properties'. - (push t dead-properties) - (push (gethash (cons buf spec) org-fold-core--property-symbol-cache) - dead-properties)))))) + (let ((all-buffers (buffer-local-value + 'org-fold-core--indirect-buffers + (or (buffer-base-buffer) (current-buffer))))) + (dolist (buf (cons (or (buffer-base-buffer) (current-buffer)) + (buffer-local-value 'org-fold-core--indirect-buffers (or (buffer-base-buffer) (current-buffer))))) + (if (buffer-live-p buf) + (push buf buffers) + (dolist (spec (org-fold-core-folding-spec-list)) + (when (and (not (org-fold-core-get-folding-spec-property spec :global)) + (gethash (cons buf spec) org-fold-core--property-symbol-cache)) + ;; Make sure that dead-properties variable can be passed + ;; 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) (with-current-buffer buf - (with-silent-modifications - (save-restriction - (widen) - (remove-text-properties - (point-min) (point-max) - dead-properties))) + (when dead-properties + (with-silent-modifications + (save-restriction + (widen) + (remove-text-properties + (point-min) (point-max) + dead-properties)))) ,@body)))) ;; 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 property, unfold the region if the :fragile function returns non-nil." ;; 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)) - org-fold-core--ignore-modifications + (unless (or 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)) ;; Store the new buffer modification state. (setq org-fold-core--last-buffer-chars-modified-tick (buffer-chars-modified-tick)) (save-match-data ;; Handle changes in all the indirect buffers and in the base ;; buffer. Work around Emacs bug#46982. - (when (eq org-fold-core-style 'text-properties) - (org-fold-core-cycle-over-indirect-buffers - ;; Re-hide text inserted in the middle/front/back of a folded - ;; region. - (unless (equal from to) ; Ignore deletions. + ;; Re-hide text inserted in the middle/front/back of a folded + ;; region. + (unless (equal from to) ; Ignore deletions. + (when (eq org-fold-core-style 'text-properties) + (org-fold-core-cycle-over-indirect-buffers (dolist (spec (org-fold-core-folding-spec-list)) ;; Reveal fully invisible text inserted in the middle ;; of visible portion of the buffer. This is needed, diff --git a/lisp/org/org-macs.el b/lisp/org/org-macs.el index 1552675f8a8..4efa8ba6800 100644 --- a/lisp/org/org-macs.el +++ b/lisp/org/org-macs.el @@ -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))) (when (and (cdr e) (string-match re (cdr e))) (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) (setcdr e (replace-match safe t t (cdr e))))) (while (string-match re string) diff --git a/lisp/org/org-mouse.el b/lisp/org/org-mouse.el index 3b2c4cba624..e0671f3d7d5 100644 --- a/lisp/org/org-mouse.el +++ b/lisp/org/org-mouse.el @@ -975,7 +975,7 @@ This means, between the beginning of line and the point." (interactive) (org-back-to-heading) (let ((minlevel 1000) - (replace-text (concat (match-string 0) "* "))) + (replace-text (concat (make-string (org-current-level) ?*) "* "))) (beginning-of-line 2) (save-excursion (while (not (or (eobp) (looking-at org-outline-regexp))) diff --git a/lisp/org/org-version.el b/lisp/org/org-version.el index 8d93af2c20d..9116e298aa9 100644 --- a/lisp/org/org-version.el +++ b/lisp/org/org-version.el @@ -5,13 +5,13 @@ (defun org-release () "The release version of Org. 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)) ;;;###autoload (defun org-git-version () "The Git version of Org mode. 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)) (provide 'org-version) diff --git a/lisp/org/org.el b/lisp/org/org.el index d3e14fecec3..0043c0407a9 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -9,7 +9,7 @@ ;; URL: https://orgmode.org ;; Package-Requires: ((emacs "26.1")) -;; Version: 9.6.6 +;; Version: 9.6.7 ;; 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 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." (org-with-wide-buffer (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. The level is the number of stars at the beginning of the 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." (let ((level (org-with-limited-levels (org-outline-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) \"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\"))))") (defvar org-todo-statistics-hook nil @@ -16253,7 +16253,8 @@ conventions: 2. Its description consists in a single link of the previous 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'. @@ -16284,7 +16285,7 @@ buffer boundaries with possible narrowing." ;; "file:" links. Also check link abbreviations since ;; some might expand to "file" links. (file-types-re - (format "\\[\\[\\(?:file%s:\\|attachment:\\|[./~]\\)\\|\\]\\[\\( Date: Sun, 30 Jul 2023 11:22:26 +0300 Subject: [PATCH 5/5] ; * lisp/textmodes/paragraphs.el: Remove leftover comment. * lisp/textmodes/paragraphs.el: Remove a comment referring to code that was removed in cf605d5. (Bug#64947) --- lisp/textmodes/paragraphs.el | 1 - 1 file changed, 1 deletion(-) diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el index a9e28a3275b..d23902b1c67 100644 --- a/lisp/textmodes/paragraphs.el +++ b/lisp/textmodes/paragraphs.el @@ -201,7 +201,6 @@ This is desirable in modes where blank lines are the paragraph delimiters." :type 'boolean :safe #'booleanp) -;; Silence the compiler. (defun forward-paragraph (&optional arg) "Move forward to end of paragraph. With argument ARG, do it ARG times;