Stefan Kangas [Thu, 26 Dec 2024 20:17:28 +0000 (21:17 +0100)]
Improve flag variable names in uniquify
* lisp/uniquify.el (uniquify-after-kill-buffer-flag)
(uniquify-trailing-separator-flag): Rename from
'uniquify-after-kill-buffer-p' and 'uniquify-trailing-separator-p', to
better adhere to our conventions. Update all users and leave old names
as obsolete variable aliases.
Visuwesh [Thu, 26 Dec 2024 11:49:41 +0000 (17:19 +0530)]
Ensure Dired window is selected when reverting buffer
* lisp/dired.el (dired--make-directory-clickable): Ensure the
Dired window is selected. This prevents erroneously reverting a
non-Dired buffer. (Bug#74700)
Morgan Willcock [Wed, 25 Dec 2024 09:47:42 +0000 (09:47 +0000)]
Set marker insertion type for Imenu markers
* lisp/imenu.el (imenu-default-create-index-function)
(imenu--generic-function): Configure Imenu markers to advance
their position when characters are inserted at the marker
position. (Bug#75072)
Visuwesh [Thu, 12 Dec 2024 13:28:37 +0000 (18:58 +0530)]
Show the keybinding next to command in calc's x
* lisp/calc/calc-ext.el (calc-execute-extended-command): Use
M-x's ':affixation-function' to show the keybinding of the calc
command next to its name. (Bug#74829)
Dmitry Gutov [Thu, 26 Dec 2024 04:17:40 +0000 (06:17 +0200)]
ruby-ts--s-p-query: Put '_' syntax on ?! method definitions
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--s-p-query):
Put 'symbol' syntax on method definitions ending with [?!].
Reported in https://github.com/dgutov/robe/issues/149.
Juri Linkov [Wed, 25 Dec 2024 17:52:10 +0000 (19:52 +0200)]
* lisp/treesit.el: Improvements for treesit-explore-mode (bug#75079)
(treesit-explorer-switch-parser): Don't use completing-read
on the single parser.
(treesit-explore-mode): Don't save treesit-explore-mode to the desktop.
Nicholas Vollmer [Tue, 23 Jan 2024 14:39:02 +0000 (09:39 -0500)]
Fix checkdoc warnings in dictionary.el
* lisp/net/dictionary.el (dictionary-tool-bar-map): Add missing period.
(dictionary-process-popup-replies)
(dictionary-read-definition)
(dictionary-display-tooltip): Rename ignored parameters.
(dictionary-tooltip-track-mouse): Describe what function does, not just
when.
(dictionary-switch-tooltip-mode): Reword docstring in terms of ON
parameter. (Bug#68684)
Yuan Fu [Tue, 24 Dec 2024 21:17:51 +0000 (13:17 -0800)]
Add treesit-aggregated-simple-imenu-settings
Now we support setting up Imenu for multiple languages
* doc/lispref/modes.texi: Update manual.
* lisp/treesit.el:
(treesit-aggregated-simple-imenu-settings): New variable.
(treesit--imenu-merge-entries): New function.
(treesit--generate-simple-imenu): This was previously
treesit-simple-imenu.
(treesit-simple-imenu): Support
treesit-aggregated-simple-imenu-settings.
(treesit-major-mode-setup): Recognize
treesit-aggregated-simple-imenu-settings.
* test/src/treesit-tests.el (treesit-imenu): New test.
Yuan Fu [Tue, 24 Dec 2024 05:19:32 +0000 (21:19 -0800)]
Add treesit-language-display-name
* lisp/treesit.el:
(treesit-language-display-name-alist): New variable.
(treesit-language-display-name): New function.
* doc/lispref/parsing.texi (Language Grammar): Add to manual.
* etc/NEWS: Add to NEWS.
Juri Linkov [Tue, 24 Dec 2024 07:40:21 +0000 (09:40 +0200)]
* lisp/progmodes/typescript-ts-mode.el: Fix regexp-opt of treesit-thing.
(typescript-ts-base-mode): Add arg 'symbols' to regexp-opt of 'sexp',
'sexp-list', 'sentence', 'text' (bug#73404, bug#74366, bug#74963).
(tsx-ts-mode): Add arg 'symbols' to regexp-opt of 'sexp', 'sentence'.
This avoids such mismatches as "string_fragment" by "string".
Martin Rudalics [Mon, 23 Dec 2024 09:59:11 +0000 (10:59 +0100)]
Make 'fit-frame-to-buffer' work around size hints (Bug#74866)
* lisp/window.el (fit-frame-to-buffer-1): When
'frame-resize-pixelwise' is nil, round up requested sizes to avoid
that lines get wrapped (Bug#74866).
* doc/lispref/windows.texi (Resizing Windows): Mention that with
size hints one may have to set 'frame-resize-pixelwise' to make
'fit-frame-to-buffer' fit the buffer exactly.
Juri Linkov [Sun, 22 Dec 2024 19:15:18 +0000 (21:15 +0200)]
Add treesit thing 'sexp-list' to typescript-ts-mode (bug#73404)
* lisp/progmodes/typescript-ts-mode.el (typescript-ts-base-mode):
Add 'sexp-list' to 'treesit-thing-settings'.
(typescript-ts-mode--sexp-list-nodes): New variable.
Stefan Kangas [Sun, 22 Dec 2024 01:57:45 +0000 (02:57 +0100)]
Match more gdbinit files in auto-mode-alist
* lisp/files.el (auto-mode-alist): Match more gdbinit files,
including XDG, and MS-Windows. Avoid false positives.
(set-auto-mode--find-matching-alist-entry): Break out function...
(set-auto-mode--apply-alist): ...from here. (Bug#74946)
* test/lisp/files-tests.el (files-tests--check-mode): New function.
(files-tests-auto-mode-alist): New test.
Cecilio Pardo [Sun, 15 Dec 2024 00:13:16 +0000 (01:13 +0100)]
Add support for the ':data' keyword for play-sound in MS-Windows.
* src/sound.c (parse_sound) [WINDOWSNT]: Check that either :file
or :data is present.
(do_play_sound): Added parameter to select file or data, and code to
play from data.
(Fplay_sound_internal): Fixed volume format, and send file or data
to 'do_play_sound'. (Bug#74863)
* etc/NEWS: Add entry for this change.
* etc/PROBLEMS: Remove entry about missing support for :data.
JD Smith [Thu, 11 Jul 2024 20:24:17 +0000 (16:24 -0400)]
'seconds-to-string': new optional arguments for readable strings
* lisp/calendar/time-date.el (seconds-to-string): Accept new
optional arguments READABLE, ABBREV, and PRECISION, and format the
output string accordingly. (Bug#71572)
* doc/lispref/os.texi (Time Calculations):
* etc/NEWS: Document the new arguments of 'seconds-to-string'.
Daniel Mendler [Thu, 12 Dec 2024 11:15:10 +0000 (12:15 +0100)]
browse-url-with-browser-kind: Improve browser function selection
In order to find an appropriate browser function for the given
kind, first the browser handler lists are consulted. If no
handler is found, the `browse-url-browser-function',
`browse-url-secondary-browser-function`,
`browse-url-default-browser' and `eww' are tried in that order
until a browser function with a matching kind is found. This
way the user customization of `browse-url-browser-function' and
`browse-url-secondary-browser-function` is respected by
`browse-url-with-browser-kind'.
* lisp/net/browse-url.el (browse-url-with-browser-kind): Try the
browser functions in the aforementioned order. (Bug#74820)
F. Jason Park [Fri, 29 Nov 2024 23:56:47 +0000 (15:56 -0800)]
Use smarter default for erc-server-reconnect-function
* doc/misc/erc.texi (Sample Configuration): Remove customization in
`use-package' declaration for `erc-server-reconnect-function' as well as
related language in the customization walk-through. Do this because the
new default incorporates `erc-server-delayed-check-reconnect' behavior
for compatible connect functions.
* etc/ERC-NEWS: Announce new default for `erc-server-reconnect-function'.
* lisp/erc/erc-backend.el (erc-server-reconnect-function): Change
default to `erc-server-prefer-check-reconnect'.
(erc-server-delayed-check-reconnect): Use `process-send-string' instead
of `send-string'.
(erc--server-delayed-check-connectors): New variable.
(erc-server-prefer-check-reconnect): New function.
* test/lisp/erc/erc-scenarios-base-auto-recon.el
(erc-scenarios-base-auto-recon-unavailable)
(erc-scenarios-base-auto-recon-no-proto): Remove unnecessary
`erc-server-reconnect-function' binding because the new default
incorporates the behavior being tested for.
* test/lisp/erc/erc-scenarios-base-buffer-display.el
(erc-scenarios-base-buffer-display--reconnect-common):
* test/lisp/erc/erc-scenarios-base-compat-rename-bouncer.el
(erc-scenarios-common--base-compat-no-rename-bouncer):
* test/lisp/erc/erc-scenarios-base-netid-bouncer-recon-base.el
(erc-scenarios-base-netid-bouncer--recon-base):
* test/lisp/erc/erc-scenarios-base-netid-bouncer-recon-both.el
(erc-scenarios-base-netid-bouncer--recon-both):
* test/lisp/erc/erc-scenarios-base-netid-bouncer-recon-id.el
(erc-scenarios-base-netid-bouncer--reconnect-id-foo)
(erc-scenarios-base-netid-bouncer--reconnect-id-bar):
* test/lisp/erc/erc-scenarios-base-reconnect.el
(erc-scenarios-base-reconnect-timer)
(erc-scenarios-base-cancel-reconnect):
* test/lisp/erc/erc-scenarios-services-misc.el
(erc-scenarios-services-misc--reconnect-retry-nick):
* test/lisp/erc/erc-scenarios-stamp.el
(erc-scenarios-stamp--date-mode/reconnect): Explicitly bind
`erc-server-reconnect-function' to `erc-server-delayed-reconnect', the
former default, which does not do any probing. (Bug#62044)
F. Jason Park [Tue, 23 Apr 2024 01:11:24 +0000 (18:11 -0700)]
Add command for teaching Imenu about ERC macros
* lisp/erc/erc-backend.el (define-erc-response-handler): Add
`doc-string' to `declare' specification.
* test/lisp/erc/resources/erc-tests-common.el
(erc-tests-common-add-imenu-expressions): New function for defining and
undefining Imenu patterns useful to ERC developers.
F. Jason Park [Wed, 18 Dec 2024 01:53:34 +0000 (17:53 -0800)]
Disable which-func-mode in erc-imenu buffers
* lisp/erc/erc-imenu.el (erc-imenu-setup): Move after module definition
so the variable `erc-imenu-mode' is defined. Run teardown code when
module is deactivated. Set `which-func-mode' to nil locally.
(erc-imenu-mode, erc-imenu-enable, erc-imenu-disable): Manage membership
of `erc-imenu--disable-which-func' in `which-function-mode-hook'.
(erc-imenu--disable-which-func): New function. (Bug#74934)
Some completion resolution requests in
eglot-completion-at-point, specifically those that might be
triggered from the :exit function, can't be cancellable, else
the completion edit or snippet will never be obtained and the
user is left with the nonsensical completion label in the
buffer.
Eli Zaretskii [Fri, 20 Dec 2024 20:06:06 +0000 (22:06 +0200)]
Autoload 'shortdoc-help-fns-examples-function'
* lisp/help-fns.el (shortdoc-help-fns-examples-function):
Autoload, to allow adding it to
'help-fns-describe-function-functions' as advertised. (Bug#74995)
Martin Rudalics [Fri, 20 Dec 2024 15:25:44 +0000 (16:25 +0100)]
On GTK do not inhibit implied resizing until tool bar was drawn (Bug#74750)
* src/frame.c (frame_inhibit_resize): Under GTK do not inhibit
implied resizing as long as the tool bar has not been drawn yet
so the frame gets its intended initial height (Bug#74750).
* src/gtkutil.c (update_frame_tool_bar): Set tool_bar_resized
slot of frame f to true regardless of whether a tool bar was
made or not. This will make inhibiting implied resizes work
again from now on.
Yuan Fu [Fri, 20 Dec 2024 07:10:32 +0000 (23:10 -0800)]
Add automated process to verify tree-sitter queries
This allows us to inform packagers of the grammar version they
want to use when packaging tree-sitter grammars with Emacs.
* lisp/treesit.el (treesit--builtin-language-sources):
New variable.
(treesit--verify-major-mode-queries):
(treesit-verify-major-mode-queries): New functions.
Yuan Fu [Fri, 20 Dec 2024 03:02:59 +0000 (19:02 -0800)]
Add keyword :reversed to treesit-font-lock-rules
This keyword will be useful for implementing
string-interpolation feature.
* doc/lispref/modes.texi (Parser-based Font Lock): Document the
new keyword.
* lisp/treesit.el (treesit-font-lock-settings): Document.
(treesit-font-lock-setting-reversed): New function.
(treesit-font-lock-rules): Add new keyword.
(treesit-font-lock-recompute-features): Handle new keyword.
* src/msdos.c (mouse_get_xy, mouse_moveto, mouse_pressed):
Offset mouse positions by those of the selected frame.
(it_face_override): New function.
(IT_set_face): New argument F. Load FACE_ID from its face
cache.
(IT_write_glyphs): Track the frames on which glyphs were
generated and apply faces from their individual face caches.
(IT_write_glyphs_with_face): New function.
(tty_draw_row_with_mouse_face): Reimplement in line with tty.c
and eliminate an obsolete optimization.
(IT_clear_end_of_line, IT_clear_screen): Load faces from the
cache of the provided frame.
(IT_set_frame_parameters): Adjust frame geometry and garbage
frames after geometry parameters change as a child frame.
(BUILD_CHAR_GLYPH): Accept new parameter F.
(IT_menu_display): Offset cursor positions by those of the
selected frame.
* src/msdos.h (ENOTSUP): Move to conf_post.h for Gnulib.
* src/xdisp.c (redisplay_internal): Redisplay MSDOS frames
unconditionally as with terminal frames.
Robert Pluim [Thu, 19 Dec 2024 15:17:16 +0000 (16:17 +0100)]
Add more documentation for TTY child frames
* doc/lispref/frames.texi (Child Frames): Document that TTY
child frames are now supported.
* etc/NEWS: Document another limitation of TTY child frames.
Robert Pluim [Wed, 18 Dec 2024 13:50:06 +0000 (14:50 +0100)]
Fix network test failure when using VPN client
When using certain VPN clients, the interface info returned by
'getifaddrs' does not have the address family filled in for the
ifa_netmask component (this is allowed by the standard, since
the value is not specified). The resulting address info causes
network tests suite failures. Fix by copying the address family
from the returned interface address.
* src/process.c (network_interface_list): Copy the interface address
sa_family to the netmask address.
(Fnetwork_lookup_address_info): Fix test for non-IP addresses to
properly account for IPv6.
* test/src/process-tests.el (process-tests-check-bug-74907): New
test, checks that 'network-interface-list' output is as
expected.
Gerd Möllmann [Fri, 15 Nov 2024 12:34:55 +0000 (13:34 +0100)]
Don't pause display for pending input
* src/dispnew.c: Remove display_completed, redisplay_dont_pause,
redisplay-dont-pause was declared obsolete in Emacs 24. Remove anything
checking pending input, change function signatures accordingly, and so
on.
* src/keyboard.c (read_char): Don't use redisplay_dont_pause.
* src/minibuf.c (read_minibuf): Use new function signatures.
* src/xdisp.c: Don't check display_completed. Use new API.
Juri Linkov [Thu, 19 Dec 2024 07:27:28 +0000 (09:27 +0200)]
New treesit thing 'sexp-list' (bug#73404)
* lisp/treesit.el (treesit-forward-list): New command.
(treesit-forward-sexp): Check the thing 'text' only when
'treesit-sexp-type-regexp' is nil.
(treesit-forward-sexp-list): New function.
(treesit-navigate-thing): Don't try moving to parent
when thing is 'sexp-list'.
(treesit-major-mode-setup): Set 'forward-sexp-function' to
'treesit-forward-sexp-list' when the 'sexp-list' thing is defined.
Stefan Kangas [Thu, 19 Dec 2024 03:56:55 +0000 (04:56 +0100)]
Increase goto-address-fontify-maximum-size
The new value is ~4 times larger, and should be more than fine on any
reasonably modern machine. Alternatively, the default could be set to
t, as requested here:
https://lists.gnu.org/r/bug-gnu-emacs/2003-05/msg00114.html
* lisp/net/goto-addr.el (goto-address-fontify-maximum-size): Increase
default value from 30000 to 128 KiB.
Stefan Kangas [Thu, 19 Dec 2024 03:21:30 +0000 (04:21 +0100)]
Delete support for the Conkeror web browser
The last release of Conkeror was in 2017. The project has been actively
recommending people not to use it since 2019 due to security concerns,
and it was removed from Debian in the same year. Emacs's browse-url
support for Conkeror has been obsolete since in Emacs 28.1.
Stefan Kangas [Thu, 19 Dec 2024 00:33:56 +0000 (01:33 +0100)]
; Fix more obsoletion warnings
* lisp/progmodes/cc-awk.el (awk-font-lock-keywords):
* lisp/progmodes/cc-fonts.el (c-basic-matchers-before):
* lisp/progmodes/csharp-mode.el (c-basic-matchers-before): Use faces
instead of variables to silence an obsoletion warning. (Bug#71469)
Eli Zaretskii [Wed, 18 Dec 2024 19:16:07 +0000 (21:16 +0200)]
Avoid MinGW compilation warning in lib/
* nt/mingw-cfg.site (ac_cv_func_malloc_0_nonnull)
(gl_cv_malloc_ptrdiff, gl_cv_func_malloc_posix):
* nt/gnulib-cfg.mk (OMIT_GNULIB_MODULE_malloc-gnu): Set to avoid
compiling lib/malloc.c, which is not needed and causes a
compilation warning.