master 59f402717aa 8/8: Merge from origin/emacs-31

Sean Whitton <[email protected]> Sun, 26 Jul 2026 07:42:58 -0400 (EDT)
Newsgroups gmane.emacs.diffs
Message-ID <[email protected]>
branch: master
commit 59f402717aa35c4e6d5ad5a88de4eb61922c27ea
Merge: 6e4dee5bf40 b5119ab9209
Author: Sean Whitton <[email protected]>
Commit: Sean Whitton <[email protected]>

    Merge from origin/emacs-31
    
    b5119ab9209 ; * etc/PROBLEMS: Document problems with pasting on Windo...
    6bd90deb269 ; Fix fallout from 'image-dired-display-image-mode' chang...
    39cb1e483fd ; * lisp/bookmark.el (bookmark-alist): Doc fix (bug#81461).
    296869994e4 ; Remove 'sit-for' treesit parser workaround (bug#81019)
    633a998bcfd ; Improve documentation of text properties for strings
---
 doc/lispref/strings.texi           |  3 +++
 etc/PROBLEMS                       | 19 +++++++++++++++++++
 lisp/bookmark.el                   |  2 +-
 lisp/image/image-dired.el          |  8 ++++----
 lisp/textmodes/markdown-ts-mode.el |  2 --
 5 files changed, 27 insertions(+), 7 deletions(-)

diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi
index 53d80bc84d2..5aac39fa0f9 100644
--- a/doc/lispref/strings.texi
+++ b/doc/lispref/strings.texi
@@ -444,6 +444,9 @@ characters, and removes all text properties.  It may also change
 @var{string}'s length.
 @end defun
 
+  To modify the text properties of a string, use the functions described
+in @ref{Changing Properties}.
+
 @need 2000
 @node Text Comparison
 @section Comparison of Characters and Strings
diff --git a/etc/PROBLEMS b/etc/PROBLEMS
index 8c88c9e391a..c9b01e65ea4 100644
--- a/etc/PROBLEMS
+++ b/etc/PROBLEMS
@@ -3187,6 +3187,25 @@ XKeymacs Version 3.47, deactivating XKeymacs when Emacs is active is
 not enough to avoid its messing with the keyboard input.  Exiting
 XKeymacs completely is reported to solve the problem.
 
+** Pasting non-ASCII characters into "emacs -nw" doesn't work.
+
+This happens if you paste using the Windows shortcuts, such as
+S-<Insert> and C-v or C-S-v.  Evidently, these paste methods support
+only ASCII text, at least in some Windows configurations.
+
+Instead, use the Emacs C-y key to paste from the clipboard, which on
+Windows works on text-only frames as well.  Make sure your
+customizations don't affect the value of 'interprogram-paste-function',
+which should be 'gui-selection-value', even in -nw sessions.  In
+addition, you should make sure the font used by the Windows Terminal
+supports the characters you paste (the default font set by Windows
+should be okay).  For best results, we also recommend to set the console
+codepage to 65001, which is the UTF-8 codepage.  You can do that with
+the following command, which should be done _before_ running Emacs on
+the Windows Terminal:
+
+  c:\> chcp 65001
+
 ** Pasting from Windows clipboard into Emacs doesn't work.
 
 This was reported to be the result of an anti-virus software blocking
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index 1113144f87a..77136308573 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -286,7 +286,7 @@ described below.  An entry with a key but null value means the entry
 is not used.
 
  (filename . FILENAME)
- (buf . BUFFER-OR-NAME)
+ (buffer . BUFFER-OR-NAME)
  (position . POS)
  (front-context-string . STR-AFTER-POS)
  (rear-context-string  . STR-BEFORE-POS)
diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el
index cba090e7c85..1a8fb1007f4 100644
--- a/lisp/image/image-dired.el
+++ b/lisp/image/image-dired.el
@@ -1296,10 +1296,10 @@ which is based on `image-mode'."
     (when buf (pop-to-buffer buf))
     (select-window cur-win)))
 
-(defun image-dired-display-this (&optional arg)
+(defun image-dired-display-this (&optional _ignore)
   "Display current thumbnail's original image in display buffer.
-See documentation for `image-dired-display-image' for more information.
-With prefix argument ARG, display image in its original size."
+See documentation for `image-dired-display-image' for more information."
+  (declare (advertised-calling-convention () "29.1"))
   (interactive "P" image-dired-thumbnail-mode)
   (unless (string-equal major-mode "image-dired-thumbnail-mode")
     (user-error "Not in `image-dired-thumbnail-mode'"))
@@ -1309,7 +1309,7 @@ With prefix argument ARG, display image in its original size."
           ((not file)
            (message "No original file name found"))
           (t
-           (image-dired-display-image file arg)))))
+           (image-dired-display-image file)))))
 
 (defun image-dired-display-next (&optional arg)
   "Move to the next image in the thumbnail buffer and display it.
diff --git a/lisp/textmodes/markdown-ts-mode.el b/lisp/textmodes/markdown-ts-mode.el
index 9b287d4459b..6b0b0424095 100644
--- a/lisp/textmodes/markdown-ts-mode.el
+++ b/lisp/textmodes/markdown-ts-mode.el
@@ -3098,8 +3098,6 @@ See `markdown-ts--run-command-in-code-block'.")
 
 (defun markdown-ts--enable-code-block-in-context-mode ()
   "Enable `markdown-ts-code-block-in-context-mode' if in a fenced code block."
-  ;; Let treesit catch up with buffer edits.
-  (sit-for 0)
   (markdown-ts-code-block-in-context-mode
    (if (markdown-ts-at-code-block-p) 1 -1)))