* lisp/replace.el (replace-preview--input): New function.
(replace-preview-update): Add optional START and END, and
preview only the matches between them.
(replace-preview-setup): Accept a nil FROM, read from the
minibuffer along with the replacement, and add optional
BACKWARD. Limit the preview to the part of the buffer that the
replacement will cover.
(query-replace-read-to): Add optional BACKWARD and pass it on.
(query-replace-read-args): Preview the replacement while reading
FROM as well, and preview nothing when the caller asks for no
highlighting.
* lisp/isearch.el (isearch-query-replace): Pass BACKWARD to
`query-replace-read-to'.
* test/lisp/replace-tests.el (replace-tests--preview): Add START
and END.
(replace-tests-preview-bounds, replace-tests-preview-input): New
tests.
* doc/emacs/search.texi (Replace): Document the above.
* lisp/replace.el (query-replace-show-preview): Accept the
symbols `replacement-only' and `both'. Update the :type
accordingly, which also fixes the name of a function that does
not exist.
(query-replace-preview-match): Update the doc string.
(replace-preview-both, replace-preview-replacement-only): Say
which value of the option calls them.
(replace-preview--format): Dispatch on the new values, and still
call a function value.
(replace-preview-setup): Test the option for non-nil instead of
testing it with `functionp'.
* test/lisp/replace-tests.el (replace-tests--preview)
(replace-tests-preview-both, replace-tests-preview-cleanup)
(replace-tests-preview-disabled): Use the new values.
* doc/emacs/search.texi (Replace): Document the new values.
Suggested by Juri Linkov <juri@linkov.net>.
* lisp/replace.el (query-replace-show-preview): Drop the values
t and 'both' in favor of the two functions that implement them.
(query-replace-preview-match): Doc fix.
(replace-preview-propertize): Rename from
'replace-preview--propertize' and make it public, so that the
preview functions can be copied and adapted.
(replace-preview-only-replacement, replace-preview-both): New
functions.
(replace-preview--format): Call the value of
'query-replace-show-preview'.
(replace-preview-setup): Preview only if the value is a
function.
* etc/NEWS: Update the entry.
* doc/emacs/search.texi (Replace): Document the new values.
* test/lisp/replace-tests.el (replace-tests--preview)
(replace-tests-preview-cleanup, replace-tests-preview-disabled)
(replace-tests-preview-invisible-match): Use the new functions.
(replace-tests-preview-both, replace-tests-preview-function):
New tests.
* lisp/calc/calc-forms.el (math-tzone-names): Use
make-obsolete-variable instead of merely saying in the doc string
that the variable is obsolete. Move the doc for this
obsolete variable here, from the manual.
* lisp/progmodes/xref.el: Change the proposed bindings from M-' to M-g M-.
* lisp/menu-bar.el (menu-bar-goto-menu): Add menu item.
* doc/emacs/maintaining.texi: Update the binding.
* etc/NEWS: Document the commant.
The manuals in doc/emacs, doc/lispintro and doc/lispref have no
translations, so filtering the per-directory language list by DOCLANGS
left those directories with nothing to build when DOCLANGS does not
include 'default'. These three manuals must be built and installed
regardless of DOCLANGS: the Emacs and Emacs Lisp manuals are
referenced from doc strings, and the Introduction to Emacs Lisp
Programming is an important enough part of Emacs to be available
whatever the language preferences of the user who builds the manuals.
* Makefile.in (MANDATORY_DOC_DIRS): New variable.
(FILTER_DOCLANGS): Use it to always build the default language for
those directories.
(INFO_NONMISC, srcdir_doc_info_dir_inputs): Say why these are not
gated by DOCLANGS.
* doc/translations/README: Document that those three manuals are
always built in the default language.
* doc/misc/tramp.texi (Auto-save File Lock and Backup): Adapt example.
* doc/misc/trampver.texi:
* lisp/net/trampver.el: Change version to "2.8.3-pre".
* lisp/net/tramp-cmds.el (tramp-file-name-with-sudo): Expand the
result for consistency. (Bug#81622)
* lisp/net/tramp.el (with-tramp-progress-reporter):
Let-bind `inhibit-message'.
(tramp-file-name-for-operation): Fix the case, that the first
argument is a process name.
(tramp-handle-find-backup-file-name): Use connection-local value
of `make-backup-files'.
* test/lisp/net/tramp-tests.el (tramp-test38-find-backup-file-name):
Extend test.
* doc/misc/url.texi: Synchronize function signatures with code. Fix
formatting for variable. Remove superfluous space. Link directly to
referenced CL manual node. (Bug#81505)
This is implemented with a slightly-different syntax via Lisp pipelines.
* doc/misc/eshell.texi (Bugs and ideas): Remove idea about "output
translators".
Canvas images support efficient updating and refreshing. An image
specifier with ':type canvas' creates a canvas image. The canvas has an
associated writable pixel buffer. After changing the ':data' vector or
writing to the pixel buffer a call to 'canvas-refresh' redraws the
canvas image. See bug#80281.
Co-Authored-By: Divya Ranjan <divya@subvertising.org>
Co-Authored-By: Daniel Mendler <mail@daniel-mendler.de>
Canvas changes:
* doc/lispref/display.texi (Images): Add Canvas Images to menu.
(Canvas Images): New node documenting canvas image objects, the
`:data-width', `:data-height', `:data' and `:file' properties, and
`canvas-refresh'.
* doc/lispref/elisp.texi (Top): Reference new Canvas Images node.
* doc/lispref/internals.texi (Writing Dynamic Modules): Add Module
Canvas API to menu.
(Module Canvas API): New node documenting `canvas_data' module function.
* etc/NEWS: Announce the addition.
* lisp/image.el (create-image): Add `:id' to image specification of
canvas images.
* src/dispextern.h (struct image): Add `refresh', `original_width' and
`original_height' fields.
(redraw_image_glyphs, canvas_data): New prototypes.
* src/emacs-module.c (module_canvas_data): New function.
(initialize_environment): Register `canvas_data' module function.
* src/image.c (struct canvas): New struct for canvas.
(canvas_prepare_for_display, canvas_free_unused): New forward
declarations.
(prepare_image_for_display): Call `canvas_prepare_for_display' when the
canvas refresh counter has changed. Set image `original_width' and
`original_height'.
(filter_image_spec): Exclude `:data' from the image cache key for canvas
images, so mutating the data vector in place does not create a new cache
entry.
(Fclear_image_cache): Call `canvas_free_unused'.
(image_set_transform): Use CAIRO_FILTER_GOOD instead of
CAIRO_FILTER_BEST for canvas images, for performance. Do not set image
`original_width' and `original_height'.
(canvas_image_p, canvas_free_unused, canvas_apply_data, canvas_get)
(canvas_parse, canvas_load, canvas_prepare_for_display, canvas_data):
New functions implementing canvas creation, resizing, and reloading of
`:data' or `:file' content.
(Fcanvas_refresh): New defun `canvas-refresh', with an optional
RELOAD-DATA argument to reread `:data' or `:file'.
(initialize_image_type, syms_of_image): Register the `canvas' image type
and `canvas-refresh'.
* src/module-env-32.h (canvas_data): New prototype.
* src/nsimage.m (ns_image_reset): New function to recreate an NS pixmap
to update the canvas.
* src/nsterm.h: Add prototype for `ns_image_reset'.
* src/xdisp.c (redraw_image_glyphs_window)
(redraw_image_glyphs_window_tree, redraw_image_glyphs): New functions to
redraw only the glyphs referencing a given canvas image spec, falling
back to a full frame redraw if the frame is garbaged.
* test/src/emacs-module-resources/mod-test.c (mod-test-canvas-read)
(mod-test-canvas-write, mod-test-canvas-invalid): New helper functions.
* test/src/emacs-module-tests.el (test-canvas-gen-file)
(mod-test-canvas/valid, mod-test-canvas/invalid, mod-test-canvas/vector)
(mod-test-canvas/vector-reload, mod-test-canvas/unibyte)
(mod-test-canvas/file, mod-test-canvas/gc-stress): New tests.