* etc/themes/newcomers-presets-theme.el (newcomers-presets): Set
set-mark-command-repeat-pop, kill-do-not-save-duplicates,
help-window-select and window-combination-resize.
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.
When the new user option 'outline-use-comment-regexp' is non-nil,
enabling 'outline-minor-mode' configures 'outline-regexp',
'outline-level', and 'outline-search-function' to recognize outline
headings prefixed by a comment, such as ";;; *" and ";;; **". The
pattern comes from the buffer-local 'outline-comment-regexp' when set,
and otherwise from a default built from 'comment-start' and the new
option 'outline-comment-regexp-suffix'. The heading level is the
length of the regexp's group 1. The previous values are saved and
restored when the mode is disabled. All of the new code is kept in a
self-contained section at the end of outline.el.
* lisp/outline.el (outline-comment-regexp): New buffer-local variable.
(outline-comment-regexp-suffix, outline-use-comment-regexp): New user
options.
(outline--saved-outline-regexp, outline--saved-outline-level)
(outline--saved-outline-search-function, outline--comment-regexp): New
internal variables.
(outline--comment-level, outline--default-comment-regexp)
(outline--setup-from-comment-regexp, outline--restore-from-comment-regexp):
New functions.
(outline-minor-mode): Call 'outline--setup-from-comment-regexp' on
activation and 'outline--restore-from-comment-regexp' on deactivation.
* lisp/emacs-lisp/lisp-mode.el (lisp-mode-variables): Set
'outline-comment-regexp' to recognize ";;; *" headings.
* etc/NEWS: Announce the new options (bug#81054).
* 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.
* lisp/replace.el (query-replace-show-preview): Accept 'both'
and a function of two arguments as values. Doc fix.
(query-replace-preview-match): New face.
(replace-preview--propertize, replace-preview--format): New
functions.
(replace-preview-update): Use 'replace-preview--format'.
* etc/NEWS: Update the entry.
* lisp/emulation/viper-ex.el (ex-ambiguous-char-map): Add mapping
of ambiguous chars to their equivalents.
(ex-token-alist): Add list and number commands.
(ex-print, ex-print-display-lines): Add args to print line-numbers
or unambiguously.
* etc/NEWS: Document new ex commands. (Bug#81282)
* lisp/eshell/esh-cmd.el (eshell-lexical-binding): New option.
(eshell--eval): New defsubst...
(eshell-do-eval, eshell-exec-lisp):
* lisp/eshell/esh-var.el (eshell-parse-variable-ref):
* lisp/eshell/em-banner.el (eshell-banner-initialize): ... use it.
* lisp/eshell/em-ls.el (eshell-ls-applicable): Evaluate form using
lexical binding.
* test/lisp/eshell/esh-cmd-tests.el (esh-cmd-test--binding-check): New
function.
(esh-cmd-test/lexical-binding, esh-cmd-test/dynamic-binding): New tests.
* etc/NEWS: Announce this change.
;; * etc/ERC-NEWS: Revise wording from recent mechanical change.
* lisp/erc/erc-match.el (erc-match--opt-pat-cache, erc-pals, erc-fools):
Update doc.
(erc-dangerous-host-highlight-type): Remove nonsensical
`nick-or-mention' value introduced for ERC 5.7 and Emacs 32 via
bug#73798. It doesn't make sense to highlight mentions of a dangerous
host, only its associated nicknames, which ERC has no knowledge of.
(erc-match--opt-pat-get): Apply `sxhash-equal' to input in order to
protect keys from retroactive mutation. Otherwise, a user applying
`setcar' to a cached `erc-fools' value could corrupt the cache.
(erc-match-mention-beg-rx-sexp, erc-match-mention-any-rx-sexp): New
variables to expose how ERC looks for "addressees" in a message body.
(erc-match--opt-pat-make-addr-beg): Defer to
`erc-match-mention-beg-rx-sexp' variable for regexp.
(erc-match--opt-pat-make-addr-end, erc-match--opt-pat-make-addr-any):
Rename former to latter and use `erc-match-mention-any-rx-sexp' for
regexp.
(erc-match--user-nuh-or-mention-p): Use updated function name.
(erc-match-highlight-by-part): Use `match-data' to detect the "last
thing searched" by the predicate.
* test/lisp/erc/erc-match-tests.el
(erc-match-message/fool/nick-or-mention): Remove test associated with
nonexistent value `nick-or-mention' for option
`erc-dangerous-host-highlight-type'.
(erc-match--opt-pat-cache): Use updated function name, sort character
alternatives in bracket expression, update format of expected output to
include hashes.
;; (erc-match-tests--hl-type-nick)
;; (erc-match-message/fool/nick)
;; (erc-match-message/dangerous-host/nick/legacy)
;; (erc-match-tests--hl-type-message)
;; (erc-match-message/dangerous-host/message)
;; (erc-match-message/dangerous-host/message/legacy)
;; (erc-match-tests--hl-type-all)
;; (erc-match-message/fool/all)
;; (erc-match-message/dangerous-host/all/legacy)
;; (erc-match-tests--hl-type-nick-or-keyword)
;; (erc-match-tests--hl-type-keyword): Use realistic value for
;; option `erc-dangerous-hosts'.
Among other potential benefits, this makes e-p-m work correctly in all
comint-based modes.
* lisp/elec-pair.el (electric-pair-field-search-size): New variable.
(electric-pair-post-self-insert-function): Tweak, call
electric--pair-psif-1 (electric--pair-psif-1): New helper from old
electric-pair-post-self-insert-function.
* etc/NEWS: Call out change.
* lisp/comint.el (electric-pair-field-search-size): Forward declare.
(comint-mode): Set electric-pair-field-search-size to 1000.
* test/lisp/electric-tests.el (preserve-balance)
(preserve-balance-not-across-fields): New tests.
Co-authored-by: João Távora <joaotavora@gmail.com>
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.