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.
Stefan Kangas [Wed, 18 Dec 2024 02:46:04 +0000 (03:46 +0100)]
Make font-lock face variables obsolete
Using these variables as "another mechanism for changing face
appearance" never really worked, since mode authors were free to use the
face instead of the variable (i.e. quoting the symbol). This means that
when users customized the variables, it would change its appearance only
in some cases, which is a rather surprising interface.
Indeed, it turns out that some modes have not always been consistent,
and mixed using the variable and the face, increasing the confusion even
further. Thus, the only thing users could rely on to always work was to
leave the variables at their default value, and to customize the face.
We now recommend customizing the face, and are obsoleting these
variables. This will lead to some minor code-churn, but it is believed
that it will be ultimately worth it. To fix existing Lisp code, you
should typically only need to quote the symbol, as this commit shows.
It might be the case that we will have to keep the obsolete variables,
that have been with us since Emacs 19, around for a longer time-period
than normal, to allow package authors to adapt.
* lisp/font-lock.el (font-lock-comment-face)
(font-lock-comment-delimiter-face, font-lock-string-face)
(font-lock-doc-face, font-lock-doc-markup-face, font-lock-keyword-face)
(font-lock-builtin-face, font-lock-function-name-face)
(font-lock-variable-name-face, font-lock-type-face)
(font-lock-constant-face, font-lock-warning-face)
(font-lock-negation-char-face, font-lock-preprocessor-face): Make face
variables obsolete in favor of customizing the faces directly
instead. (Bug#71469)
* doc/lispref/modes.texi (Faces for Font Lock): Don't document above
obsolete variables.
Juri Linkov [Tue, 17 Dec 2024 18:51:03 +0000 (20:51 +0200)]
Display commands with repeat-continue-only in describe-repeat-maps
* lisp/repeat.el (describe-repeat-maps): Display commands with the
property 'repeat-continue-only' used to continue the currently
active repeat-map (bug#74140). Also use 'cl--map-keymap-recursively'
instead of 'map-keymap' to find more deep keybindings.
Juri Linkov [Tue, 17 Dec 2024 18:45:42 +0000 (20:45 +0200)]
Improve support of property repeat-continue-only in repeat-mode (bug#74140)
* lisp/repeat.el (repeat-get-map): Add optional arg 'rep-map'.
Move the check for 'repeat-continue-only' from 'repeat-pre-hook'.
Improve its logic to check if the current map 'repeat-in-progress'
exists in the list from the 'repeat-continue-only' property.
(repeat-post-hook): Set 'repeat-in-progress' to the symbol
from the property 'repeat-map'.
* test/lisp/repeat-tests.el (repeat-tests-another-repeat-map):
Add new keymap to test multiple parallel repeat-maps.
(repeat-tests-continue-another): New test that uses commands
from 'repeat-tests-another-repeat-map' shared with
'repeat-tests-repeat-map'.
Stefan Kangas [Mon, 16 Dec 2024 22:58:34 +0000 (23:58 +0100)]
unintern: Drop support for obsolete calling convention
* lisp/subr.el (unintern):
* src/lread.c (Funintern): Drop support for old calling convention,
obsolete since 23.3.
* test/lisp/progmodes/elisp-mode-tests.el
(elisp-shorthand-escape): Don't use obsolete calling convention.
Stefan Kangas [Mon, 16 Dec 2024 21:21:37 +0000 (22:21 +0100)]
all-completions: Drop support for obsolete calling convention
* src/minibuf.c (Fall_completions):
* lisp/subr.el (all-completions): Drop support for old calling
convention, obsolete since 23.1.
* src/minibuf.c (Finternal_complete_buffer): Update caller.
Stefan Kangas [Mon, 16 Dec 2024 20:43:29 +0000 (21:43 +0100)]
Bind inhibit-read-only to t in substitute-command-keys
* lisp/help.el (substitute-command-keys): Bind inhibit-read-only to t,
to allow modifying strings that are intended for the minibuffer, and
therefore already use minibuffer-prompt-properties.
Ship Mints [Mon, 16 Dec 2024 16:58:10 +0000 (17:58 +0100)]
Support pixelwise frame cloning (Bug#74750)
* lisp/frame.el (clone-frame): Honor 'frame-resize-pixelwise'
when cloning a frame's geometry via the 'text-pixels' feature of
'make-frame' (Bug#74750). Correctly specify source frame in
'display-graphic-p' test for tty selection behavior.
john muhl [Sun, 15 Dec 2024 23:15:35 +0000 (17:15 -0600)]
Add Qutebrowser to list of choices in customize
* lisp/net/browse-url.el (browse-url--browser-defcustom-type):
Include 'browse-url-qutebrowser' so that it appears in the Choice
menus of 'browse-url-browser-function' and
'browse-url-secondary-browser-function'. (Bug#74904)
Stefan Kangas [Mon, 16 Dec 2024 02:26:48 +0000 (03:26 +0100)]
Invert preprocessor condition to fix 'C-x 4 a'
Typing 'C-x 4 a' in the main function now correctly adds 'main' to the
generated ChangeLog, whereas before it added 'andreid_emacs_init'.
Inverting the preprocessor condition seems like an easier fix than
changing the add-change-log-entry-other-window heuristic.
* src/emacs.c (main): Invert preprocessor condition to appease the
'add-change-log-entry-other-window' heuristic.
Stefan Kangas [Sun, 15 Dec 2024 23:01:43 +0000 (00:01 +0100)]
Move pure+side-effect-free declarations to byte-opt.el
* src/json.c (syms_of_json): Move pure and side-effect-free declarations
for json-serialize and json-parse-string from here...
* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns, pure-fns):
...to here.
Stefan Monnier [Sun, 15 Dec 2024 22:05:55 +0000 (17:05 -0500)]
trusted-content: Adjust the last patch based on preliminary feedback
* lisp/files.el (trusted-content): Rename from `trusted-files`.
Update all references.
* lisp/progmodes/elisp-mode.el (lisp-interaction-mode):
* lisp/ielm.el (inferior-emacs-lisp-mode):
* lisp/simple.el (read--expression): Set `trusted-content` since
these buffers contain code that the user presumably intends to run anyway.
(elisp--safe-macroexpand-all): Make the warning more discreet.
Stefan Monnier [Tue, 10 Dec 2024 21:26:31 +0000 (16:26 -0500)]
elisp-mode.el: Disable Flymake byte-compile backend in untrusted files
To address serious security issues (CVE-2024-53920), disable
`elisp-flymake-byte-compile` except in those files explicitly
specified as "trusted".
For that introduce a new custom var `trusted-files` and new
function `trusted-content-p`.
While at it, similarly skip the implicit macroexpansion done during
completion if the current file is not trusted.
* lisp/files.el (trusted-files): New variable.
(trusted-content-p): New function.
* lisp/progmodes/elisp-mode.el (elisp--safe-macroexpand-all):
New function, extracted from `elisp--local-variables`.
Use `trusted-content-p`.
(elisp--local-variables): Use it.
(elisp-flymake-byte-compile): Disable according to `trusted-content-p`.