1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-29 07:58:28 +00:00
Commit Graph

13119 Commits

Author SHA1 Message Date
Mattias Engdegård
734bd005aa Faster JSON parsing
Speed up JSON parsing substantially by only UTF-8-parsing string
literals and only exactly once.  Previously, json-parse-string always
first parsed the entire input and copied it to a new string, and then
validated each string literal twice.

We no longer create an extra new string when interning an alist key,
nor do we garble plist keys with Unicode characters.

* src/lread.c (intern_c_multibyte): New.
* src/json.c (json_encode): Remove.
(utf8_error): New.
(json_parse_string): Faster and more careful UTF-8 decoding.
Create and return a new multibyte string or symbol without extra
decoding.  All callers adapted.
(Fjson_parse_string): Skip expensive input pre-decoding.
* test/src/json-tests.el (json-parse-string/object-unicode-keys)
(json-parse-string/short): New.
(json-parse-string/string, json-parse-string/invalid-unicode):
Adapt tests.
* etc/NEWS: Mentioned change in errors.
2024-04-01 10:41:46 +02:00
Stefan Monnier
0f504dde33 (scheme-syntax-propertize-sexp-comment): Handle nested sexp-comments
Well, I'm not completely sure this will work right in all cases,
because I've been confused about this in the past.
It works in my test case, at least.

* lisp/progmodes/scheme.el (scheme-syntax-propertize-sexp-comment):
Look for nested `#;` and mark them appropriately.
2024-04-01 02:14:13 -04:00
niceume
02c2a95a52 scheme.el: Enable dealing with regular expression literal
* lisp/progmodes/scheme.el (scheme-syntax-propertize-regexp): New function.
(scheme-syntax-propertize): Use it.
2024-04-01 01:23:18 -04:00
Eshel Yaron
de8cae30bc
Add global minor mode 'global-completion-preview-mode'
This is a global variant of 'completion-preview-mode'.

* lisp/completion-preview.el (global-completion-preview-mode): New
global minor mode.

* doc/emacs/programs.texi (Symbol Completion): Document it.

