commit 04d7318efa20cce3aa369fdfd563d8364feb6e78 (HEAD, refs/remotes/origin/master) Author: Po Lu Date: Fri Jul 5 12:09:52 2024 +0800 Enable Gnulib substitute on Android systems with defective strnlen * configure.ac (AC_FUNC_STRNLEN): Detect a bug where strnlen is liable to integer overflows if addition of the search limit to the string would also overflow. * src/xdisp.c (store_mode_line_string): Remove stopgap measure. diff --git a/configure.ac b/configure.ac index f0437d6f8cb..909f5786c9a 100644 --- a/configure.ac +++ b/configure.ac @@ -1611,6 +1611,30 @@ AC_DEFUN([gl_TYPE_OFF64_T], [HAVE_OFF64_T=1 AC_SUBST([HAVE_OFF64_T])]) +# `strnlen' cannot accept nlen greater than the size of the object S +# on Android 2.2 and earlier. +m4_define([ORIGINAL_AC_FUNC_STRNLEN], m4_defn([AC_FUNC_STRNLEN])) +AC_DEFUN([AC_FUNC_STRNLEN], [ +AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_CACHE_CHECK([for strnlen capable of accepting large limits], + [emacs_cv_func_strnlen_working], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], [[ + volatile size_t (*strnlen_pointer) (const char *s, size_t) = &strnlen; + if ((*strnlen_pointer) ("", -1) != 0) + return 1; + return 0; +]])],[emacs_cv_func_strnlen_working=yes], + [emacs_cv_func_strnlen_working=no], + [# Guess no on Android 21 and earlier, yes elsewhere. + AS_IF([test -n "$ANDROID_SDK" && test "$ANDROID_SDK" -lt 22], + [emacs_cv_func_strnlen_working=no], + [emacs_cv_func_strnlen_working='guessing yes'])])]) +AS_IF([test "$emacs_cv_func_strnlen_working" != "no"], + [ORIGINAL_AC_FUNC_STRNLEN], + [ac_cv_func_strnlen_working=no + AC_LIBOBJ([strnlen])])]) + # Initialize gnulib right after choosing the compiler. dnl Amongst other things, this sets AR and ARFLAGS. gl_EARLY diff --git a/src/xdisp.c b/src/xdisp.c index 566c4b211d6..8c7e8e5cb43 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -28065,18 +28065,7 @@ store_mode_line_string (const char *string, Lisp_Object lisp_string, if (string != NULL) { -#if defined HAVE_ANDROID && !defined ANDROID_STUBIFY \ - && __ANDROID_API__ < 22 - /* Circumvent a bug in memchr preventing strnlen from returning - valid values when a large limit is specified. - - https://issuetracker.google.com/issues/37020957 */ - if (precision <= 0 || ((uintptr_t) string - > (UINTPTR_MAX - precision))) - len = strlen (string); - else -#endif /* HAVE_ANDROID && !ANDROID_STUBIFY && __ANDROID_API__ < 22 */ - len = strnlen (string, precision <= 0 ? SIZE_MAX : precision); + len = strnlen (string, precision <= 0 ? SIZE_MAX : precision); lisp_string = make_string (string, len); if (NILP (props)) props = mode_line_string_face_prop; commit 507a13f5a1615d39f31d75547835416b29677c03 Merge: d76eb23232b 334d5132207 Author: Po Lu Date: Fri Jul 5 10:05:23 2024 +0800 Merge from savannah/emacs-30 334d5132207 (edebug--called-interactively-skip): Fix bug#71934 6e8b9ccaec2 ; * lisp/ibuffer.el (ibuffer-mode): Doc fix. 3eaf1abbff8 Fix MS-Windows build with native-compilation fc375359edd Tag dbus-test05-register-signal-with-nils as unstable 99230d7080f ; * src/w32fns.c (funhook): Restore mistakenly lost line. 81a7358a33b Merge branch 'emacs-30' of git.savannah.gnu.org:/srv/git/... b085d683962 Fix treesit test (bug#71907) f39cf0beb74 Focus more on MS-Windows than MS-DOS in FAQ d64396b8e42 Autoload some string functions bd482b745aa Merge branch 'emacs-30' of git.savannah.gnu.org:/srv/git/... b5341831353 * etc/NEWS: Fix typos. 850fc68481a ; (grep-read-files): Fix completion table 28532599358 Merge branch 'emacs-30' of git.savannah.gnu.org:/srv/git/... 921d40759e5 Remove a reference to a non-existant variable from a doc-... 5d2a115ab03 ; * src/fns.c (value_cmp): ASCIIfy. commit d76eb23232bffdf2505b13ec9216c6d0487a0ccb Author: Pip Cet Date: Thu Jul 4 22:09:55 2024 +0000 Fix dumping finalizers with pdumper * src/pdumper.c (dump_finalizer): Use `out' (a pointer to a finalizer) rather than `&out' (a pointer to a pointer to a finalizer). diff --git a/src/pdumper.c b/src/pdumper.c index 138777e7134..bc5748c8c47 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -2208,9 +2208,9 @@ dump_finalizer (struct dump_context *ctx, /* Do _not_ call dump_pseudovector_lisp_fields here: we dump the only Lisp field, finalizer->function, manually, so we can give it a low weight. */ - dump_field_lv (ctx, &out, finalizer, &finalizer->function, WEIGHT_NONE); - dump_field_finalizer_ref (ctx, &out, finalizer, &finalizer->prev); - dump_field_finalizer_ref (ctx, &out, finalizer, &finalizer->next); + dump_field_lv (ctx, out, finalizer, &finalizer->function, WEIGHT_NONE); + dump_field_finalizer_ref (ctx, out, finalizer, &finalizer->prev); + dump_field_finalizer_ref (ctx, out, finalizer, &finalizer->next); return finish_dump_pvec (ctx, &out->header); } commit 0e591a9112c15bfe7bd19c06fa117cfc9e87f8b5 Author: Stefan Kangas Date: Thu Jul 4 23:55:16 2024 +0200 Remove redundant `require`s * lisp/gnus/canlock.el (sha1): * lisp/international/utf7.el (base64): * lisp/net/hmac-md5.el (md5): * lisp/org/ob-processing.el (sha1): * lisp/org/org-feed.el (sha1): * test/lisp/net/rfc2104-tests.el (sha1, md5): Don't require features that are built-in, and always provided. diff --git a/lisp/gnus/canlock.el b/lisp/gnus/canlock.el index 02744a7f0a5..39ae6809a55 100644 --- a/lisp/gnus/canlock.el +++ b/lisp/gnus/canlock.el @@ -41,8 +41,6 @@ ;;; Code: -(require 'sha1) - (defvar mail-header-separator) (defgroup canlock nil diff --git a/lisp/international/utf7.el b/lisp/international/utf7.el index 63009b0744a..2b23bee1038 100644 --- a/lisp/international/utf7.el +++ b/lisp/international/utf7.el @@ -63,7 +63,6 @@ ;;; Code: -(require 'base64) (require 'mm-util) (defconst utf7-direct-encoding-chars " -%'-*,-[]-}" diff --git a/lisp/net/hmac-md5.el b/lisp/net/hmac-md5.el index 1c4ac24a9c4..af323b0d2b0 100644 --- a/lisp/net/hmac-md5.el +++ b/lisp/net/hmac-md5.el @@ -29,7 +29,6 @@ (eval-when-compile (require 'hmac-def)) (require 'hex-util) ; (decode-hex-string STRING) -(require 'md5) ; expects (md5 STRING) (defun md5-binary (string) "Return the MD5 of STRING in binary form." diff --git a/lisp/org/ob-processing.el b/lisp/org/ob-processing.el index 2733b1d1f6d..f7326f0eea7 100644 --- a/lisp/org/ob-processing.el +++ b/lisp/org/ob-processing.el @@ -56,7 +56,6 @@ (org-assert-version) (require 'ob) -(require 'sha1) (declare-function processing-sketch-run "ext:processing-mode" ()) diff --git a/lisp/org/org-feed.el b/lisp/org/org-feed.el index 4077afa0d3c..c90174f0fa7 100644 --- a/lisp/org/org-feed.el +++ b/lisp/org/org-feed.el @@ -92,7 +92,6 @@ (org-assert-version) (require 'org) -(require 'sha1) (declare-function url-retrieve-synchronously "url" (url &optional silent inhibit-cookies timeout)) diff --git a/test/lisp/net/rfc2104-tests.el b/test/lisp/net/rfc2104-tests.el index be5da619eaa..40e593ad56b 100644 --- a/test/lisp/net/rfc2104-tests.el +++ b/test/lisp/net/rfc2104-tests.el @@ -23,8 +23,6 @@ (require 'ert) (require 'rfc2104) -(require 'sha1) -(require 'md5) (ert-deftest dbus-test-sha1 () (should commit f91387cce8f6f1dced427ad44686ffcc69574ef6 Author: Jim Porter Date: Sun Jun 23 14:53:49 2024 -0700 In SHR, load from URL cache if possible when zooming images * lisp/net/shr.el (shr-replace-image): New function extracted from... (shr-image-fetched): ... here. (shr-zoom-image): Check URL cache and call 'shr-replace-image' if we can. diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 8b62691bfb6..ea3d8deeff8 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -678,17 +678,22 @@ full-buffer size." (start (or (previous-single-property-change end 'image-url) (point-min))) (dom-size (get-text-property position 'image-dom-size)) + (flags `( :zoom ,zoom-level + :width ,(car dom-size) + :height ,(cdr dom-size))) (buffer-read-only nil)) ;; Delete the old picture. (put-text-property start end 'display nil) (message "%s" (cadr (assq zoom-level shr-image-zoom-level-alist))) - (url-retrieve url #'shr-image-fetched - `(,(current-buffer) ,start - ,(set-marker (make-marker) end) - (:zoom ,zoom-level - :width ,(car dom-size) - :height ,(cdr dom-size))) - t))))) + (if (and (not shr-ignore-cache) + (url-is-cached url)) + (shr-replace-image (shr-get-image-data url) start + (set-marker (make-marker) end) flags) + (url-retrieve url #'shr-image-fetched + `(,(current-buffer) ,start + ,(set-marker (make-marker) end) + ,flags) + t)))))) ;;; Utility functions. @@ -1109,6 +1114,25 @@ the mouse click event." (expand-file-name (file-name-nondirectory url) directory))))) +(defun shr-replace-image (data start end &optional flags) + (save-excursion + (save-restriction + (widen) + (let ((alt (buffer-substring start end)) + (properties (text-properties-at start)) + ;; We don't want to record these changes. + (buffer-undo-list t) + (inhibit-read-only t)) + (remove-overlays start end) + (delete-region start end) + (goto-char start) + (funcall shr-put-image-function data alt flags) + (while properties + (let ((type (pop properties)) + (value (pop properties))) + (unless (memq type '(display image-zoom)) + (put-text-property start (point) type value)))))))) + (defun shr-image-fetched (status buffer start end &optional flags) (let ((image-buffer (current-buffer))) (when (and (buffer-name buffer) @@ -1119,23 +1143,7 @@ the mouse click event." (search-forward "\r\n\r\n" nil t)) (let ((data (shr-parse-image-data))) (with-current-buffer buffer - (save-excursion - (save-restriction - (widen) - (let ((alt (buffer-substring start end)) - (properties (text-properties-at start)) - ;; We don't want to record these changes. - (buffer-undo-list t) - (inhibit-read-only t)) - (remove-overlays start end) - (delete-region start end) - (goto-char start) - (funcall shr-put-image-function data alt flags) - (while properties - (let ((type (pop properties)) - (value (pop properties))) - (unless (memq type '(display image-zoom)) - (put-text-property start (point) type value))))))))))) + (shr-replace-image data start end flags))))) (kill-buffer image-buffer))) (defun shr-image-from-data (data) commit 208207c1c07fb4669c6b7d64c27236074f996ae4 Author: Jim Porter Date: Sun Jun 23 14:48:32 2024 -0700 Fix the different image zoom levels in SHR to work as expected * lisp/net/shr.el (shr-image-zoom-levels): New option. (shr-image-zoom-level-alist): New variable. (shr-zoom-image): Take POSITION and ZOOM-LEVEL arguments. Consult 'shr-image-zoom-levels'. (shr-put-image): Use 'shr-image-zoom-level-alist'. (shr-rescale-image): Only reset width *or* height when either is too large. (shr--image-zoom-original-size, shr--image-zoom-image-size) (shr--image-zoom-fill-height): New functions. * etc/NEWS: Announce this change. diff --git a/etc/NEWS b/etc/NEWS index 3e74d724f48..1af252e8a8f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -54,6 +54,11 @@ matter how large or small that was). Now, SHR slices any images taller than 'shr-sliced-image-height'. For more information, see the "(eww) Advanced" node in the EWW manual. +--- +*** You can now customize the image zoom levels to cycle through. +By customizing 'shr-image-zoom-levels', you can change the list of zoom +levels that SHR cycles through when calling 'shr-zoom-image'. + * New Modes and Packages in Emacs 31.1 diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 7e9a8c6d1c0..8b62691bfb6 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -219,6 +219,25 @@ interpreted as a multiple of the height of default font." :version "30.1" :type '(choice (const nil) (cons number number))) +(defcustom shr-image-zoom-levels '(fit original fill-height) + "A list of image zoom levels to cycle through with `shr-zoom-image'. +The first element in the list is the initial zoom level. Each element +can be one of the following symbols: + +* `fit': Display the image at its original size as requested by the + page, shrinking it to fit in the current window if necessary. +* `original': Display the image at its original size as requested by the + page. +* `image': Display the image at its full size (ignoring the width/height + specified by the HTML). +* `fill-height': Display the image zoomed to fill the height of the +current window." + :version "31.1" + :type '(set (choice (const :tag "Fit to window size" fit) + (const :tag "Original size" original) + (const :tag "Full image size" image) + (const :tag "Fill window height" fill-height)))) + (defvar shr-content-function nil "If bound, this should be a function that will return the content. This is used for cid: URLs, and the function is called with the @@ -621,35 +640,52 @@ the URL of the image to the kill buffer instead." (list (current-buffer) (1- (point)) (point-marker)) t)))) -(defun shr-zoom-image () - "Cycle the image size. +(defvar shr-image-zoom-level-alist + `((fit "Zoom to fit" shr-rescale-image) + (original "Zoom to original size" shr--image-zoom-original-size) + (image "Zoom to full image size" shr--image-zoom-image-size) + (fill-height "Zoom to fill window height" shr--image-zoom-fill-height)) + "An alist of possible image zoom levels. +Each element is of the form (SYMBOL DESC FUNCTION). SYMBOL is the +symbol identifying this level, as used by `shr-image-zoom-levels' (which +see). DESC is a string describing the level. + +FUNCTION is a function that returns a properly-zoomed image; it takes +the following arguments: + +* DATA: The image data in string form. +* CONTENT-TYPE: The content-type of the image, if any. +* WIDTH: The width as specified by the HTML \"width\" attribute, if any. +* HEIGHT: The height as specified by the HTML \"height\" attribute, if + any.") + +(defun shr-zoom-image (&optional position zoom-level) + "Change the zoom level of the image at POSITION. + The size will cycle through the default size, the original size, and full-buffer size." - (interactive) - (let ((url (get-text-property (point) 'image-url))) + (interactive "d") + (unless position (setq position (point))) + (let ((url (get-text-property position 'image-url))) (if (not url) (message "No image under point") - (let* ((end (or (next-single-property-change (point) 'image-url) + (unless zoom-level + (let ((last-zoom (get-text-property position 'image-zoom))) + (setq zoom-level (or (cadr (memq last-zoom shr-image-zoom-levels)) + (car shr-image-zoom-levels))))) + (let* ((end (or (next-single-property-change position 'image-url) (point-max))) (start (or (previous-single-property-change end 'image-url) (point-min))) - (dom-size (get-text-property (point) 'image-dom-size)) - (zoom (get-text-property (point) 'image-zoom)) - (next-zoom (cond ((or (eq zoom 'default) - (null zoom)) - 'original) - ((eq zoom 'original) - 'full) - ((eq zoom 'full) - 'default))) + (dom-size (get-text-property position 'image-dom-size)) (buffer-read-only nil)) ;; Delete the old picture. (put-text-property start end 'display nil) - (message "Inserting %s..." url) + (message "%s" (cadr (assq zoom-level shr-image-zoom-level-alist))) (url-retrieve url #'shr-image-fetched `(,(current-buffer) ,start ,(set-marker (make-marker) end) - (:zoom ,next-zoom + (:zoom ,zoom-level :width ,(car dom-size) :height ,(cdr dom-size))) t))))) @@ -1147,7 +1183,9 @@ You can specify the following optional properties: * `:height': The height of the image as specified by the HTML \"height\" attribute." (if (display-graphic-p) - (let* ((zoom (plist-get flags :zoom)) + (let* ((zoom (or (plist-get flags :zoom) + (car shr-image-zoom-levels))) + (zoom-function (nth 2 (assq zoom shr-image-zoom-level-alist))) (data (if (consp spec) (car spec) spec)) @@ -1155,22 +1193,15 @@ You can specify the following optional properties: (cadr spec))) (start (point)) (image (cond - ((eq zoom 'original) - (create-image data nil t :ascent shr-image-ascent - :format content-type)) ((eq content-type 'image/svg+xml) (when (image-type-available-p 'svg) (create-image data 'svg t :ascent shr-image-ascent))) - ((eq zoom 'full) - (ignore-errors - (shr-rescale-image data content-type - (plist-get flags :width) - (plist-get flags :height)))) - (t - (ignore-errors - (shr-rescale-image data content-type - (plist-get flags :width) - (plist-get flags :height))))))) + (zoom-function + (ignore-errors + (funcall zoom-function data content-type + (plist-get flags :width) + (plist-get flags :height)))) + (t (error "Unrecognized zoom level %s" zoom))))) (when image ;; The trailing space can confuse shr-insert into not ;; putting any space after inline images. @@ -1243,27 +1274,33 @@ width/height instead." (or max-height (- (nth 3 edges) (nth 1 edges)))))) (scaling (image-compute-scaling-factor image-scaling-factor))) - (when (or (and width - (> width max-width)) - (and height - (> height max-height))) - (setq width nil - height nil)) - (if (and width height - (< (* width scaling) max-width) - (< (* height scaling) max-height)) - (create-image - data (shr--image-type) t - :ascent shr-image-ascent - :width width - :height height - :format content-type) - (create-image - data (shr--image-type) t - :ascent shr-image-ascent - :max-width max-width - :max-height max-height - :format content-type))))) + (when (and width (> (* width scaling) max-width)) + (setq width nil)) + (when (and height (> (* height scaling) max-height)) + (setq height nil)) + (create-image + data (shr--image-type) t + :ascent shr-image-ascent + :width width + :height height + :max-width max-width + :max-height max-height + :format content-type)))) + +(defun shr--image-zoom-original-size (data content-type width height) + (create-image data (shr--image-type) t :ascent shr-image-ascent + :width width :height height :format content-type)) + +(defun shr--image-zoom-image-size (data content-type _width _height) + (create-image data nil t :ascent shr-image-ascent :format content-type)) + +(defun shr--image-zoom-fill-height (data content-type _width _height) + (let* ((edges (window-inside-pixel-edges + (get-buffer-window (current-buffer)))) + (height (truncate (* shr-max-image-proportion + (- (nth 3 edges) (nth 1 edges)))))) + (create-image data (shr--image-type) t :ascent shr-image-ascent + :height height :format content-type))) ;; url-cache-extract autoloads url-cache. (declare-function url-cache-create-filename "url-cache" (url)) commit 6d082f3c79269f00308d6e8b7d31d6a119376fe2 Author: Jim Porter Date: Sun Jun 23 12:25:25 2024 -0700 In SHR, keep track of image sizes as specified by the HTML Previously, these values got lost when zooming the image. * lisp/net/shr.el (shr-tag-img): Set 'image-dom-size'... (shr-zoom-image): ... use it. Rename 'size' to 'zoom'. (shr-image-fetched): Rename 'image-size' to 'image-zoom'. (shr-put-image): Accept the zoom level as ':zoom' and document it. Previously, FLAGS was a mix of alist and plist(!). * test/lisp/net/shr-tests.el (shr-test/zoom-image): Rename "size" to "zoom". diff --git a/lisp/net/shr.el b/lisp/net/shr.el index fe061adae29..7e9a8c6d1c0 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -633,13 +633,14 @@ full-buffer size." (point-max))) (start (or (previous-single-property-change end 'image-url) (point-min))) - (size (get-text-property (point) 'image-size)) - (next-size (cond ((or (eq size 'default) - (null size)) + (dom-size (get-text-property (point) 'image-dom-size)) + (zoom (get-text-property (point) 'image-zoom)) + (next-zoom (cond ((or (eq zoom 'default) + (null zoom)) 'original) - ((eq size 'original) + ((eq zoom 'original) 'full) - ((eq size 'full) + ((eq zoom 'full) 'default))) (buffer-read-only nil)) ;; Delete the old picture. @@ -648,7 +649,9 @@ full-buffer size." (url-retrieve url #'shr-image-fetched `(,(current-buffer) ,start ,(set-marker (make-marker) end) - ((size . ,next-size))) + (:zoom ,next-zoom + :width ,(car dom-size) + :height ,(cdr dom-size))) t))))) ;;; Utility functions. @@ -1095,7 +1098,7 @@ the mouse click event." (while properties (let ((type (pop properties)) (value (pop properties))) - (unless (memq type '(display image-size)) + (unless (memq type '(display image-zoom)) (put-text-property start (point) type value))))))))))) (kill-buffer image-buffer))) @@ -1132,9 +1135,19 @@ the mouse click event." (defun shr-put-image (spec alt &optional flags) "Insert image SPEC with a string ALT. Return image. SPEC is either an image data blob, or a list where the first -element is the data blob and the second element is the content-type." +element is the data blob and the second element is the content-type. + +FLAGS is a property list specifying optional parameters for the image. +You can specify the following optional properties: + +* `:zoom': The zoom level for the image. One of `default', `original', + or `full'. +* `:width': The width of the image as specified by the HTML \"width\" + attribute. +* `:height': The height of the image as specified by the HTML + \"height\" attribute." (if (display-graphic-p) - (let* ((size (cdr (assq 'size flags))) + (let* ((zoom (plist-get flags :zoom)) (data (if (consp spec) (car spec) spec)) @@ -1142,13 +1155,13 @@ element is the data blob and the second element is the content-type." (cadr spec))) (start (point)) (image (cond - ((eq size 'original) + ((eq zoom 'original) (create-image data nil t :ascent shr-image-ascent :format content-type)) ((eq content-type 'image/svg+xml) (when (image-type-available-p 'svg) (create-image data 'svg t :ascent shr-image-ascent))) - ((eq size 'full) + ((eq zoom 'full) (ignore-errors (shr-rescale-image data content-type (plist-get flags :width) @@ -1192,7 +1205,7 @@ element is the data blob and the second element is the content-type." ;; image slices. (overlay-put overlay 'face 'shr-sliced-image))) (insert-image image alt)) - (put-text-property start (point) 'image-size size) + (put-text-property start (point) 'image-zoom zoom) (when (and (not inline) shr-max-inline-image-size) (insert "\n")) (when (and shr-image-animate @@ -1907,6 +1920,7 @@ The preference is a float determined from `shr-prefer-media-type'." (put-text-property start (point) 'keymap shr-image-map) (put-text-property start (point) 'shr-alt alt) (put-text-property start (point) 'image-url url) + (put-text-property start (point) 'image-dom-size (cons width height)) (put-text-property start (point) 'image-displayer (shr-image-displayer shr-content-function)) (put-text-property start (point) 'help-echo diff --git a/test/lisp/net/shr-tests.el b/test/lisp/net/shr-tests.el index c813103b408..f8559df5272 100644 --- a/test/lisp/net/shr-tests.el +++ b/test/lisp/net/shr-tests.el @@ -172,14 +172,14 @@ settings, then once more for each (OPTION . VALUE) pair.") (shr-test-wait-for (lambda () (= put-image-calls 2)) "Timed out waiting to zoom image") ;; Check that we have a single image at original size. - (let (image-sizes) + (let (image-zooms) (goto-char (point-min)) (while (< (point) (point-max)) (when (get-text-property (point) 'display) - (push (get-text-property (point) 'image-size) image-sizes)) + (push (get-text-property (point) 'image-zoom) image-zooms)) (goto-char (or (next-single-property-change (point) 'display) (point-max)))) - (should (equal image-sizes '(original)))))))))) + (should (equal image-zooms '(original)))))))))) (require 'shr) commit 3ce7e4ee3f1f8bf85c2c455ac624bec6c7cd10a8 Author: Jim Porter Date: Sun Jun 23 12:18:57 2024 -0700 Slice images based on their height in SHR, not their zoom level * lisp/net/shr.el (shr-sliced-image-height): New option... (shr-put-image): ... use it. Compute the number of slices in relation to the image height; this way, each slice is roughly the height of a line of ordinary text. * test/lisp/net/shr-tests.el (shr-test/zoom-image): Update test, since zooming no longer necessarily triggers slicing. * doc/misc/eww.texi (Advanced): Document 'shr-sliced-image-proportion'. * etc/NEWS: Announce this change. diff --git a/doc/misc/eww.texi b/doc/misc/eww.texi index eec6b3c3299..e0c6b7d610b 100644 --- a/doc/misc/eww.texi +++ b/doc/misc/eww.texi @@ -373,6 +373,15 @@ customizing @code{shr-blocked-images}. @code{shr-inhibit-images}. If this variable is @code{nil}, display the ``ALT'' text of images instead. +@vindex shr-sliced-image-height + To make scrolling up/down past images more intuititve, EWW splits +large images into several rows. This way, you can scroll individually +past each slice, instead of jumping past the entire image. EWW slices +images that take up more than @code{shr-sliced-image-height} of the +height of the window they are displayed in. For example, a value of 0.7 +means that images are allowed to take up 70% of the height of the window +before being sliced. + @vindex shr-color-visible-distance-min @vindex shr-color-visible-luminance-min @cindex Contrast diff --git a/etc/NEWS b/etc/NEWS index 2b1534c31eb..3e74d724f48 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -43,6 +43,17 @@ applies, and please also update docstrings as needed. If 'whitespace-style' includes 'missing-newline-at-eof (which is the default), the 'whitespace-cleanup' function will now add the newline. +** SHR + ++++ +*** SHR now slices large images into rows. +Sliced images allow for more intuitive scrolling up/down by letting you +scroll past each slice, instead of jumping past the entire image. +Previously, SHR sliced images when zoomed to their original size, no +matter how large or small that was). Now, SHR slices any images taller +than 'shr-sliced-image-height'. For more information, see the "(eww) +Advanced" node in the EWW manual. + * New Modes and Packages in Emacs 31.1 diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 3dadcb9a09b..fe061adae29 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -58,6 +58,20 @@ fit these criteria." :version "24.1" :type 'float) +(defcustom shr-sliced-image-height 0.9 + "How tall images can be before slicing in relation to the window they're in. +A value of 0.7 means that images are allowed to take up 70% of the +height of the window before being sliced by `insert-sliced-image'. If +nil, never slice images. + +Sliced images allow for more intuitive scrolling up/down by letting you +scroll past each slice, instead of jumping past the entire image. +Alternately, you can use `pixel-scroll-precision-mode' to scroll +pixel-wise past images, in which case you can set this option to nil." + :version "31.1" + :type '(choice (const :tag "Never slice images") + float)) + (defcustom shr-allowed-images nil "If non-nil, only images that match this regexp are displayed. If nil, all URLs are allowed. Also see `shr-blocked-images'." @@ -1157,14 +1171,22 @@ element is the data blob and the second element is the content-type." (when (and (> (current-column) 0) (not inline)) (insert "\n")) - (let ((image-pos (point))) - (if (eq size 'original) + (let ((image-pos (point)) + image-height body-height) + (if (and shr-sliced-image-height + (setq image-height (cdr (image-size image t)) + body-height (window-body-height + (get-buffer-window (current-buffer)) + t)) + (> (/ image-height body-height 1.0) + shr-sliced-image-height)) ;; Normally, we try to keep the buffer text the same ;; by preserving ALT. With a sliced image, we have to ;; repeat the text for each line, so we can't do that. ;; Just use "*" for the string to insert instead. (progn - (insert-sliced-image image "*" nil 20 1) + (insert-sliced-image + image "*" nil (/ image-height (default-line-height)) 1) (let ((overlay (make-overlay start (point)))) ;; Avoid displaying unsightly decorations on the ;; image slices. diff --git a/test/lisp/net/shr-tests.el b/test/lisp/net/shr-tests.el index 54d85ee95f9..c813103b408 100644 --- a/test/lisp/net/shr-tests.el +++ b/test/lisp/net/shr-tests.el @@ -158,6 +158,7 @@ settings, then once more for each (OPTION . VALUE) pair.") (shr-width 80) (shr-use-fonts nil) (shr-image-animate nil) + (shr-sliced-image-height nil) (inhibit-message t) (dom (libxml-parse-html-region (point-min) (point-max)))) ;; Render the document. @@ -170,19 +171,15 @@ settings, then once more for each (OPTION . VALUE) pair.") (shr-zoom-image) (shr-test-wait-for (lambda () (= put-image-calls 2)) "Timed out waiting to zoom image") - ;; Check that we got a sliced image. - (let ((slice-count 0)) + ;; Check that we have a single image at original size. + (let (image-sizes) (goto-char (point-min)) (while (< (point) (point-max)) - (when-let ((display (get-text-property (point) 'display))) - ;; If this is nil, we found a non-sliced image, but we - ;; should have replaced that! - (should (assq 'slice display)) - (cl-incf slice-count)) + (when (get-text-property (point) 'display) + (push (get-text-property (point) 'image-size) image-sizes)) (goto-char (or (next-single-property-change (point) 'display) (point-max)))) - ;; Make sure we actually saw a slice. - (should (> slice-count 1))))))))) + (should (equal image-sizes '(original)))))))))) (require 'shr) commit fa6f088a483f1f2e19863800c6215a8136288b8f Author: Mattias Engdegård Date: Thu Jul 4 17:48:16 2024 +0200 ; * src/fns.c (fixnum_float_cmp): Explain argument constraint. Suggested by Pip Cet. diff --git a/src/fns.c b/src/fns.c index 61270f0a59f..fd80a0de480 100644 --- a/src/fns.c +++ b/src/fns.c @@ -3012,16 +3012,18 @@ bool_vector_cmp (Lisp_Object a, Lisp_Object b) return (d & aw) ? 1 : -1; } -/* Return -1 if ab, 0 if a=b or if b is NaN. */ +/* Return -1 if ab, 0 if a=b or if b is NaN (a must be a fixnum). */ static inline int fixnum_float_cmp (EMACS_INT a, double b) { double fa = (double)a; if (fa == b) { - /* This doesn't mean that a=b because the conversion may have - rounded, but b must be an integer that fits in an EMACS_INT - and we can compare in the integer domain instead. */ + /* This doesn't mean that a=b because the conversion may have rounded. + However, b must be an integer that fits in an EMACS_INT, + because |b| ≤ 2|a| and EMACS_INT has at least one bit more than + needed to represent any fixnum. + Thus we can compare in the integer domain instead. */ EMACS_INT ib = b; /* lossless conversion */ return a < ib ? -1 : a > ib; } commit 334d51322072caea8283f3735864bb83afeaabce (refs/remotes/origin/emacs-30) Author: Stefan Monnier Date: Thu Jul 4 11:47:01 2024 -0400 (edebug--called-interactively-skip): Fix bug#71934 * lisp/emacs-lisp/edebug.el (edebug--called-interactively-skip): Adjust to new interpreted functions. diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 381b7964a35..deebe5109bd 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -4577,10 +4577,9 @@ With prefix argument, make it a temporary breakpoint." (add-hook 'called-interactively-p-functions #'edebug--called-interactively-skip) (defun edebug--called-interactively-skip (i frame1 frame2) - (when (and (memq (car-safe (nth 1 frame1)) '(lambda closure)) + (when (and (interpreted-function-p (nth 1 frame1)) ;; Lambda value with no arguments. - (null (nth (if (eq (car-safe (nth 1 frame1)) 'lambda) 1 2) - (nth 1 frame1))) + (null (aref (nth 1 frame1) 0)) (memq (nth 1 frame2) '(edebug-enter edebug-default-enter))) ;; `edebug-enter' calls itself on its first invocation. (let ((s 1)) commit 0b061ab2ed250f068e4fd36ed6c1c8cb2102b83c Author: Mattias Engdegård Date: Thu Jul 4 15:39:32 2024 +0200 ; Strengthen value< tests slightly * test/src/fns-tests.el (fns-value<-ordered, fns-value<-unordered): Check equality and/or unordered results using lexicographic constructs. diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el index 8d39a1a56b8..decbdb6ac52 100644 --- a/test/src/fns-tests.el +++ b/test/src/fns-tests.el @@ -1672,7 +1672,11 @@ (should (value< x y)) (should-not (value< y x)) (should-not (value< x x)) - (should-not (value< y y)))) + (should-not (value< y y)) + (should (value< (vector x 2) (vector y 1))) + (should-not (value< (vector y 1) (vector x 2))) + (should (value< (vector x 1) (vector x 2))) + (should (value< (vector y 1) (vector y 2))))) (delete-process proc2) (delete-process proc1) @@ -1707,7 +1711,9 @@ (let ((x (car c)) (y (cdr c))) (should-not (value< x y)) - (should-not (value< y x)))))) + (should-not (value< y x)) + (should (value< (cons x 1) (cons y 2))) + (should-not (value< (cons x 2) (cons y 1))))))) (ert-deftest fns-value<-type-mismatch () ;; values of disjoint (incomparable) types commit f9f4f054bc15791ff63252e101dbf08bb4eb33c1 Author: Mattias Engdegård Date: Thu Jul 4 14:46:54 2024 +0200 Compare fixnums and floats accurately in value< Make `value<` compare fixnums and floats by value, as `<` does, instead of coercing the fixnum to a float first which is what C would do. This matters when the fixnum cannot be represented as a float. For example, C would evaluate 72057594037927935 < 72057594037927936.0 to false since the operands are converted to the same floating-point number. * src/fns.c (fixnum_float_cmp): New. (value_cmp): Use it. * test/src/fns-tests.el (fns-value<-ordered, fns-value<-unordered): New test cases. diff --git a/src/fns.c b/src/fns.c index 45567fc183a..61270f0a59f 100644 --- a/src/fns.c +++ b/src/fns.c @@ -3012,6 +3012,23 @@ bool_vector_cmp (Lisp_Object a, Lisp_Object b) return (d & aw) ? 1 : -1; } +/* Return -1 if ab, 0 if a=b or if b is NaN. */ +static inline int +fixnum_float_cmp (EMACS_INT a, double b) +{ + double fa = (double)a; + if (fa == b) + { + /* This doesn't mean that a=b because the conversion may have + rounded, but b must be an integer that fits in an EMACS_INT + and we can compare in the integer domain instead. */ + EMACS_INT ib = b; /* lossless conversion */ + return a < ib ? -1 : a > ib; + } + else + return fa < b ? -1 : fa > b; /* return 0 if b is NaN */ +} + /* Return -1, 0 or 1 to indicate whether ab in the sense of value<. In particular 0 does not mean equality in the sense of Fequal, only that the arguments cannot be ordered yet they can be compared (same @@ -3035,7 +3052,7 @@ value_cmp (Lisp_Object a, Lisp_Object b, int maxdepth) if (FIXNUMP (b)) return ia < XFIXNUM (b) ? -1 : 1; /* we know that a≠b */ if (FLOATP (b)) - return ia < XFLOAT_DATA (b) ? -1 : ia > XFLOAT_DATA (b); + return fixnum_float_cmp (ia, XFLOAT_DATA (b)); if (BIGNUMP (b)) return -mpz_sgn (*xbignum_val (b)); } @@ -3176,7 +3193,7 @@ value_cmp (Lisp_Object a, Lisp_Object b, int maxdepth) if (FLOATP (b)) return fa < XFLOAT_DATA (b) ? -1 : fa > XFLOAT_DATA (b); if (FIXNUMP (b)) - return fa < XFIXNUM (b) ? -1 : fa > XFIXNUM (b); + return -fixnum_float_cmp (XFIXNUM (b), fa); if (BIGNUMP (b)) { if (isnan (fa)) diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el index ca5b10db705..8d39a1a56b8 100644 --- a/test/src/fns-tests.el +++ b/test/src/fns-tests.el @@ -1606,6 +1606,13 @@ (1.5 . 1.6) (-1.3 . -1.2) (-13.0 . 12.0) ;; floats/fixnums (1 . 1.1) (1.9 . 2) (-2.0 . 1) (-2 . 1.0) + ;; fixnums that can't be represented as floats + (72057594037927935 . 72057594037927936.0) + (72057594037927936.0 . 72057594037927937) + (-72057594037927936.0 . -72057594037927935) + (-72057594037927937 . -72057594037927936.0) + (2305843009213693951 . 2305843009213693952.0) + ;; floats/bignums (,big . ,(float (* 2 big))) (,(float big) . ,(* 2 big)) ;; symbols @@ -1683,6 +1690,9 @@ ;; numbers (0 . 0.0) (0 . -0.0) (0.0 . -0.0) + (72057594037927936 . 72057594037927936.0) + (1 . 0.0e+NaN) + ;; symbols (a . #:a) commit 6e8b9ccaec284f934d990f6442cb3b9458a11bf5 Author: Eli Zaretskii Date: Thu Jul 4 10:59:45 2024 +0300 ; * lisp/ibuffer.el (ibuffer-mode): Doc fix. diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index c65213f5bde..c1e7788d2e8 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -2374,7 +2374,8 @@ In Ibuffer, you can conveniently perform many operations on the currently open buffers, in addition to filtering your view to a particular subset of them, and sorting by various criteria. -Operations on marked buffers: +Operations on marked buffers (see \"Marking commands\" below + for how to mark buffers): \\ \\[ibuffer-do-save] - Save the marked buffers. \\[ibuffer-do-view] - View the marked buffers in the selected frame. commit 3eaf1abbff8347c43fb0949bbe3806ab909cb54e Author: Eli Zaretskii Date: Wed Jul 3 22:13:42 2024 +0300 Fix MS-Windows build with native-compilation * src/w32.c (globals_of_w32): Move re-initialization of Vlibrary_cache from here... * src/emacs.c (main): ...to here, as it must be after load_pdump. (Bug#71916) diff --git a/src/emacs.c b/src/emacs.c index 74a46468933..7b315310873 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -2179,6 +2179,10 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem init_atimer (); #ifdef WINDOWSNT + /* We need to forget about libraries that were loaded during the + dumping process (e.g. libgccjit). This must be done _after_ + load_pdump. */ + Vlibrary_cache = Qnil; #ifdef HAVE_W32NOTIFY globals_of_w32notify (); #endif diff --git a/src/w32.c b/src/w32.c index 4986d4c6676..ab45ae8ec6b 100644 --- a/src/w32.c +++ b/src/w32.c @@ -10969,10 +10969,6 @@ globals_of_w32 (void) #endif w32_crypto_hprov = (HCRYPTPROV)0; - - /* We need to forget about libraries that were loaded during the - dumping process (e.g. libgccjit) */ - Vlibrary_cache = Qnil; } /* For make-serial-process */ commit fc375359edd514801816078e24b88fa02cfd91a6 Author: Andrea Corallo Date: Wed Jul 3 17:06:40 2024 +0200 Tag dbus-test05-register-signal-with-nils as unstable * test/lisp/net/dbus-tests.el (dbus-test05-register-signal-with-nils): Tag it as unstable. diff --git a/test/lisp/net/dbus-tests.el b/test/lisp/net/dbus-tests.el index b3337132fb6..a217c92b1f7 100644 --- a/test/lisp/net/dbus-tests.el +++ b/test/lisp/net/dbus-tests.el @@ -796,6 +796,7 @@ is in progress." "Check signal registration for an own service. SERVICE, PATH, INTERFACE and SIGNAL are ‘nil’. This is interpreted as a wildcard for the respective argument." + :tags '(:unstable) (skip-unless dbus--test-enabled-session-bus) (dbus-ignore-errors (dbus-unregister-service :session dbus--test-service)) commit 99230d7080ffc8310b5700b613f31184eafccbd2 Author: Eli Zaretskii Date: Wed Jul 3 21:06:27 2024 +0300 ; * src/w32fns.c (funhook): Restore mistakenly lost line. diff --git a/src/w32fns.c b/src/w32fns.c index 6090eb34e82..7fc2f598b3e 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -2705,6 +2705,7 @@ funhook (int code, WPARAM w, LPARAM l) inputs[1].ki.dwFlags = KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP; inputs[1].ki.time = 0; + SendInput (2, inputs, sizeof (INPUT)); } else if (focus != NULL) { commit 81a7358a33b1d94592ed29a42bb07f4a5b601d25 Merge: bd482b745aa b085d683962 Author: Eli Zaretskii Date: Wed Jul 3 13:55:13 2024 +0300 Merge branch 'emacs-30' of git.savannah.gnu.org:/srv/git/emacs into emacs-30 commit b085d683962b65d3e138950dd660779e398134fa Author: Yuan Fu Date: Wed Jul 3 00:31:16 2024 -0700 Fix treesit test (bug#71907) * test/src/treesit-tests.el (treesit-node-check): Re-parse buffer before checking for node outdated-ness. diff --git a/test/src/treesit-tests.el b/test/src/treesit-tests.el index ce5dc76794a..3431ba5f4dd 100644 --- a/test/src/treesit-tests.el +++ b/test/src/treesit-tests.el @@ -842,6 +842,7 @@ visible_end.)" 'missing)) (goto-char (point-max)) (insert "]") + (treesit-parser-root-node parser) (should (treesit-node-check array-node 'outdated)))) ;;; Defun navigation commit f39cf0beb74c092f8b6095f620ce8ea0680c5432 Author: Stefan Kangas Date: Wed Jul 3 02:02:31 2024 +0200 Focus more on MS-Windows than MS-DOS in FAQ * doc/misc/efaq.texi (Editing Windows files): Rename section from "Editing MS-DOS files", and update the text to focus on Windows. * doc/misc/efaq.texi (Colors on a TTY) (Emacs does not display 8-bit characters): Mention MS-Windows before MS-DOS. diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi index 93b3d48f6f1..f56888aac3f 100644 --- a/doc/misc/efaq.texi +++ b/doc/misc/efaq.texi @@ -1806,7 +1806,7 @@ is better to write ``Emacs and XEmacs.'' * Deleting menus and menu options:: * Turning on syntax highlighting:: * Scrolling only one line:: -* Editing MS-DOS files:: +* Editing Windows files:: * Filling paragraphs with a single space:: * Escape sequences in shell output:: * Start Emacs maximized:: @@ -1874,7 +1874,7 @@ customize, with completion. Colors and faces are supported in non-windowed mode, i.e., on Unix and GNU/Linux text-only terminals and consoles, and when invoked as -@samp{emacs -nw} on X, MS-DOS and MS-Windows. Emacs automatically +@samp{emacs -nw} on X, MS-Windows and MS-DOS. Emacs automatically detects color support at startup and uses it if available. If you think that your terminal supports colors, but Emacs won't use them, check the @code{termcap} entry for your display type for color-related @@ -3162,22 +3162,22 @@ Alternatively, use the following Lisp form in your init file (setq scroll-conservatively most-positive-fixnum) @end lisp -@node Editing MS-DOS files -@section How can I edit MS-DOS files using Emacs? -@cindex Editing MS-DOS files -@cindex MS-DOS files, editing +@node Editing Windows files +@section How can I edit Windows files using Emacs? @cindex Microsoft files, editing @cindex Windows files, editing +@cindex Editing MS-DOS files +@cindex MS-DOS files, editing -Detection and handling of MS-DOS (and Windows) files is performed -transparently. You can open MS-DOS files on a Unix system, edit it, +Detection and handling of Windows (and MS-DOS) files is performed +transparently. You can open Windows files on a Unix system, edit it, and save it without having to worry about the file format. -When editing an MS-DOS style file, the mode line will indicate that it -is a DOS file. On Unix and GNU/Linux systems, and also on a Macintosh, -the string @samp{(DOS)} will appear near the left edge of the mode line; -on DOS and Windows, where the DOS end-of-line (EOL) format is the -default, a backslash (@samp{\}) will appear in the mode line. +When editing a Windows style file, the mode line will indicate that it +is a Windows file. On GNU/Linux, Unix and macOS systems, the string +@samp{(DOS)} will appear near the left edge of the mode line; on Windows +and MS-DOS, where the DOS end-of-line (EOL) format is the default, a +backslash (@samp{\}) will appear in the mode line. @node Filling paragraphs with a single space @section How can I tell Emacs to fill paragraphs with a single space after each period? @@ -4540,7 +4540,7 @@ display or is invoked with @samp{emacs -nw}, you typically need to use @code{set-terminal-coding-system} to tell Emacs what the terminal can display, even after setting the language environment; otherwise non-@acronym{ASCII} characters will display as @samp{?}. On other operating -systems, such as MS-DOS and MS-Windows, Emacs queries the OS about the +systems, such as MS-Windows and MS-DOS, Emacs queries the OS about the character set supported by the display, and sets up the required terminal coding system automatically. commit d64396b8e427e883c47754b133d56cace1219f97 Author: Stefan Kangas Date: Mon Jul 1 05:14:25 2024 +0200 Autoload some string functions These functions are documented in both `(elisp) Creating Strings' and 'M-x shortdoc RET string RET', so users will expect them to be available without having to require 'subr-x'. * lisp/emacs-lisp/subr-x.el (string-fill, string-limit, string-pad) (string-chop-newline): Autoload. diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el index 699be767ee7..e62a08b7a8b 100644 --- a/lisp/emacs-lisp/subr-x.el +++ b/lisp/emacs-lisp/subr-x.el @@ -158,6 +158,7 @@ removed." (string-trim (replace-regexp-in-string blank " " string t t) blank blank))) +;;;###autoload (defun string-fill (string length) "Try to word-wrap STRING so that no lines are longer than LENGTH. Wrapping is done where there is whitespace. If there are @@ -172,6 +173,7 @@ result will have lines that are longer than LENGTH." (fill-region (point-min) (point-max))) (buffer-string))) +;;;###autoload (defun string-limit (string length &optional end coding-system) "Return a substring of STRING that is (up to) LENGTH characters long. If STRING is shorter than or equal to LENGTH characters, return the @@ -253,6 +255,7 @@ than this function." (end (substring string (- (length string) length))) (t (substring string 0 length))))) +;;;###autoload (defun string-pad (string length &optional padding start) "Pad STRING to LENGTH using PADDING. If PADDING is nil, the space character is used. If not nil, it @@ -272,6 +275,7 @@ the string." (start (concat (make-string pad-length (or padding ?\s)) string)) (t (concat string (make-string pad-length (or padding ?\s))))))) +;;;###autoload (defun string-chop-newline (string) "Remove the final newline (if any) from STRING." (declare (pure t) (side-effect-free t)) commit bd482b745aacebe083dc8177d09baff230864fe9 Merge: 28532599358 b5341831353 Author: Eli Zaretskii Date: Tue Jul 2 17:41:48 2024 +0300 Merge branch 'emacs-30' of git.savannah.gnu.org:/srv/git/emacs into emacs-30 commit 285325993580ad9c185d4b0e9b7a6a2703c91092 Merge: 5d2a115ab03 921d40759e5 Author: Eli Zaretskii Date: Tue Jul 2 14:08:58 2024 +0300 Merge branch 'emacs-30' of git.savannah.gnu.org:/srv/git/emacs into emacs-30 commit 5d2a115ab038fd509a06436a94c87b11a0882b18 Author: Eli Zaretskii Date: Mon Jul 1 21:58:17 2024 +0300 ; * src/fns.c (value_cmp): ASCIIfy. diff --git a/src/fns.c b/src/fns.c index 45567fc183a..cb3e25811ea 100644 --- a/src/fns.c +++ b/src/fns.c @@ -3033,7 +3033,7 @@ value_cmp (Lisp_Object a, Lisp_Object b, int maxdepth) { EMACS_INT ia = XFIXNUM (a); if (FIXNUMP (b)) - return ia < XFIXNUM (b) ? -1 : 1; /* we know that a≠b */ + return ia < XFIXNUM (b) ? -1 : 1; /* we know that a != b */ if (FLOATP (b)) return ia < XFLOAT_DATA (b) ? -1 : ia > XFLOAT_DATA (b); if (BIGNUMP (b))