* 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.
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.
* lisp/progmodes/cperl-mode.el (cperl--signature-rx): Allow for a
colon before a variable name to declare a named parameter
(cperl--sloppy-signature-rx): dito
(cperl-init-faces): dito
(introduction): Delete an obsolete comment
* test/lisp/progmodes/cperl-mode-tests.el
(cperl-test-signature-rx): Add a test case for a signature with
named parameters
(cperl-test-fontify-attrs-and-signatures): Verify correct
fontification of a named parameter
* test/lisp/progmodes/cperl-mode-resources/proto-and-attrs.pl: Add
test code for named signatures
* etc/NEWS: Announce Perl 5.44 syntax support
Replace flymake-show-diagnostics-at-end-of-line with a simpler, more
powerful flymake-inline-diagnostics. The new variable has an easier name
offers the new possibilities inspired by other packages, of having only
the current diagnostic be affected by each setting..
* doc/misc/flymake.texi: Update.
* etc/NEWS: Update
* lisp/progmodes/flymake.el (flymake-annotation-style): New variable.
(flymake-inline-annotation-face)
(flymake-error-inline, flymake-warning-inline)
(flymake-note-inline): New faces.
(flymake--highlight-line)
(flymake--handle-report)
(flymake-after-change-function): Update to use new variable name.
(flymake--update-current-eol-overlay): New helper.
(flymake--eol-current-overlay): New variable.
(flymake--update-all-eol-overlays): Rename from flymake--update-eol-overlays.
(flymake-make-report-fn): Keep point stable.
(flymake--update-eol-overlays): Tweak.
(flymake--eol-overlay-summary): Rewrite.
(flymake-mode): Set post-command-hook
(flymake--update-eol-overlays): Rework.
(flymake--update-eol-overlays-1): New helper.
(flymake-diagnostic-format-alist): Enhance.
(flymake--format-diagnostic): Handle old :eol value.
(flymake-inline-annotation-face)
(flymake-error-inline)
(flymake-warning-inline)
(flymake-note-inline): New faces.
(flymake-show-diagnostics-at-end-of-line)
(flymake-end-of-line-diagnostics-face)
(flymake-error-echo-at-eol)
(flymake-warning-echo-at-eol)
(flymake-note-echo-at-eol): Deprecate
(flymake--eol-draw-fancy): Tweak geometry slightly
* lisp/replace.el (query-replace-show-preview): New user option.
(query-replace-preview): New face.
(query-replace-eval-replacement-regexp): New constant, extracted
from...
(query-replace-compile-replacement): ...here.
(replace-preview-overlays): New variable.
(replace-preview-cleanup, replace-preview-update)
(replace-preview-setup): New functions.
(query-replace-read-to): New optional argument DELIMITED-FLAG.
(query-replace-read-args): Pass the delimited flag to
'query-replace-read-to'.
* lisp/isearch.el (isearch-query-replace): Pass the delimited
flag to 'query-replace-read-to'.
* test/lisp/replace-tests.el (replace-tests--preview): New
helper.
(replace-tests-preview-update, replace-tests-preview-cleanup)
(replace-tests-preview-disabled): New tests.
* doc/emacs/search.texi (Replace): Document the preview.
* etc/NEWS: Announce it.
Outline provides two search strategies to locate headings. If
`outline-search-function' is defined, it is used to find the headings.
Otherwise, `outline-regexp' is used. Reimplement `outline-occur' as
`outline-xref' using Xref and accepting a search function. This
supports both search strategies and ensures that the headings detected
by `outline-xref' match the Outline ones.
* lisp/outline.el (outline-mode-prefix-map): Update binding.
(outline-mode-menu-bar-map): Update menu item.
(outline-occur-regexp): Remove variable.
(outline-occur): Remove function.
(outline-xref--fetch-headings, outline-xref--show-xrefs, outline-xref):
New functions (bug#81579).
* test/lisp/outline-tests.el (outline-tests--outline-occur)
(outline-tests--outline-occur-override)
(outline-tests--outline-occur-undefined-regexp): Remove tests.
(outline-tests--outline-xref-search-function)
(outline-tests--outline-xref-regexp)
(outline-tests--outline-xref-undefined): New tests.
* lisp/speedbar.el (speedbar-directory-unshown-regexp)
(speedbar-file-unshown-regexp): New choice for nil to not hide
anything.
(speedbar-file-lists): Check that the user options
'speedbar-directory-unshown-regexp' and
'speedbar-file-unshown-regexp' are strings before using them.
Raise a user-error if their non-nil value is not a string.
* etc/NEWS: Announce the changes.
Add the `outline-occur' command that allows navigating the current
buffer's outline using Occur. Also add the
`display-buffer-default-alist' variable, which Lisp programs may
let-bind to specify conditional actions for nested `display-buffer'
calls.
* doc/lispref/windows.texi (Choosing Window)
(Precedence of Action Functions): Document
`display-buffer-default-alist' variable.
* etc/NEWS: Add `outline-occur' and `display-buffer-default-alist'
entries.
* lisp/outline.el (outline-mode-prefix-map): Bind `outline-occur'.
(outline-mode-menu-bar-map): Add `outline-occur' menu item.
(outline-occur-regexp): New buffer-local variable.
(outline-occur): New command.
* lisp/replace.el (occur-1): Call `display-buffer' with category.
* lisp/window.el (display-buffer-alist): Update docstring.
(display-buffer-default-alist): New variable.
(display-buffer): Handle `display-buffer-default-alist' variable.
* test/lisp/outline-resources/outline.txt: New test file.
* test/lisp/outline-tests.el: New test suite. (Bug#81512)
Co-authored-by: Martin Rudalics <rudalics@gmx.at>
Co-authored-by: Juri Linkov <juri@linkov.net>
* lisp/minibuffer.el (completion--icomplete-in-buffer-p):
New function.
(completion--do-completion, completion--in-region-1):
Use it (bug#81537).
* etc/NEWS: Say that NEWS.30 advice-add isn't needed anymore.
* lisp/icomplete.el (icomplete-in-buffer): Remove advice-add
instructions.
Change the default value from current-time-list from t to nil.
This continues the transition that was begun in Emacs 29, so
that functions like current-time generate timestamps in the
more-efficient and more-consistent (TICKS . HZ) form.
* src/timefns.c: Default to false.
* lisp/calendar/timeclock.el (timeclock-use-24hr-format): New defcustom.
(timeclock-time-format): New function.
(timeclock-status-string, timeclock-when-to-leave-string)
(timeclock-generate-report): Call timeclock-time-format to format
displayed times. (Bug#81440)
* etc/NEWS: Document the change.
* test/lisp/calendar/timeclock-tests.el: New file.
Create a version of 'pcase-let*' that signals an error when a 'pcase'
pattern does not match its corresponding value.
* lisp/emacs-lisp/pcase.el (pcase--let*): Add the optional argument
'strict' to generate code for signaling an error when a 'pcase'
pattern does not match its corresponding value.
* lisp/emacs-lisp/pcase.el (pcase-let*-strict): Add the new macro.
* test/lisp/emacs-lisp/pcase-tests.el (pcase-tests-let*-strict):
Add new test.
* etc/NEWS (Pcase): Add heading for 'pcase'.
* etc/NEWS (Add 'pcase-let*-strict'): Add news entry for new macro.
* lisp/woman.el (woman-topic-history): Make it an obsolete
variable alias.
(woman-file-name): Use 'Man-topic-history' instead of
'woman-topic-history' (bug#81347).
* etc/NEWS: Announce the change.
This overlapped with the existing support for a backend-specific
minor mode.
* lisp/vc/vc.el (dir-mode): Delete specification.
(vc-dir-mode): De-declare.
(vc-default-dir-mode): Delete.
* etc/NEWS: Update.
* lisp/vc/vc.el (dir-extra-hints, dir-mode): Specify new backend
methods.
(vc-dir-mode): Declare.
(vc-default-dir-mode, vc-default-dir-extra-hints): New
functions.
* lisp/vc/vc-dir.el (vc-dir-headers, vc-dir): Call the new
backend methods.
* lisp/cedet/ede.el (ede-turn-on-hook): Use derived-mode-p
instead of looking at major-mode directly.
* etc/NEWS: Document the new backend methods.
* lisp/mail/rmail.el (rmail-enable-multibyte): Remove it.
(rmail-mode): Do not bind 'rmail-enable-multibyte'. Do not make
the collection buffer multibyte. (Bug#81274)
(rmail-revert): Default 'coding-system-for-read' to
'no-conversion, as in 'rmail'; remove corresponding FIXME
comment.
(rmail-get-new-mail): Do not bind 'rmail-enable-multibyte'.
* lisp/files.el (auto-mode-alist): Add Rmail file pattern.
* lisp/international/mule-conf.el (file-coding-system-alist):
Add Rmail file pattern.
* doc/emacs/rmail.texi (Rmail Files): Document that "RMAIL" and
"*.rmail" files now visit in Rmail mode automatically.
* etc/NEWS: Announce the changes.
* test/lisp/mail/rmail-tests.el
(rmail-mode-makes-collection-buffer-unibyte): New test.
* lisp/emacs-lisp/elisp-scope.el
(elisp-scope--analyze-function-args): New helper function.
(elisp-scope-define-function-spec): New macro.
Convert simple function analyzers to use it.
* etc/NEWS: Announce it.
Many analyzers (those defined with
'elisp-scope-define-analyzer' and friends) are appropriate
for more than one function/macro. Before this commit, our
way of reusing an analyzer was to do this:
;; Define analyzer for `foo'
(elisp-scope-define-function-analyzer foo (...) ...)
;; Reuse it for `bar'
(put 'bar 'elisp-scope-analyzer #'elisp-scope--analyze-foo)
This isn't a good solution for users/packages that want to
reuse their custom analyzers, because it relies on too many
brittle internal implementation details.
This commit provides a nicer solution: we generalize the
analyzer-defining macros so they can take a list of symbols
and directly associated the defined analyzer with all of
the given symbols. So the above example is simplified to:
(elisp-scope-define-function-analyzer (foo bar) (...) ...)
* lisp/emacs-lisp/elisp-scope.el (elisp-scope-define-analyzer):
Accept either a symbol or a list of symbols, and register
the analyzer function for each symbol in the list (bug#81355).
(elisp-scope--define-function-analyzer)
(elisp-scope-define-function-analyzer)
(elisp-scope-define-macro-analyzer)
(elisp-scope-define-special-form-analyzer): Likewise.
Convert all call sites that used to register extra symbols
via separate 'put' calls to use this new feature instead.
* etc/NEWS: Announce it.
* lisp/vc/log-edit.el (log-edit-insert-changelog-entry): New function.
(log-edit-insert-changelog-entries): Use it when all log entries
come from the same ChangeLog file or buffer.
* test/lisp/vc/vc-tests/vc-test-misc.el
(vc-test-log-message-from-changelog): New test.
* doc/emacs/maintaining.texi (VC With A Merging VCS):
(Log Buffer): Document improved creation of commit messages from
ChangeLog. Improve documentation of *vc-log* header lines.
Document 'log-edit-hook'.
(VC Directory Commands): Correct documentation of 'M' and 'U'.
Document determination of current VC fileset without marking.
(Format of ChangeLog): Improve documentation of multi-item entries.
* etc/NEWS: Announce user-facing changes.
* configure.ac (emacs_cv_android_x_or_later): Rename from
`emacs_cv_android_w_or_later', and test for attributes of
Android 17.
* doc/emacs/android.texi (Android Environment): Document new
permission `ACCESS_LOCAL_NETWORK'.
* java/AndroidManifest.xml.in: Declare permission
android.permission.ACCESS_LOCAL_NETWORK to re-enable Emacs to
access local network devices. Update `targetSdkVersion' to 37.
* java/INSTALL: Document new build-time requirements and
compatibility with recent build-tools releases.
* java/org/gnu/emacs/EmacsFillPolygon.java (perform): Use
non-deprecated variant of `Path#computeBounds'.
* src/android-asset.h (struct AAsset): <bytes_read>: New field.
(AAssetManager_open): Clear exceptions if no asset fd could be
created.
(android_asset_read_internal): Cast `buffer' to (jbyte *).
Record number of bytes read from the InputStream.
(AAsset_seek): Attempt to satisfy seek operations which do not
modify the file pointer.
* lisp/emacs-lisp/ewoc.el (ewoc--set-buffer-bind-dll-let*): New
debug declaration.
(ewoc-set-hf): Make it possible to set only the header or
footer.
* lisp/vc/vc-dir.el (vc-dir--set-header): New RESET-FOOTER
parameter.
(vc-dir-refresh): Pass it.
(vc-dir-process-output-limit): New variable.
(vc-dir-show-more-button)
(vc-dir-maybe-narrow-and-show-more-button): New functions.
* lisp/vc/vc-bzr.el (vc-bzr-dir-status-files):
* lisp/vc/vc-cvs.el (vc-cvs-dir-status-files):
* lisp/vc/vc-git.el (vc-git-dir-status-goto-stage):
* lisp/vc/vc-hg.el (vc-hg-dir-status-files):
* lisp/vc/vc-svn.el (vc-svn-dir-status-files): Preserve a
binding of vc-dir-process-output-limit in the delayed process.
Call vc-dir-maybe-narrow-and-show-more-button.
* lisp/vc/vc.el (dir-status-files):
* etc/NEWS: Document the change.