* etc/NEWS: Announce it.  (Bug#70010)
2024-03-31 09:32:50 +02:00
Eli Zaretskii
994bcc125b Fix the new PEG library
* doc/lispref/peg.texi (Parsing Expression Grammars)
(PEX Definitions, Parsing Actions, Writing PEG Rules): Fix markup,
indexing, and wording.

* etc/NEWS: Fix wording of PEG entry.

* test/lisp/progmodes/peg-tests.el: Move from test/lisp/, to match
the directory of peg.el.
2024-03-31 10:29:34 +03:00
Eric Abrahamsen
8bee4060ea Add peg.el as a built-in library
* lisp/progmodes/peg.el: New file, taken from ELPA package.
* test/lisp/peg-tests.el: Package tests.
* doc/lispref/peg.texi: Documentation.
2024-03-30 15:19:47 -07:00
Mattias Engdegård
1135ce461d Always enable native JSON support and remove Jansson references
* src/json.c (Fjson__available_p): Remove.
* lisp/subr.el (json-available-p): Always return t.
* admin/nt/dist-build/build-dep-zips.py:
* configure.ac:
* doc/lispref/text.texi (Parsing JSON):
* java/INSTALL:
* java/org/gnu/emacs/EmacsNative.java (EmacsNative):
* lisp/term/w32-win.el (dynamic-library-alist):
* m4/ndk-build.m4 (ndk_INIT):
* msdos/sed1v2.inp:
* nt/INSTALL:
* nt/INSTALL.W64:
* src/Makefile.in:
* src/emacs.c (main):
* src/lisp.h:
Remove JSON configuration options and references to it and Jansson from
documentation and build files.
* etc/NEWS: Announce.
2024-03-30 15:19:56 +01:00
Tony Zorman
77115be256 Add use-package-vc-prefer-newest user option
* lisp/use-package/use-package-core.el (use-package-vc-prefer-newest):
User option to prefer the latest commit (as opposed to the latest
release) of a package.
(use-package-normalize--vc-arg): Check for
use-package-vc-prefer-newest.

* doc/misc/use-package.texi (Install package): Document
use-package-vc-prefer-newest.

* etc/NEWS: Document use-package-vc-prefer-newest.
2024-03-30 13:49:21 +01:00
Eli Zaretskii
826998e82f Merge from origin/emacs-29
ae8f815613 Update files for Emacs 29.3
2024-03-30 04:37:43 -04:00
Eli Zaretskii
cd60fa42f6 Merge from origin/emacs-29
7a5d7be52c org--confirm-resource-safe: Fix prompt when prompting in ...
2bc865ace0 org-file-contents: Consider all remote files unsafe
6f9ea396f4 org-latex-preview: Add protection when `untrusted-content...
937b9042ad * lisp/gnus/mm-view.el (mm-display-inline-fontify): Mark ...
ccc188fcf9 * lisp/files.el (untrusted-content): New variable.
befa9fcaae org-macro--set-templates: Prevent code evaluation
3221d8d461 * admin/authors.el (authors-aliases): Add ignored authors.
8d8253f899 * etc/NEWS: Update for Emacs 29.3
2024-03-30 04:35:24 -04:00
Mattias Engdegård
cbd862865f Remove sort-on (bug#69709)
* lisp/sort.el (sort-on):
* doc/lispref/sequences.texi (Sequence Functions):
* etc/NEWS:
Remove the `sort-on` function which is now completely superseded by
the extended `sort` in features, ease of use, and performance.
2024-03-29 11:39:38 +01:00
Mattias Engdegård
ae5f2c02bd New sort keyword arguments (bug#69709)
Add the :key, :lessp, :reverse and :in-place keyword arguments.
The old calling style remains available and is unchanged.

* src/fns.c (sort_list, sort_vector, Fsort):
* src/sort.c (tim_sort):
Add keyword arguments with associated new features.
All callers of Fsort adapted.
* test/src/fns-tests.el (fns-tests--shuffle-vector, fns-tests-sort-kw):
New test.
* doc/lispref/sequences.texi (Sequence Functions): Update manual.
* etc/NEWS: Announce.
2024-03-29 11:39:38 +01:00
Mattias Engdegård
1232ab31c6 Add value< (bug#69709)
It's a general-purpose polymorphic ordering function, like `<` but
for any two values of the same type.

* src/data.c (syms_of_data): Add the `type-mismatch` error.
(bits_word_to_host_endian): Move...
* src/lisp.h (bits_word_to_host_endian): ...here, and declare inline.
* src/fns.c (Fstring_lessp): Extract the bulk of this function to...
(string_cmp): ...this 3-way comparison function, for use elsewhere.
(bool_vector_cmp, value_cmp, Fvaluelt): New.
* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns, pure-fns):
Add `value<`, which is pure and side-effect-free.
* test/src/fns-tests.el (fns-value<-ordered, fns-value<-unordered)
(fns-value<-type-mismatch, fns-value<-symbol-with-pos)
(fns-value<-circle, ert-deftest fns-value<-bool-vector): New tests.
* doc/lispref/sequences.texi (Sequence Functions):
* doc/lispref/numbers.texi (Comparison of Numbers):
* doc/lispref/strings.texi (Text Comparison):
Document the new value< function.
* etc/NEWS: Announce.
2024-03-29 11:39:38 +01:00
Eli Zaretskii
f021c3dbcd ; * etc/NEWS: Announce new feature of Proced. (Bug#69784) 2024-03-28 11:50:22 +02:00
Stefan Monnier
004f2493a5 cl-preloaded.el: Fix the type lattice
We generally want types to form not just a DAG but a lattice.
If objects can be both `keyword` and `symbol-with-pos`, this
means there should be a more precise type describing this intersection.
If we ever find the need for such a refinement, we could add
such a `keyword-with-pos` type, but here I took the simpler
route of treating `keyword` not as a proper built-in type but
as a second-class type like `natnum`.

While fixing this problem, also fix the problem we had where
`functionp` was not quite adequate to characterize objects of type
`function`, by introducing a new predicate `cl-functionp` for that.

* lisp/emacs-lisp/cl-preloaded.el (cl-functionp): New function.
(function): Use it.
(keyword): Don't declare it as a built-in type.
(user-ptrp): Remove redundant declaration.

* lisp/emacs-lisp/cl-generic.el (cl--generic--unreachable-types):
Delete constant.
(cl-generic-generalizers): Remove corresponding test.

* lisp/emacs-lisp/cl-macs.el (cl-deftype-satisfies): Add entry for
`keyword` type.

* lisp/emacs-lisp/comp.el (comp-known-predicates): Fix type for
negative result of `characterp`.  Remove duplicate `numberp` entry.
Fix types for `keywordp` now that `keyword` is not a built-in type any more.

* test/src/data-tests.el (data-tests--cl-type-of): Add a few cases.
Remove workaround for `function`.
2024-03-26 13:14:15 -04:00
Eli Zaretskii
a79b424f7f Document the 'I' command in buffer-menu
* doc/emacs/buffers.texi (Several Buffers): Document 'I'.  Fix
indexing.
(List Buffers): Mention 'I'.  (Bug#69987)

* etc/NEWS: Mark 'I' as documented.
2024-03-25 14:53:23 +02:00
Eli Zaretskii
ae8f815613 Update files for Emacs 29.3
* ChangeLog.4:
* etc/AUTHORS:
* etc/HISTORY: Update for Emacs 29.3.
2024-03-24 09:37:03 -04:00
Eli Zaretskii
8d8253f899 * etc/NEWS: Update for Emacs 29.3 2024-03-24 08:19:29 -04:00
Joseph Turner
79c758187c Recompute :map when image :scale, :rotation, or :flip changes
Now, when transforming an image, its :map is recomputed to fit.
Image map coordinates are integers, so when computing :map,
coordinates are rounded.  To prevent an image from drifting from
its map after repeated transformations, 'create-image' now adds
a new image property :original-map, which is combined with the
image's transformation parameters to recompute :map.

* lisp/image.el (image-recompute-map-p): Add user option to
control whether :map is recomputed when an image is transformed.
(create-image): Create :map from :original-map and vice versa.
(image--delayed-change-size): Fix comment.
(image--change-size, image-rotate, image-flip-horizontally,
image-flip-vertically): Recompute image map after transformation
and mention 'image-recompute-map-p' in docstring.
(image--compute-map): Add function to compute a map from original
map.
(image--compute-original-map): Add function to compute an
original map from map.
(image--scale-map): Add function to scale a map based on :scale.
(image--rotate-map): Add function to rotate a map based on
:rotation.
(image--rotate-coord): Add function to rotate a map coordinate
pair.
(image--flip-map): Add function to flip a map based on :flip.
(image-increase-size, image-decrease-size, image-mouse-increase-size)
(image-mouse-decrease-size): Mention 'image-recompute-map-p' in
docstrings.
* etc/NEWS: Add NEWS entry.
* doc/lispref/display.texi (Image Descriptors): Document :original-map
and new user option 'image-recompute-map-p'.
* test/lisp/image-tests.el (image--compute-map-and-original-map):
Test 'image--compute-map' and 'image--compute-original-map'.
(image-tests--map-equal): Add equality predicate to compare image maps.
(image-create-image-with-map): Test that 'create-image' adds :map
and/or :original-map as appropriate.
(image-transform-map): Test functions related to transforming maps.
(Bug#69602)
2024-03-23 19:54:53 +02:00
Jim Porter
4b0f5cdb01 Add 'eww-readable-urls'
* lisp/net/eww.el (eww-readable-urls): New option.
(eww-default-readable-p): New function...
(eww-display-html): ... use it.

* test/lisp/net/eww-tests.el (eww-test/readable/default-readable): New
test.

* doc/misc/eww.texi (Basics): Document 'eww-readable-urls'.

* etc/NEWS: Announce this change (bug#68254).
2024-03-23 10:17:06 -07:00
Jim Porter
72972118e6 Allow toggling "readable" mode in EWW
Additionally, add an option to prevent adding a new history entry for
each call of 'eww-readable' (bug#68254).

* lisp/net/eww.el (eww-retrieve):

* lisp/net/eww.el (eww-readable-adds-to-history): New option.
(eww-retrieve): Make sure we call CALLBACK in all configurations.
(eww-render): Simplify how to pass encoding.
(eww--parse-html-region, eww-display-document): New functions, extracted
from...
(eww-display-html): ... here.
(eww-document-base): New function.
(eww-readable): Toggle "readable" mode interactively, like with a minor
mode.  Consult 'eww-readable-adds-to-history'.
(eww-reload): Use 'eshell-display-document'.

* test/lisp/net/eww-tests.el (eww-test--with-mock-retrieve): Fix indent.
(eww-test/display/html, eww-test/readable/toggle-display): New tests.

* doc/misc/eww.texi (Basics): Describe the new behavior.

* etc/NEWS: Announce this change.
2024-03-23 10:17:06 -07:00
Spencer Baugh
abc2d39e01 Use 'regexp-opt' in 'dired-omit-regexp'
In my benchmarking, for large dired buffers, using 'regexp-opt'
provides around a 3x speedup in omitting.

'regexp-opt' takes around 5 milliseconds, so to avoid slowing
down omitting in small dired buffers we cache the return value.

Since omitting is now 3x faster, increase 'dired-omit-size-limit'
by 3x.  Also, document 'dired-omit-size-limit' better.

* doc/misc/dired-x.texi (Omitting Variables): Document
'dired-omit-size-limit'.
* etc/NEWS: Announce increase of 'dired-omit-size-limit'.
* lisp/dired-x.el (dired-omit--extension-regexp-cache): Add.
(dired-omit-regexp): Use 'regexp-opt'.  (Bug#69775)
(dired-omit-size-limit): Increase and improve docs.
2024-03-23 19:07:49 +02:00
Stefan Monnier
3197d7015b etc/NEWS: Document the new behavior of describe-function
I pushed commit accd79c939 by accident.
Related to bug#69935
2024-03-22 17:03:15 -04:00
Stefan Monnier
a1f8702e83 (help-fns-function-name): New function
Consolidate code used in profiler and help--describe-command,
and improve it while we're at it.
Also use #' to quote a few function names along the way.

* lisp/help-fns.el (help-fns--function-numbers, help-fns--function-names):
New vars.
(help-fns--display-function): New aux function.
(help-fns-function-name): New function, inspired from
`help--describe-command`.

* lisp/help.el (help--describe-command): Use `help-fns-function-name`.
(help--for-help-make-sections): Remove redundant "" arg to `mapconcat`.

* lisp/profiler.el (profiler-format-entry, profiler-fixup-entry):
Delete functions.
(profiler-report-make-entry-part): Use `help-fns-function-name` instead.
(profiler-report-find-entry): Use `push-button`.

* lisp/transient.el (transient--debug): Use `help-fns-function-name`
when available.
2024-03-21 19:40:20 -04:00
Adam Porter
393f58c85a 'vtable-update-object' can now be called with one argument
It's often necessary to update the representation of a single
object in a table (e.g a struct, whose identity does not change
when its slots'
values are changed).  To do so, now the function may be called
like this:

  (vtable-update-object table object)

Instead of like this:

  (vtable-update-object table object object)

This also documents the behavior of the just-discovered limitation filed
as bug#69837.
* lisp/emacs-lisp/vtable.el (vtable-update-object): Make 'old-object'
argument optional.  (Bug#69666)

* doc/misc/vtable.texi (Interface Functions): Update documentation.

* etc/NEWS: Add news entry.
2024-03-21 12:41:44 +02:00
Stefan Monnier
e624bc6275 (primitive-function): New type
The type hierarchy and `cl-type-of` code assumed that `subr-primitive`
only applies to functions, but since it also accepts special-forms it makes
it an unsuitable choice since it can't be a subtype of `compiled-function`.
So, use a new type `primitive-function` instead.

* lisp/subr.el (subr-primitive-p): Fix docstring (bug#69832).
(primitive-function-p): New function.

* lisp/emacs-lisp/cl-preloaded.el (primitive-function): Rename
from `subr-primitive` since `subr-primitive-p` means something else.

* src/data.c (Fcl_type_of): Return `primitive-function` instead
of `subr-primitive` for C functions.
(syms_of_data): Adjust accordingly.

* test/src/data-tests.el (data-tests--cl-type-of): Remove workaround.
2024-03-18 09:32:49 -04:00
Stefan Monnier
706403f2aa (cl-type-of): New function to return more precise types (bug#69739)
* src/data.c (Fcl_type_of): New function, extracted from `Ftype_of`.
Make it return more precise types for symbols, integers, and subrs.
(Ftype_of): Use it.
(syms_of_data): Define the corresponding new symbols and defsubr
the new function.

* doc/lispref/objects.texi (Type Predicates): Document it.

* src/comp.c (emit_limple_insn): Use `Fcl_type_of`.

* lisp/emacs-lisp/cl-preloaded.el (subr): Demote it to `atom`.
(subr-native-elisp, subr-primitive): Add `compiled-function` as
parent instead.
(special-form): New type.

* lisp/obsolete/eieio-core.el (cl--generic-struct-tag):
* lisp/emacs-lisp/cl-generic.el (cl--generic-typeof-generalizer):
Use `cl-type-of`.
cl--generic--unreachable-types): Update accordingly.

test/src/data-tests.el (data-tests--cl-type-of): New test.
2024-03-18 09:29:47 -04:00
Juri Linkov
c29b6df227 * lisp/tab-bar.el (tab-bar-select-restore-windows): New defcustom.
(tab-bar-select-restore-windows): New function.
(tab-bar-select-tab): Let-bind window-restore-killed-buffer-windows
to tab-bar-select-restore-windows (bug#68235).
2024-03-17 19:57:05 +02:00
Protesilaos Stavrou
67b0c1c09e
Update modus-themes to their 4.4.0 version
* doc/misc/modus-themes.org: Update the manual to better document
existing functionality and cover the new features.

* etc/themes/modus-operandi-deuteranopia-theme.el:
* etc/themes/modus-operandi-theme.el:
* etc/themes/modus-operandi-tinted-theme.el:
* etc/themes/modus-operandi-tritanopia-theme.el:
* etc/themes/modus-vivendi-deuteranopia-theme.el:
* etc/themes/modus-vivendi-theme.el:
* etc/themes/modus-vivendi-tinted-theme.el:
* etc/themes/modus-vivendi-tritanopia-theme.el: Update the
palette of each theme.

* etc/themes/modus-themes.el (require): Remove call to cl-lib
and do not use relevant functions.
(modus-themes-operandi-colors, modus-themes-vivendi-colors)
(modus-themes-version, modus-themes-report-bug): Remove old
calls to 'make-obsolete' and related.

(modus-themes--annotate-theme): Tweak the completion annotation function.

(modus-themes--org-block): Deprecate the user option 'modus-themes-org-blocks'.
(modus-themes-faces): Update faces.
(modus-themes-custom-variables): Update the list of custom
variables.

Detailed release notes are available here:
<https://protesilaos.com/codelog/2024-03-17-modus-themes-4-4-0/>.
2024-03-17 18:46:15 +02:00
Eli Zaretskii
d855f1c3f9 ; Fix recent changes in documentation
* doc/lispref/markers.texi (Information from Markers):
* etc/NEWS: Improve description of 'marker-last-position'.
2024-03-16 11:58:56 +02:00
Martin Rudalics
c12852bbf6 Document and announce 'marker-last-position'
* doc/lispref/markers.texi (Information from Markers): Document
'marker-last-position'.
* etc/NEWS: Announce 'marker-last-position'.
* src/window.c (window_restore_killed_buffer_windows): Minor
doc-string fix.
* doc/lispref/windows.texi (Window Configurations): Minor fix.
2024-03-16 10:46:02 +01:00
Eli Zaretskii
bf3d296d24 ; Fix documentation of a recent change (bug#68235)
* etc/NEWS:
* doc/lispref/windows.texi (Window Configurations): Improve
wording of 'window-restore-killed-buffer-windows's doc.
* src/window.c (syms_of_window)
<window-restore-killed-buffer-windows>: Doc fix.

* etc/NEWS:
* doc/lispref/buffers.texi (Buffer Names): Document
'buffer-last-name'.
2024-03-15 14:22:14 +02:00
Martin Rudalics
5bba1b95b8 Further adjustments for restoring killed buffer windows (Bug#68235)
* etc/NEWS: Announce 'window-restore-killed-buffer-windows'.
* src/buffer.h (struct buffer) : New field last_name_.
* src/buffer.c (Fbuffer_last_name): New function to return last
name of buffer before it was killed or renamed.
(bset_last_name, Fget_buffer_create, Fmake_indirect_buffer)
(Frename_buffer, Fkill_buffer, init_buffer_once): Set buffer's
last_name_ field accordingly.
* src/window.c (window_restore_killed_buffer_windows): New
variable replacing Vwindow_kept_windows_functions.
(Fset_window_configuration): Use
window_restore_killed_buffer_windows instead of
Vwindow_kept_windows_functions.
* lisp/window.el (window--state-put-2, window-state-put): Use
'window-restore-killed-buffer-windows' instead of
'window-kept-windows-functions'.
* doc/lispref/windows.texi (Window Configurations): Describe
'window-restore-killed-buffer-windows' which replaces
'window-kept-windows-functions'.
2024-03-15 10:35:27 +01:00
Eli Zaretskii
1c4233b9a3 ; Fix documentation of 'flyspell-check-changes'
* lisp/textmodes/flyspell.el (flyspell-check-changes): Doc fixes.

* etc/NEWS: Improve wording of entry for 'flyspell-check-changes'.
2024-03-15 10:44:23 +02:00
Juri Linkov
f03f14165e * lisp/textmodes/flyspell.el (flyspell-check-changes): New user option.
(flyspell--mode-on): Add flyspell-check-changes to post-command-hook
when flyspell-check-changes is non-nil.
(flyspell--mode-off): Remove flyspell-check-changes from post-command-hook.
(flyspell-check-changes): New function (bug#61874).
2024-03-14 20:11:33 +02:00
Noé Lopez
f6a27bc32d Add user option to disable JavaScript in xwidget webview
* src/xwidget.c: Add the 'xwidget-webkit-disable-javascript'
variable to disable JavaScript in WebKit sessions.  (Bug#68604)

* etc/NEWS:
* doc/emacs/misc.texi (Embedded Webkit Widgets): Document
the change.
2024-03-14 11:17:24 +02:00
Tim Ruffing
6f46dd516b Continue reading in 'read-event' etc. at the end of a keyboard macro
This fixes a bug that could make 'read-event', 'read-char', and
'read-char-exclusive' erroneously return -1, an internal magic return
value of 'read_char' leaked from C to lisp. Instead of returning -1, the
aforementioned lisp functions now transparently continue reading
available input (e.g., from the keyboard) when reaching the end of a
keyboard macro.

* src/keyboard.c (read_char, read_key_sequence): Move handling
of the end of a keyboard macro from 'read_char' to its caller
'read_key_sequence', which is the only caller that can
meaningfully deal with this case.
* src/macros.c (Fexecute_kbd_macro): Document how the end of keyboard
macro is processed.
* etc/NEWS: Announce this change.
2024-03-10 10:40:13 -04:00
Stefan Monnier
c79a509384 Add non-TS modes as extra parent of TS modes (bug#68246)
Record the fact that TS modes are alternatives to the non-TS
modes using the new `derived-mode-add-parents` functionality.
Do the same for long standing similar issues with CPerl-mode.

* lisp/textmodes/yaml-ts-mode.el (yaml-ts-mode):
* lisp/textmodes/toml-ts-mode.el (toml-ts-mode):
* lisp/textmodes/html-ts-mode.el (html-ts-mode):
* lisp/textmodes/css-mode.el (css-ts-mode):
* lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode, tsx-ts-mode):
* lisp/progmodes/sh-script.el (bash-ts-mode):
* lisp/progmodes/rust-ts-mode.el (rust-ts-mode):
* lisp/progmodes/ruby-ts-mode.el (ruby-ts-mode):
* lisp/progmodes/python.el (python-ts-mode):
* lisp/progmodes/lua-ts-mode.el (lua-ts-mode):
* lisp/progmodes/json-ts-mode.el (json-ts-mode):
* lisp/progmodes/js.el (js-ts-mode):
* lisp/progmodes/java-ts-mode.el (java-ts-mode):
* lisp/progmodes/heex-ts-mode.el (heex-ts-mode):
* lisp/progmodes/go-ts-mode.el (go-ts-mode, go-mod-ts-mode):
* lisp/progmodes/elixir-ts-mode.el (elixir-ts-mode):
* lisp/progmodes/dockerfile-ts-mode.el (dockerfile-ts-mode):
* lisp/progmodes/csharp-mode.el (csharp-ts-mode):
* lisp/progmodes/cmake-ts-mode.el (cmake-ts-mode):
* lisp/progmodes/c-ts-mode.el (c-ts-mode, c++-ts-mode):
Add non-TS mode as extra parent.

* lisp/progmodes/cperl-mode.el (cperl-mode): Add `perl-mode` as
extra parent.
2024-03-09 10:29:06 -05:00
Stefan Monnier
4fdcbd09af cl-preloaded.el (built-in-class): New type
Add classes describing the built-in types.

* lisp/emacs-lisp/cl-preloaded.el (built-in-class): New type.
(cl--define-built-in-type): New aux macro.
(all built-in types): "Define" them with it.
(cl--builtin-type-p): New aux function.
(cl--struct-name-p): Use it.
(cl--direct-supertypes-of-type, cl--typeof-types, cl--all-builtin-types):
Move the definitions to after the built-in classes are defined,
and rewrite to make use of those classes.

* lisp/emacs-lisp/cl-extra.el (cl-describe-type):
Accept two (unused) optional args, for use with `describe-symbol-backends`.
(describe-symbol-backends): Simplify accordingly and
add ourselves at the end.
(cl--class-children): New function.
(cl--describe-class): Use it.  Also don't show a silly empty list of slots
for the built-in types.
2024-03-08 02:03:55 -05:00
Mattias Engdegård
61b2f5f96b Single string literal in body is return value only, not doc string
A function or macro body consisting of a single string literal now only
uses it as a return value.  Previously, it had the dual uses as return
value and doc string, which was never what the programmer wanted and
had some inconvenient consequences (bug#69387).

This change applies to `lambda`, `defun`, `defsubst` and `defmacro`
forms; most other defining forms already worked in the sensible way.

* lisp/emacs-lisp/bytecomp.el (byte-compile-lambda):
Don't use a lone string literal as doc string.
* test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-defun.el
(foo): Update docstring warning test.
* doc/lispref/functions.texi (Function Documentation): Update.
* etc/NEWS: Announce.
2024-03-07 13:47:53 +01:00
Jim Porter
59e470dd5d When navigating through history in EWW, don't keep adding to 'eww-history'
This resolves an issue where navigating back and then forward kept
adding new history entries so you could never hit the "end" (bug#69232).

* lisp/net/eww.el (eww-before-browse-history-function): New option.
(eww-history-position): Add docstring.
(eww-mode-map, eww-context-menu): Use correct predicates for when to
enable back/forward.
(eww-save-history): Save history entry in its original place when
viewing a historical page.
(eww--before-browse): New function...
(eww, eww-follow-link, eww-readable): ... call it.
(eww-render): Don't set 'eww-history-position' here...
(eww--before-browse): ... instead, set it here.
(eww-back-url): Set 'eww-history-position' based on the result of
'eww-save-history'.
(eww-forward-url): Set 'eww-history-position' directly, since
'eww-save-history' no longer adds a new entry in this case.
(eww-delete-future-history, eww-clone-previous-history): New functions.

* test/lisp/net/eww-tests.el: New file.

* etc/NEWS: Announce this change.
2024-03-06 14:36:23 -08:00
Eli Zaretskii
33976ecf24 ; * etc/NEWS: Fix wording and punctuation of a recently added entry. 2024-03-05 19:32:29 +02:00
Juri Linkov
3cb0614507 * lisp/tab-bar.el (tab-bar-tab-post-select-functions): New hook (bug#69093).
(tab-bar-select-tab): Call tab-bar-tab-post-select-functions at the end.
2024-03-05 19:14:28 +02:00
Juri Linkov
f16a85e317 New property 'context-menu-functions' (bug#62250)
* lisp/iimage.el (iimage-mode-buffer): Set context-menu-functions
text property to '(image-context-menu)'.

* lisp/image.el (image-context-menu): New function.
(put-image): Set context-menu-functions overlay property
to '(image-context-menu)'.
(insert-image, insert-sliced-image): Set context-menu-functions
text property to '(image-context-menu)'.

* lisp/mouse.el (context-menu-map): Use mouse-posn-property
'context-menu-functions' and call its funs at the end.
2024-03-05 18:50:51 +02:00
Stefan Monnier
167c17c1ad admin/syncdoc-type-hierarchy.el: Move from etc
AFAICT `admin` is where we keep these kinds of files.
2024-03-04 12:02:45 -05:00
Mattias Engdegård
3b7cb55e5b ; * etc/NEWS: add missing definite article 2024-03-04 14:13:26 +01:00
Stefan Monnier
2b5d43081a (major-mode-remap(-defaults)): New var and function (bug#69191)
While `major-mode-remap-alist` provides a way for users to indicate the
major mode of their choice, we need a similar variable for the
use of packages.

This patch adds a new `major-mode-remap-defaults` and changes various
packages to obey it or make use of it.
I think it nicely cleans the regexp duplication between CC-mode and
`c-ts-mode.el` and also makes it easier/cleaner for users to override
the changes made by `*-ts-mode.el`.

* lisp/files.el (major-mode-remap-defaults): New variable.
(major-mode-remap): New function.
(set-auto-mode-0): Use it.
* doc/lispref/modes.texi (Auto Major Mode): Document them.

* lisp/textmodes/tex-mode.el (tex--redirect-to-submode):
Use `major-mode-remap`.
(major-mode-remap-defaults): Set it to remap AUCTeX modes by default.
* lisp/progmodes/ruby-ts-mode.el (auto-mode-alist): Leave it alone.
(major-mode-remap-defaults): Set this one instead.
* lisp/progmodes/c-ts-mode.el (c-or-c++-ts-mode): Use `major-mode-remap`.
(auto-mode-alist): Leave it alone.
(major-mode-remap-defaults): Set this one instead.
* lisp/org/ox.el (org-export-to-buffer): Modernize docstring accordingly.
* lisp/progmodes/cc-mode.el (c-or-c++-mode):
* lisp/org/ox-latex.el (org-latex-export-as-latex):
* lisp/org/ox-koma-letter.el (org-koma-letter-export-as-latex):
* lisp/org/ox-beamer.el (org-beamer-export-as-latex):
Use `major-mode-remap` when available.
2024-03-03 23:58:18 -05:00
Yoshiku Onu
c3dc64a107 Add new input method "english-colemak"
* lisp/leim/quail/latin-post.el ("english-colemak"): New input
method.  (Bug#69471)

* etc/NEWS: Announce it.

Copyright-paperwork-exempt: yes
2024-03-02 10:00:10 +02:00
Andrea Corallo
c55694785e Merge branch 'feature/type-hierarchy' into 'master' 2024-03-01 09:30:44 +01:00
Eli Zaretskii
4dd4f145b8 ; Improve documentation of last changeset (bug#69305)
* etc/NEWS (Example):
* doc/lispref/modes.texi (Tabulated List Mode): Improve
documentation of 'Buffer-menu-group-by' and
'tabulated-list-groups'.

* lisp/buff-menu.el (Buffer-menu-group-by): Doc fix.
2024-02-29 20:57:12 +02:00